#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>
17 lines
No EOL
513 B
TypeScript
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);
|
|
}
|
|
} |