From 335d805f19cd3da20c2b93f7648dfdd1713e7547 Mon Sep 17 00:00:00 2001 From: Asaki Yuki <108646953+AsakiYuki@users.noreply.github.com> Date: Wed, 15 Oct 2025 19:40:24 +0700 Subject: [PATCH] tsc --- src/components/client.ts | 17 +++++++++++++++++ tsconfig.json | 13 +++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 src/components/client.ts create mode 100644 tsconfig.json diff --git a/src/components/client.ts b/src/components/client.ts new file mode 100644 index 0000000..ed70c15 --- /dev/null +++ b/src/components/client.ts @@ -0,0 +1,17 @@ +import { Client, GatewayIntentBits } from "discord.js" + +const token: string | undefined = process.env.DISCORD_BOT_TOKEN + +if (!token) { + console.error("Missing DISCORD_BOT_TOKEN environment variable") + process.exit(1) +} + +export const client = new Client({ + intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildVoiceStates], +}) + +client.login(token).catch(error => { + console.error("Failed to login to Discord:", error) + process.exit(1) +}) \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..318016e --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,13 @@ +{ + "compilerOptions": { + "target": "es2024", + "module": "commonjs", + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "strict": true, + "skipLibCheck": true, + "sourceMap": true, + "outDir": "dist", + "rootDir": "src" + } +}