-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbot.ts
More file actions
50 lines (44 loc) · 1.18 KB
/
bot.ts
File metadata and controls
50 lines (44 loc) · 1.18 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import {
Client,
Collection,
Events,
GatewayIntentBits,
Partials,
} from 'discord.js';
import setCommandList from './discord/handlers/commands';
import setEvents from './discord/handlers/events';
import './utils/logger';
import { DISCORD_BOT_TOKEN } from './config/environment';
declare module 'discord.js' {
interface Client {
commands: Collection<string, any>;
cooldown: Collection<string, any>;
}
}
logger.warn('Bot is starting...');
export const botClient = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.GuildMessageReactions,
GatewayIntentBits.MessageContent,
GatewayIntentBits.GuildMembers,
GatewayIntentBits.GuildIntegrations,
GatewayIntentBits.DirectMessages,
GatewayIntentBits.GuildVoiceStates,
GatewayIntentBits.GuildPresences,
GatewayIntentBits.GuildWebhooks,
GatewayIntentBits.GuildScheduledEvents,
],
partials: [
Partials.Channel,
Partials.Message,
Partials.Channel,
Partials.GuildMember,
],
});
botClient.commands = new Collection<string, any>();
setCommandList(botClient);
setEvents(botClient);
// start the bot
botClient.login(DISCORD_BOT_TOKEN)