init
This commit is contained in:
commit
f50d6ae45f
9 changed files with 854 additions and 0 deletions
23
src/index.ts
Normal file
23
src/index.ts
Normal file
|
@ -0,0 +1,23 @@
|
|||
import { AllIntents, Client } from "oceanic.js";
|
||||
import { selfappReq } from "./selfappReq";
|
||||
import { setupJoinRequestHandler } from "./joinRequestHandler";
|
||||
|
||||
export const client = new Client({
|
||||
auth: `Bot ${process.env.BOT_TOKEN}`,
|
||||
gateway: {
|
||||
intents: AllIntents,
|
||||
compress: false
|
||||
}
|
||||
});
|
||||
|
||||
client.on("ready", async () => {
|
||||
console.log(`Logged in as ${client.user.tag}`);
|
||||
console.log("Checking user token");
|
||||
const selfappInfo = await selfappReq("/users/@me", "GET");
|
||||
if (!selfappInfo.username) console.error("Can't use selfapp");
|
||||
else console.log("Can use selfapp");
|
||||
|
||||
setupJoinRequestHandler(client.shards.first()!);
|
||||
});
|
||||
|
||||
client.connect();
|
Loading…
Add table
Add a link
Reference in a new issue