tsc
This commit is contained in:
17
src/components/client.ts
Normal file
17
src/components/client.ts
Normal 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
13
tsconfig.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "es2024",
|
||||
"module": "commonjs",
|
||||
"esModuleInterop": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"strict": true,
|
||||
"skipLibCheck": true,
|
||||
"sourceMap": true,
|
||||
"outDir": "dist",
|
||||
"rootDir": "src"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user