mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-03 01:10:07 +00:00
17 lines
484 B
TypeScript
17 lines
484 B
TypeScript
import { Bot } from "../../bot.ts";
|
|
import { InteractionTypes } from "../../deps.ts";
|
|
import log from "../utils/logger.ts";
|
|
|
|
Bot.events.interactionCreate = (_, interaction) => {
|
|
if (!interaction.data) return;
|
|
|
|
switch (interaction.type) {
|
|
case InteractionTypes.ApplicationCommand:
|
|
log.info(
|
|
`[Application Command] ${interaction.data.name} command executed.`,
|
|
);
|
|
Bot.commands.get(interaction.data.name!)?.execute(Bot, interaction);
|
|
break;
|
|
}
|
|
};
|