added discord container for renaming and role-management
This commit is contained in:
19
apps/discord-server/modules/discord.ts
Normal file
19
apps/discord-server/modules/discord.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { Client, GatewayIntentBits } from "discord.js";
|
||||
|
||||
const client = new Client({
|
||||
intents: [GatewayIntentBits.Guilds],
|
||||
});
|
||||
|
||||
const token = process.env.DISCORD_BOT_TOKEN;
|
||||
|
||||
if (!token) {
|
||||
throw new Error("DISCORD_BOT_TOKEN environment variable is not set.");
|
||||
}
|
||||
|
||||
client.login(token);
|
||||
|
||||
client.on("ready", () => {
|
||||
console.log(`Logged in as ${client.user?.tag}`);
|
||||
});
|
||||
|
||||
export default client;
|
||||
Reference in New Issue
Block a user