summaryrefslogtreecommitdiff
path: root/packages/gateway/src/commands/commandHandler.ts
blob: 5d8b77ac68df197e40ff0a3ed06b99d3a11c592c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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),
    ]);
  });
};