test

Constatic

Discord Bot BaseResponders

Buttons

how to reply discord buttons

Reply to a button by setting the Responder type to button.

command.ts
const row = createRow(
    new ButtonBuilder({
        customId: "confirm/button", 
        label: "Confirm", 
        style: ButtonStyle.Success
    })
);
interaction.reply({ ephemeral, components: [row] });
responder.ts
new Responder({
    customId: "confirm/button",
    type: ResponderType.Button, cache: "cached",
    async run(interaction) {
        interaction.update({ 
            ephemeral, content: "Confirmed", 
            components: []
        });
    },
});

On this page

No Headings