-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
31 lines (26 loc) · 962 Bytes
/
Copy pathindex.js
File metadata and controls
31 lines (26 loc) · 962 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
require('dotenv').config();
const { Client, GatewayIntentBits, Partials } = require('discord.js');
const config = require('./src/config');
const handleMessageCreate = require('./src/handlers/messageCreate');
const client = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.MessageContent,
GatewayIntentBits.GuildMembers,
],
partials: [
Partials.Channel,
Partials.Message,
],
});
client.once('clientReady', () => {
console.log(`[ready] Logged in as ${client.user.tag}`);
console.log(`[ready] Monitoring ${config.forumChannelIds.length} forum channel(s)`);
console.log(`[ready] Monitoring ${config.honeypotChannelIds.length} honeypot channel(s)`);
});
client.on('messageCreate', message => handleMessageCreate(message, client, config));
client.login(process.env.BOT_TOKEN).catch(err => {
console.error('[login] Failed to log in:', err.message);
process.exit(1);
});