|
|
|
@ -19,25 +19,6 @@ initLocalCommands();
|
|
|
|
|
initCommands();
|
|
|
|
|
initAIs();
|
|
|
|
|
|
|
|
|
|
let hasSent = false
|
|
|
|
|
|
|
|
|
|
await BotEmitter.on("ready", (bot) => {
|
|
|
|
|
if (hasSent) return
|
|
|
|
|
Deno.addSignalListener("SIGINT", () => {
|
|
|
|
|
config.discord.channels.forEach(async channelId => {
|
|
|
|
|
await sendMessage(bot, channelId, {
|
|
|
|
|
content: "Apologies, bot going down for maintenance!"
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
config.discord.channels.forEach(async channelId => {
|
|
|
|
|
await sendMessage(bot, channelId, {
|
|
|
|
|
content: "The bot is back online!"
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
hasSent = true
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
await BotEmitter.emit("start", {
|
|
|
|
|
token: Deno.env.get("TOKEN") ?? config.discord.token ?? (() => {
|
|
|
|
|
throw new GoofyAhhException("No token?");
|
|
|
|
|