Skip to content

Buttons

Loading

Button File

A button file uses the button helper function and exports it. For example:

import { button } from 'jellycommands';
export default button({
id: 'hello',
run: async ({ interaction }) => {
await interaction.reply({
content: 'Hello there!',
});
},
});

Options

id

  • Type: string | RegExp | Awaitable<() => boolean>

The customId of the button, or a regex/function to match the id to.

run

The main handler for the button

defer

  • Type: boolean | InteractionDeferReplyOptions

Should the interaction be defered

disabled

  • Type: boolean

When true JellyCommands will ignore this button.