-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathapp.js
54 lines (43 loc) · 1.43 KB
/
app.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
if(process.env.ENV !== "production") require("dotenv").config();
const Client = require("./src/client.js");
const config = require("./config.json");
const { Player } = require("discord-player");
const botlist = config.botlist;
const discordModals = require("discord-modals");
global.__basedir = __dirname;
const client = new Client(config, {
partials: ["CHANNEL"],
intents: 130815,
allowedMentions: { parse: ["users", "roles"], repliedUser: true },
});
discordModals(client);
client.player = new Player(client);
const player = client.player;
// Initialize client
function init() {
client.loadCommands("./src/commands");
client.loadSlashCommands("./src/slash");
client.loadButtons("./src/buttons");
client.loadSelectMenus("./src/selectmenus");
client.loadContextMenus("./src/contextmenus");
client.loadModals("./src/modals");
client.loadEvents("./src/events", client, player);
client.loadMusicEvents("./src/music", player);
client.loadTopics("./data/trivia");
client.login(client.token);
}
init();
if (botlist) {
let { botlist } = require("./src/utils/botlist.js");
botlist(client).then(() => {
client.logger.info("Botlist updated!");
});
}
if (!client.shard) {
const { index } = require("./src/utils/dashboard.js");
index(client).then(() => {
client.logger.info("Dashboard initialized!");
});
}
global.__Client = client;
process.on("unhandledRejection", (err) => client.logger.error(err));