feat(bot): allow ignoring interactions
vi did:web:vt3e.cat
Tue, 19 May 2026 21:04:56 +0100
1 files changed,
21 insertions(+),
3 deletions(-)
jump to
M
pkgs/bot/src/discord.ts
→
pkgs/bot/src/discord.ts
@@ -1,4 +1,5 @@
import { Client, Events, GatewayIntentBits } from "discord.js"; +import { parseArgs } from "util"; import rest from "./rest"; export { rest };@@ -17,11 +18,28 @@ ],
}); client.on(Events.ClientReady, async (client) => { + const { values } = parseArgs({ + args: Bun.argv, + options: { + ignoreCommands: { + type: "boolean", + default: false, + short: "i", + }, + }, + strict: true, + allowPositionals: true, + }); + logger.info(`logged in as ${client.user?.tag}!`); - await Promise.all([registerEvents(client), registerInteractions(client)]); - logger.info("events and interactions registered!"); - console.log(); + if (!values.ignoreCommands) { + await Promise.all([registerEvents(client), registerInteractions(client)]); + logger.info("events and interactions registered!"); + console.log(); + } else { + logger.warn("ignoring commands"); + } startTicketWatcher(client); });