forked from syntaxbullet/AuroraBot-discord
refactor: initial moves
This commit is contained in:
22
bot/events/interactionCreate.ts
Normal file
22
bot/events/interactionCreate.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
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;
|
||||
Reference in New Issue
Block a user