-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
58 lines (48 loc) · 1.49 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
50
51
52
53
54
55
56
57
58
const { Client, Collection, GatewayIntentBits, Partials } = require("discord.js");
const { Player } = require("discord-player");
const fs = require("fs");
require("dotenv").config({ path: "./config/.env" });
const client = new Client(clientSettings());
client.config = require("./config/config.json");
// Properties of data
client.commands = new Collection();
client.buttons = new Collection();
client.selectMenus = new Collection();
client.commandsData = [];
client.player = new Player(client);
if (client.config.debug) {
console.log(`BOT :: Debug level = ${["player", "client", "all"].includes(client.config.debug) ? client.config.debug : "N/A"}`);
}
// File Listeners
const funcFold = fs.readdirSync('./src/func');
for (const folders of funcFold) {
const funcFiles = fs.readdirSync(`./src/func/${folders}`)
.filter((file) => file.endsWith('.js'));
for (const files of funcFiles) {
require(`./src/func/${folders}/${files}`)(client);
}
}
client.login(process.env.TOKEN);
function clientSettings() {
return {
shards: "auto",
failIfNotExists: false,
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMembers,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.GuildPresences,
GatewayIntentBits.GuildVoiceStates,
GatewayIntentBits.MessageContent,
],
partials: [
Partials.Message,
Partials.Reaction,
Partials.User
],
allowedMentions: {
parse: [ "roles", "users" ],
repliedUser: false
}
}
}