all repos — stealth-developers @ 01e69610c3bee859668126b571a524d38a75639b

feat(bot): allow ignoring interactions
vi did:web:vt3e.cat
Tue, 19 May 2026 21:04:56 +0100
commit

01e69610c3bee859668126b571a524d38a75639b

parent

cef0482d713ef8c29f2e070670c40b8efe9c44fc

1 files changed, 21 insertions(+), 3 deletions(-)

jump to
M pkgs/bot/src/discord.tspkgs/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); });