Files
BotsCord/bot/index.js
T

23 lines
641 B
JavaScript
Raw Normal View History

2022-07-30 16:09:49 +02:00
// Create discord.js client
const { Client, GatewayIntentBits } = require('discord.js');
const client = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.GuildMessageReactions,
GatewayIntentBits.GuildMessageTyping,
GatewayIntentBits.DirectMessages,
2022-07-30 16:19:58 +02:00
2022-07-30 16:09:49 +02:00
]
});
2022-08-05 14:59:15 +02:00
client.config = require('./config');
2022-07-30 16:09:49 +02:00
// Set intents
client.on('ready', () => {
console.log('Bot is ready!');
2022-08-05 14:59:15 +02:00
// Log server count
setTimeout(() => {
console.log(`${client.guilds.cache.size} servers`);
}, 1000);
2022-07-30 16:09:49 +02:00
});
// Login
2022-07-30 16:19:58 +02:00
client.login(client.config.bot.token);