View Source Nostrum.Struct.Component.Button (Nostrum v0.10.0)
Helpers for dealing with Button Components
Summary
Functions
Create a button.
Disables the button when disabled
is true. Enables it otherwise.
Create an interaction button.
Create a link button.
Changes the style of the button.
Toggle the buttons disabled state.
Types
@type interaction_button() :: %Nostrum.Struct.Component{ channel_types: term(), components: term(), custom_id: Nostrum.Struct.Component.custom_id(), default_values: term(), disabled: Nostrum.Struct.Component.disabled(), emoji: Nostrum.Struct.Component.emoji(), label: Nostrum.Struct.Component.label(), max_length: term(), max_values: term(), min_length: term(), min_values: term(), options: term(), placeholder: term(), required: term(), style: Nostrum.Struct.Component.style(), type: Nostrum.Struct.Component.type(), url: term(), value: term() }
@type link_button() :: %Nostrum.Struct.Component{ channel_types: term(), components: term(), custom_id: term(), default_values: term(), disabled: Nostrum.Struct.Component.disabled(), emoji: Nostrum.Struct.Component.emoji(), label: Nostrum.Struct.Component.label(), max_length: term(), max_values: term(), min_length: term(), min_values: term(), options: term(), placeholder: term(), required: term(), style: Nostrum.Struct.Component.style(), type: Nostrum.Struct.Component.type(), url: Nostrum.Struct.Component.url(), value: term() }
@type opt() :: {:style, Nostrum.Struct.Component.style()} | {:label, Nostrum.Struct.Component.label()} | {:emoji, Nostrum.Struct.Component.emoji()} | {:custom_id, Nostrum.Struct.Component.custom_id()} | {:disabled, Nostrum.Struct.Component.disabled()} | {:url, Nostrum.Struct.Component.url()}
@type opts() :: [opt()]
@type t() :: link_button() | interaction_button()
Functions
Create a button.
This function provides direct access to the new/1
callback.
Note: While using this function directly you are not guaranteed to return a valid button, providing a valid combination of options becomes the responsibility of the reader. It is instead recommended to use the helper functions provided below.
Disables the button when disabled
is true. Enables it otherwise.
Create an interaction button.
Read more about interaction buttons in the Nostrum.Struct.Component
documentation.
Create a link button.
Read more about link buttons in the Nostrum.Struct.Component
documentation.
Changes the style of the button.
Toggle the buttons disabled state.