-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
35 lines (31 loc) · 990 Bytes
/
index.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
const Discord = require("discord.js")
const {Client, GatewayIntentBits, Collection} = require("discord.js")
require('dotenv').config();
const client = new Client({
restTimeOffset: 0,
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMembers,
GatewayIntentBits.MessageContent,
GatewayIntentBits.GuildVoiceStates,
GatewayIntentBits.GuildPresences,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.GuildMessageTyping
]
})
client.commands = new Collection()
client.aliases = new Collection()
client.events = new Collection()
client.config = require("./config.json")
function handler(){
["commandHandler", "eventHandler", "distube"].filter(Boolean).forEach(handler => {
try{
require(`./handlers/${handler}`)(client,Discord);
} catch(e){
console.log(e);
}
});
}
handler();
require('./handlers/distube.js')(client)
client.login(process.env.TOKEN)