Skip to content

$addButtonTo

$addButtonTo will add a button to a specific message.

Usage

$addButtonTo[channelId;messageId;index;label;style;customID;disabled?;emoji?]

Parameters

FieldTypeDescriptionRequired
channelIdnumberThe channel id.true
messageIdnumberThe message id.true
indexnumberIn which (action)row the button appears.true
labelstringThe text that will be displayed on the button as label.true
stylestringThe button style.true
customIDstringThe component custom ID used to identify the button.true
disabled?booleanMake the button unusable/disabled?
1. true
2. false (default)
false
emoji?stringThe emoji displayed in the button.false

Button Types

Name Value Color
Primary 1 blurple $addButtonTo[1;Example Button!;primary;customID;false]
Secondary 2 grey $addButtonTo[1;Example Button!;secondary;customID;false]
Success 3 green $addButtonTo[1;Example Button!;success;customID;false]
Danger 4 red $addButtonTo[1;Example Button!;danger;customID;false]
Link 5 grey, navigates to a URL $addButtonTo[1;Example Button!;link;https://discord.gg;false]
Custom Emoji any any $addButtonTo[1;Example Button!;link;customID;false;emojiName/emojiId/emojiString]
Unicode Emoji any any $addButtonTo[1;Example Button!;link;customID;false;😀]

Example(s)

This adds a primary and link button to the bot’s message:

1
client.command({
2
name: "addButtonTo",
3
code: `
4
Hello!
5
$addButtonTo[$channelId;$messageId;1;Example Button!;primary;exampleButton;false;💔]
6
$addButtonTo[$channelId;$messageId;1;Example Button!;link;https://discord.gg;false]
7
`
8
});
1
client.interactionCommand({
2
name: "exampleButton",
3
prototype: "button",
4
code: `
5
$interactionReply[Awesome Button Interaction!]
6
`
7
});