Button
Represents a UI button.Constructor
The style of the button.
The ID of the button that gets received during an interaction. Auto-generated if not provided.
The URL this button sends you to. Makes the button a link button.
Whether the button is disabled or not.
The label of the button. Maximum of 80 characters.
The emoji of the button, if available.
The ID of the SKU this button refers to (for premium buttons).
The relative row this button belongs to (0-4). Automatic ordering if not provided.
The button’s ID.
Attributes
The style of the button.
The ID of the button that gets received during an interaction.
None for link buttons.The URL this button sends you to.
Whether the button is disabled or not.
The label of the button, if available.
The emoji of the button, if available.
The ID of the SKU this button refers to.
The width of the button in the UI layout. Always 1.
The row position of this button (0-4), or
None if not explicitly set.Methods
callback
callback
The callback associated with this button. Override this in subclasses or use the decorator.Parameters:
interaction(Interaction): The interaction that triggered this button.
@button Decorator
A decorator that attaches a button to a component.Parameters
The label of the button.
The ID of the button. Not recommended to set manually.
The style of the button.
Whether the button is disabled or not.
The emoji of the button.
The relative row this button belongs to (0-4).
The button’s ID.
Premium and link buttons cannot be created with this decorator. Create a
Button object manually instead.Button Styles
Buttons can have different visual styles:ButtonStyle.primary- Blurple buttonButtonStyle.secondary- Grey buttonButtonStyle.success- Green buttonButtonStyle.danger- Red buttonButtonStyle.link- Link button (requiresurl)ButtonStyle.premium- Premium button (requiressku_id)
