Base structure
This commit is contained in:
18
src/client/index.ts
Normal file
18
src/client/index.ts
Normal file
@ -0,0 +1,18 @@
|
||||
import { Client, GatewayIntentBits } from "discord.js";
|
||||
|
||||
const client = new Client({
|
||||
intents: [
|
||||
GatewayIntentBits.Guilds
|
||||
]
|
||||
});
|
||||
|
||||
const token = process.env["TOKEN"];
|
||||
if (!token) throw new ReferenceError("TOKEN environment variable is missing");
|
||||
|
||||
client.login(token);
|
||||
|
||||
client.on("ready", () => {
|
||||
console.log(`Connected to Discord API. Bot account is ${client.user?.tag} (${client.user?.id})`);
|
||||
});
|
||||
|
||||
export default client;
|
Reference in New Issue
Block a user