This commit is contained in:
Asaki Yuki
2025-10-15 19:40:24 +07:00
parent 2fcadb81fb
commit 335d805f19
2 changed files with 30 additions and 0 deletions

17
src/components/client.ts Normal file
View File

@@ -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)
})

13
tsconfig.json Normal file
View File

@@ -0,0 +1,13 @@
{
"compilerOptions": {
"target": "es2024",
"module": "commonjs",
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"skipLibCheck": true,
"sourceMap": true,
"outDir": "dist",
"rootDir": "src"
}
}