diff --git a/src/bot.ts b/src/bot.ts index 58d1e86..61f09d8 100755 --- a/src/bot.ts +++ b/src/bot.ts @@ -30,6 +30,7 @@ const subjects = new Set([ ]); async function main() { + const is_debug = Deno.env.has("DEBUG"); const [token_file] = Deno.args; const token = (await Deno.readTextFile(token_file)).trim(); @@ -47,8 +48,13 @@ async function main() { log("Logged in as", bot.user?.username); const commands = build_api_commands(subjects); - await bot.application?.commands.set([]); - await bot.application?.commands.set(commands, "871777993922588712"); + if (is_debug) { + await bot.application?.commands.set([]); + await bot.application?.commands.set(commands, "871777993922588712"); + } else { + await bot.application?.commands.set(commands); + await bot.application?.commands.set([], "871777993922588712"); + } log("Registered", commands.length, "commands."); update_loop(bot, storage, update_display);