forked from SudhanPlayz/Discord-MusicBot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
27 lines (21 loc) · 763 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
//JotaroKujo0525 note, this is a deed that i should've done a long time ago
require('dotenv').config()
const DiscordMusicBot = require("./lib/DiscordMusicBot");
const { exec } = require("child_process");
if (process.env.REPL_ID) {
console.log("Replit system detected, initiating special `unhandledRejection` event listener.")
process.on('unhandledRejection', (reason, promise) => {
promise.catch((err) => {
if (err.status === 429) {
console.log("something went wrong whilst trying to connect to discord gateway, resetting...");
exec("kill 1");
}
});
});
}
const client = new DiscordMusicBot();
console.log("Make sure to fill in the config.js before starting the bot.");
const getClient = () => client;
module.exports = {
getClient,
};