summaryrefslogtreecommitdiff
path: root/packages/gateway/src/commands/commandHandler.ts
diff options
context:
space:
mode:
authorFuwn <[email protected]>2025-09-28 00:03:12 -0700
committerFuwn <[email protected]>2025-09-28 00:03:12 -0700
commit999ba817c68e3dd2b578b27f5f0f527d04be87c7 (patch)
treed84ebf1830fb7b35c04129995512ebda4aed4e74 /packages/gateway/src/commands/commandHandler.ts
parentfeat(listeners:roleMentionCooldown): Remove expected behaviour logs (diff)
downloadumabotdiscord-999ba817c68e3dd2b578b27f5f0f527d04be87c7.tar.xz
umabotdiscord-999ba817c68e3dd2b578b27f5f0f527d04be87c7.zip
refactor(gateway): Consolidate event handlers
Diffstat (limited to 'packages/gateway/src/commands/commandHandler.ts')
-rw-r--r--packages/gateway/src/commands/commandHandler.ts18
1 files changed, 18 insertions, 0 deletions
diff --git a/packages/gateway/src/commands/commandHandler.ts b/packages/gateway/src/commands/commandHandler.ts
new file mode 100644
index 0000000..5d8b77a
--- /dev/null
+++ b/packages/gateway/src/commands/commandHandler.ts
@@ -0,0 +1,18 @@
+import { Client, Events, Message } from "discord.js";
+import { handleSayCommand } from "./say";
+import { handleStartCommand } from "./start";
+import { handleCrpCommand } from "./crp";
+import { handleReactCommand } from "./react";
+
+export const handleCommandHandler = (client: Client) => {
+ client.on(Events.MessageCreate, async (message: Message) => {
+ if (message.author.bot) return;
+
+ await Promise.allSettled([
+ handleSayCommand(message),
+ handleStartCommand(message),
+ handleCrpCommand(message),
+ handleReactCommand(message),
+ ]);
+ });
+};