forked from kabirjaipal/JUGNU-MUSIC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathready.js
executable file
·33 lines (27 loc) · 934 Bytes
/
ready.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
const { ActivityType } = require("discord.js");
const client = require("../index");
const { registerSlashCommands } = require("../handlers/functions");
const server = require("../server.js");
const Database = require("../handlers/Database");
client.once("ready", async () => {
try {
console.log(`${client.user.username} is Online`);
// Set bot activity
client.user.setActivity({
name: `By @kabirjaipal`,
type: ActivityType.Watching,
});
// Load database
await Database(client);
// Reset music embeds for all guilds one by one
for (const guild of client.guilds.cache.values()) {
await client.updateembed(client, guild);
}
// Register slash commands
await registerSlashCommands(client);
// Load dashboard
await server(client);
} catch (error) {
console.error("An error occurred during initialization:", error);
}
});