summaryrefslogtreecommitdiff
path: root/packages/gateway/src/commands/commandHandler.ts
blob: e985e119a9a5f00d7f8266a2c2e4b2646eb7d835 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import { Client, Events, Message } from "discord.js";
import { handleSayCommand } from "./say";
import { handleStartCommand } from "./start";
import { handleCrpCommand } from "./crp";
import { handleReactCommand } from "./react";
import { handleDeleteCommand } from "./delete";

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),
      handleDeleteCommand(message),
    ]);
  });
};