Button

BlockAdvanced Messages

Create a button for users to click on. Triggers with a new flow and Custom ID.

Inputs

Custom IDRequired

Custom ID of the button. Use this to identify the button in the flow where you respond to the button click.

Example: ban_user_123456789012345678

LabelRequired

Label of the button.

Example: Click me

StyleRequired

Style of the button. Link buttons must have a URL provided and Custom ID must be blank.

Optionsprimarysecondarysuccessdangerlinkpremium
URL

URL of the button. You can only provide this if you set style to link.

Example: https://example.com

Emoji

Emoji of the button. Accepts a standard Unicode emoji or Discord custom emoji.

Disabled

Whether the button is disabled.

Optionstruefalse
SKU ID

Identifier for a purchasable SKU. You can only provide this if you set style to premium.

Example: 123456789012345678

Where it goes

This block can only be placed inside Embed Reply to Interaction, Send or Edit Embed Message, Section or Action Row.

Build a bot using blocks like Button

Use this block in our visual flow editor. Bots are hosted 24/7 for free on inventor.bot.

Advanced Documentation

This documentation can be useful when using code mode. View as Markdown

ID: advmsgcmp_interaction_button
  • Can only be placed inside respond_interaction_embed_message (buttons), send_embed_message (buttons), advmsgcmp_layout_section (accessory), advmsgcmp_layout_actionrow (children).

Inputs

FieldInventScript nameValue
Custom IDcustom_ide.g. "ban_user_123456789012345678"
Labellabele.g. "Click me"
Stylestyle"primary", "secondary", "success", "danger", "link", "premium"
URLurle.g. "https://example.com"
Emojiemoji
Disableddisabled"true", "false"
SKU IDsku_ide.g. "123456789012345678"

Example InventScript

respond_interaction_embed_message(Args{
	color: "#0099ff",
	buttons: func() {
		advmsgcmp_interaction_button(Args{
			custom_id: "ban_user_123456789012345678",
			label:     "Click me",
			style:     "primary",
		})
	},
})

More advanced messages blocks