band-aid fix for an issue
This commit is contained in:
parent
78f927a6fa
commit
581518714a
1 changed files with 17 additions and 12 deletions
29
shard.js
29
shard.js
|
@ -68,17 +68,6 @@ class Shard extends Base {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// dbl posting
|
|
||||||
if (process.env.NODE_ENV === "production" && process.env.DBL !== "") {
|
|
||||||
const dbl = poster(process.env.DBL, this.bot);
|
|
||||||
dbl.on("posted", () => {
|
|
||||||
logger.log("Posted stats to top.gg");
|
|
||||||
});
|
|
||||||
dbl.on("error", e => {
|
|
||||||
logger.error(e);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// handle process stop
|
// handle process stop
|
||||||
process.on("SIGINT", () => {
|
process.on("SIGINT", () => {
|
||||||
logger.log("warn", "SIGINT detected, shutting down...");
|
logger.log("warn", "SIGINT detected, shutting down...");
|
||||||
|
@ -92,6 +81,17 @@ class Shard extends Base {
|
||||||
require("./utils/database.js").stop();
|
require("./utils/database.js").stop();
|
||||||
process.exit(0);
|
process.exit(0);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// dbl posting
|
||||||
|
if (process.env.NODE_ENV === "production" && process.env.DBL !== "") {
|
||||||
|
const dbl = poster(process.env.DBL, this.bot);
|
||||||
|
dbl.on("posted", () => {
|
||||||
|
logger.log("Posted stats to top.gg");
|
||||||
|
});
|
||||||
|
dbl.on("error", e => {
|
||||||
|
logger.error(e);
|
||||||
|
});
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -107,7 +107,12 @@ class Shard extends Base {
|
||||||
}
|
}
|
||||||
|
|
||||||
async launch() {
|
async launch() {
|
||||||
await this.init();
|
try {
|
||||||
|
await this.init();
|
||||||
|
} catch {
|
||||||
|
logger.error("Might have failed to register some things");
|
||||||
|
}
|
||||||
|
|
||||||
// connect to lavalink
|
// connect to lavalink
|
||||||
if (!sound.status && !sound.connected) await sound.connect(this.bot);
|
if (!sound.status && !sound.connected) await sound.connect(this.bot);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue