mirror of
https://github.com/ahmadk953/poixpixel-discord-bot.git
synced 2025-04-02 09:44:14 +00:00
17 lines
No EOL
606 B
TypeScript
17 lines
No EOL
606 B
TypeScript
// Require the necessary discord.js classes
|
|
import { Client, Events, GatewayIntentBits } from 'discord.js';
|
|
import config from '../config.json' assert { type: 'json' };
|
|
|
|
const { token } = config;
|
|
|
|
// Create a new client instance
|
|
const client = new Client({ intents: [GatewayIntentBits.Guilds] });
|
|
|
|
// When the client is ready, run this code (only once)
|
|
// We use 'c' for the event parameter to keep it separate from the already defined 'client'
|
|
client.once(Events.ClientReady, c => {
|
|
console.log(`Ready! Logged in as ${c.user.tag}`);
|
|
});
|
|
|
|
// Log in to Discord with your client's token
|
|
client.login(token); |