card-drop/src/client/interactionCreate/Button.ts
Ethan Lane 58d1541e47 feature/5-drop-command ()


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>
2023-09-03 20:27:29 +01:00

17 lines
No EOL
513 B
TypeScript

import { ButtonInteraction, Interaction } from "discord.js";
import { CoreClient } from "../client";
export default class Button {
public static async onButtonClicked(interaction: ButtonInteraction) {
if (!interaction.isButton) return;
const item = CoreClient.buttonEvents.find(x => x.ButtonId == interaction.customId.split(' ')[0]);
if (!item) {
await interaction.reply('Event not found');
return;
}
item.Event.execute(interaction);
}
}