βCallback System
import { ApplicationCommandType } from "discord.js";
import { CreateRow, CreateButton, InteractionHandler} from "ease-discord-js";
export default {
name: "test",
description: "command to test the library",
type: ApplicationCommandType.ChatInput,
run: async(client, interaction) => {
return interaction.reply({content: "Hello World!", components: [
new CreateRow([
new CreateButton({label: "Primary", style: "Primary", onClick: (client, interaction) => clickHandler(client, interaction)}),
])
]});
}
}
const clickHandler = (client, interaction) => {
interaction.reply({content: "Button Clicked! ( using callback ) ", ephemeral: true});
}
Last updated