Files
discord-rpg-concept/bot/events/interactionCreate.ts
2026-01-08 16:09:26 +01:00

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;