Skip to content
Components & Interactions addSectionButton

$addSectionButton[] — Button on the side of a section

$addSectionButton[] gives the section opened with $addSection[] a button as its accessory, shown on the side of its text displays. A section holds one accessory: a thumbnail ($addThumbnail[]) or a button.

Syntax

$addSectionButton[customId;label;(style);(disabled);(emoji);(sectionId)]

Parameters

Parameter Required Description
customId Yes Custom ID of the button (1 to 100 characters, unique in the message). A link button is not allowed here.
label Yes Text of the button, 80 characters at most. May be empty only when an emoji is given.
style No primary (default), secondary, success or danger.
disabled No yes/true to disable the button. Default no.
emoji No Emoji shown before the label.
sectionId No Name of a section defined earlier. Without it, the button goes to the section opened last.

Return value

Returns an empty string.

Behavior

  • Call it after $addSection[] and the $addTextDisplay[] of the section.
  • A section that already has an accessory keeps the first one.
  • The click is handled like any other button: a workflow on interactionCreate filtered on the custom ID.

Examples

$addContainer[;#5865F2]
$addSection[]
$addTextDisplay[**Daily reward**⏎-# Come back every day]
$addSectionButton[daily-claim;Claim;success]

Notes

See also $addSection[], $addThumbnail[], $endSection.

Try it

Paste an example into the playground to preview its message (functions that act on Discord are not run), or build the same thing with blocks.