#5 Reviewed-on: https://gitea.vylpes.xyz/External/card-drop/pulls/17 Co-authored-by: Ethan Lane <ethan@vylpes.com> Co-committed-by: Ethan Lane <ethan@vylpes.com>
22 lines
621 B
TypeScript
22 lines
621 B
TypeScript
import { Interaction } from "discord.js";
|
|
import ChatInputCommand from "./interactionCreate/ChatInputCommand";
|
|
import Button from "./interactionCreate/Button";
|
|
|
|
export class Events {
|
|
public async onInteractionCreate(interaction: Interaction) {
|
|
if (!interaction.guildId) return;
|
|
|
|
if (interaction.isChatInputCommand()) {
|
|
ChatInputCommand.onChatInput(interaction);
|
|
}
|
|
|
|
if (interaction.isButton()) {
|
|
Button.onButtonClicked(interaction);
|
|
}
|
|
}
|
|
|
|
// Emit when bot is logged in and ready to use
|
|
public onReady() {
|
|
console.log("Ready");
|
|
}
|
|
}
|