logo

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({ flags: ["Ephemeral"], components: [row] });
responder.ts
createResponder({
    customId: "confirm/button",

    types: [ResponderType.Button], cache: "cached",
    async run(interaction) {
        interaction.update({ 
            flags: ["Ephemeral"], content: "Confirmed", 
            components: []
        });
    },
});

On this page

No Headings