This commit is contained in:
nin0 2025-05-11 09:33:31 -04:00
commit f50d6ae45f
Signed by: nin0
SSH key fingerprint: SHA256:NOoDnFVvZNFvqfXCIhzr6oCTDImZAbTTuyAysZ8Ufk8
9 changed files with 854 additions and 0 deletions

23
src/index.ts Normal file
View 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();