Files
discordeno/examples/beginner/src/events/interactionCreate.ts
Jonathan Ho d04a040f28 Setup turborepo (#2610)
* chore: BREAKING move to monorepo structure

* chore: setup turborepo
2022-12-01 01:59:02 +08:00

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;
}
};