View Source Nostrum.Struct.Component.Button (Nostrum v0.6.1)

Helpers for dealing with Button Components

Link to this section Summary

Functions

Create a button.

Disables the button.

Enables the button.

Create an interaction button.

Create a link button.

Changes the style of the button.

Toggle the buttons disabled state.

Link to this section Types

Specs

interaction_button() :: %Nostrum.Struct.Component{
  components: term(),
  custom_id: Nostrum.Struct.Component.custom_id(),
  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()
}

Specs

Specs

opts() :: [opt()]

Specs

Link to this section 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.

Enables the button.

Link to this function

interaction_button(label, custom_id, opts \\ [])

View Source

Create an interaction button.

Read more about interaction buttons in the Nostrum.Struct.Component documentation.

Link to this function

put_style(button, style)

View Source

Changes the style of the button.

Toggle the buttons disabled state.