forked from syntaxbullet/AuroraBot-discord
23 lines
753 B
TypeScript
23 lines
753 B
TypeScript
import { Events } from "discord.js";
|
|
import { ComponentInteractionHandler, AutocompleteHandler, CommandHandler } from "@/lib/handlers";
|
|
import type { Event } from "@shared/lib/types";
|
|
|
|
const event: Event<Events.InteractionCreate> = {
|
|
name: Events.InteractionCreate,
|
|
execute: async (interaction) => {
|
|
if (interaction.isButton() || interaction.isStringSelectMenu() || interaction.isModalSubmit()) {
|
|
return ComponentInteractionHandler.handle(interaction);
|
|
}
|
|
|
|
if (interaction.isAutocomplete()) {
|
|
return AutocompleteHandler.handle(interaction);
|
|
}
|
|
|
|
if (interaction.isChatInputCommand()) {
|
|
return CommandHandler.handle(interaction);
|
|
}
|
|
},
|
|
};
|
|
|
|
export default event;
|