forked from Androz2091/AtlantaBot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathatlanta.js
More file actions
31 lines (25 loc) · 972 Bytes
/
atlanta.js
File metadata and controls
31 lines (25 loc) · 972 Bytes
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
require("./helpers/extenders");
const Sentry = require("@sentry/node"),
chalk = require("chalk");
const config = require("./config");
if(config.apiKeys.sentryDSN){
try {
Sentry.init({ dsn: config.apiKeys.sentryDSN });
} catch (e) {
console.log(e);
console.log(chalk.yellow("Looks like your Sentry DSN key is invalid. If you do not intend to use Sentry, please remove the key from the configuration file."));
}
}
// Load Atlanta class
const Atlanta = require("./base/Atlanta"),
client = new Atlanta();
client.init().catch(console.error);
// if there are errors, log them
client.on("disconnect", () => client.logger.log("Bot is disconnecting...", "warn"))
.on("reconnecting", () => client.logger.log("Bot reconnecting...", "log"))
.on("error", (e) => client.logger.log(e, "error"))
.on("warn", (info) => client.logger.log(info, "warn"));
// if there is an unhandledRejection, log them
process.on("unhandledRejection", (err) => {
console.error(err);
});