-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
52 lines (45 loc) · 1.51 KB
/
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
const { Client, GatewayIntentBits, Partials, Collection } = require(`discord.js`);
const fs = require('fs');
const config = require('./config/config.json');
const client = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.MessageContent,
GatewayIntentBits.GuildMembers,
GatewayIntentBits.GuildModeration,
GatewayIntentBits.GuildEmojisAndStickers,
GatewayIntentBits.GuildIntegrations,
GatewayIntentBits.GuildWebhooks,
GatewayIntentBits.GuildInvites,
GatewayIntentBits.GuildVoiceStates,
GatewayIntentBits.GuildPresences,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.GuildMessageReactions,
GatewayIntentBits.GuildMessageTyping,
GatewayIntentBits.DirectMessages,
GatewayIntentBits.DirectMessageReactions,
GatewayIntentBits.DirectMessageTyping,
GatewayIntentBits.MessageContent
],
partials: [
Partials.Channel,
Partials.Message,
Partials.User,
Partials.GuildMember,
Partials.Reaction
],
});
client.commands = new Collection();
client.cooldowns = new Collection();
const functions = fs.readdirSync("./functions").filter(file => file.endsWith(".js"));
const eventFolders = fs.readdirSync("./events")
const commandFolders = fs.readdirSync("./commands");
(async () => {
for (file of functions) {
require(`./functions/${file}`)(client);
}
client.handlerError()
client.handleEvents(eventFolders, "./events");
client.handleCommands(commandFolders, "./commands");
client.login(config.Bot_Token)
})();