discord_gleam/types/component

Types

pub type ButtonStyle {
  ButtonPrimary
  ButtonSecondary
  ButtonSuccess
  ButtonDanger
  ButtonLink
  ButtonPremium
}

Constructors

  • ButtonPrimary
  • ButtonSecondary
  • ButtonSuccess
  • ButtonDanger
  • ButtonLink
  • ButtonPremium
pub type ChannelType {
  GuildText
  GuildVoice
  GuildCategory
  GuildAnnouncement
  AnnouncementThread
  PublicThread
  PrivateThread
  GuildStageVoice
  GuildDirectory
  GuildForum
  GuildMedia
}

Constructors

  • GuildText
  • GuildVoice
  • GuildCategory
  • GuildAnnouncement
  • AnnouncementThread
  • PublicThread
  • PrivateThread
  • GuildStageVoice
  • GuildDirectory
  • GuildForum
  • GuildMedia
pub type CheckBoxGroupOption {
  CheckBoxGroupOption(
    value: String,
    label: String,
    description: option.Option(String),
    default: option.Option(Bool),
  )
}

Constructors

pub type Component {
  ActionRow(id: option.Option(Int), components: List(Component))
  Button(
    id: option.Option(Int),
    style: ButtonStyle,
    label: option.Option(String),
    emoji: option.Option(PartialEmoji),
    custom_id: option.Option(String),
    sku_id: option.Option(snowflake.Snowflake(snowflake.Sku)),
    url: option.Option(String),
    disabled: option.Option(Bool),
  )
  StringSelect(
    id: option.Option(Int),
    custom_id: String,
    options: List(StringSelectOption),
    placeholder: option.Option(String),
    min_values: option.Option(Int),
    max_values: option.Option(Int),
    required: option.Option(Bool),
    disabled: option.Option(Bool),
  )
  TextInput(
    id: option.Option(Int),
    custom_id: String,
    style: TextInputStyle,
    min_length: option.Option(Int),
    max_length: option.Option(Int),
    required: option.Option(Bool),
    value: option.Option(String),
    placeholder: option.Option(String),
  )
  UserSelect(
    id: option.Option(Int),
    custom_id: String,
    placeholder: option.Option(String),
    default_values: option.Option(List(DefaultSelectValue)),
    min_values: option.Option(Int),
    max_values: option.Option(Int),
    required: option.Option(Bool),
    disabled: option.Option(Bool),
  )
  RoleSelect(
    id: option.Option(Int),
    custom_id: String,
    placeholder: option.Option(String),
    default_values: option.Option(List(DefaultSelectValue)),
    min_values: option.Option(Int),
    max_values: option.Option(Int),
    required: option.Option(Bool),
    disabled: option.Option(Bool),
  )
  MentionableSelect(
    id: option.Option(Int),
    custom_id: String,
    placeholder: option.Option(String),
    default_values: option.Option(List(DefaultSelectValue)),
    min_values: option.Option(Int),
    max_values: option.Option(Int),
    required: option.Option(Bool),
    disabled: option.Option(Bool),
  )
  ChannelSelect(
    id: option.Option(Int),
    custom_id: String,
    channel_types: option.Option(List(ChannelType)),
    placeholder: option.Option(String),
    default_values: option.Option(List(DefaultSelectValue)),
    min_values: option.Option(Int),
    max_values: option.Option(Int),
    required: option.Option(Bool),
    disabled: option.Option(Bool),
  )
  Section(
    id: option.Option(Int),
    components: List(Component),
    accessory: Component,
  )
  TextDisplay(id: option.Option(Int), content: String)
  Separator(
    id: option.Option(Int),
    divider: option.Option(Bool),
    spacing: option.Option(Int),
  )
  Container(
    id: option.Option(Int),
    components: List(Component),
    accent_color: option.Option(Int),
    spoiler: option.Option(Bool),
  )
  Label(
    id: option.Option(Int),
    label: String,
    description: option.Option(String),
    component: Component,
  )
  FileUpload(
    id: option.Option(Int),
    custom_id: String,
    min_values: option.Option(Int),
    max_values: option.Option(Int),
    required: option.Option(Bool),
  )
  RadioGroup(
    id: option.Option(Int),
    custom_id: String,
    options: List(RadioGroupOption),
    required: option.Option(Bool),
  )
  CheckboxGroup(
    id: option.Option(Int),
    custom_id: String,
    options: List(CheckBoxGroupOption),
    min_values: option.Option(Int),
    max_values: option.Option(Int),
    required: option.Option(Bool),
  )
  Checkbox(
    id: option.Option(Int),
    custom_id: String,
    default: option.Option(Bool),
  )
}

Constructors

pub type PartialEmoji {
  PartialEmoji(
    id: option.Option(snowflake.Snowflake(snowflake.Emoji)),
    name: option.Option(String),
    animated: option.Option(Bool),
  )
}

Constructors

pub type RadioGroupOption {
  RadioGroupOption(
    value: String,
    label: String,
    description: option.Option(String),
    default: option.Option(Bool),
  )
}

Constructors

pub type StringSelectOption {
  StringSelectOption(
    label: String,
    value: String,
    description: option.Option(String),
    emoji: option.Option(PartialEmoji),
    default: option.Option(Bool),
  )
}

Constructors

pub type TextInputStyle {
  ShortText
  ParagraphText
}

Constructors

  • ShortText
  • ParagraphText

Values

pub fn channel_type_to_int(type_: ChannelType) -> Int
pub fn component_type_to_int(component: Component) -> Int
pub fn default_select_value_to_json(
  value: DefaultSelectValue,
) -> json.Json
pub fn partial_emoji_to_json(emoji: PartialEmoji) -> json.Json
pub fn to_json(component: Component) -> json.Json
Search Document