-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbot.js
35 lines (30 loc) · 1.1 KB
/
bot.js
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
import { Client, GatewayIntentBits, Partials } from 'discord.js'
import { dirname } from 'path'
import { fileURLToPath } from 'url'
import { CommandManager } from './src/structures/Commands.js'
import { EventManager } from './src/structures/Events.js'
import { token } from './config.js'
const __dirname = dirname(fileURLToPath(import.meta.url));
export const rootPath = __dirname;
const intents = GatewayIntentBits.Guilds |
GatewayIntentBits.GuildMessages |
GatewayIntentBits.GuildPresences |
GatewayIntentBits.DirectMessages |
GatewayIntentBits.MessageContent |
GatewayIntentBits.DirectMessageReactions |
GatewayIntentBits.GuildMembers |
GatewayIntentBits.GuildMessageReactions |
GatewayIntentBits.GuildWebhooks |
GatewayIntentBits.GuildVoiceStates |
GatewayIntentBits.GuildInvites;
const client = new Client({
intents: intents,
partials: [Partials.Channel]
})
client.events = new Map()
client.slashCommands = new Map()
await Promise.all([
EventManager(client, rootPath),
CommandManager(client, rootPath),
client.login(token)
]);