kitazith/component/container

Types

pub type Container {
  Container(
    id: option.Option(Int),
    components: List(ContainerChild),
    accent_color: option.Option(Int),
    spoiler: option.Option(Bool),
  )
}

Constructors

Components allowed inside a container for non-interactive webhook payloads.

pub type ContainerChild {
  ContainerTextDisplay(text_display.TextDisplay)
  ContainerSection(section.Section)
  ContainerMediaGallery(media_gallery.MediaGallery)
  ContainerFile(file.File)
  ContainerSeparator(separator.Separator)
}

Constructors

Values

pub fn file(file: file.File) -> ContainerChild
pub fn media_gallery(
  media_gallery: media_gallery.MediaGallery,
) -> ContainerChild
pub fn new(components: List(ContainerChild)) -> Container
pub fn section(section: section.Section) -> ContainerChild
pub fn separator(
  separator: separator.Separator,
) -> ContainerChild
pub fn text_display(
  text_display: text_display.TextDisplay,
) -> ContainerChild
pub fn to_json(container: Container) -> json.Json
pub fn with_accent_color(
  container: Container,
  accent_color: Int,
) -> Container

Use kitazith/color.from_rgb to build the packed integer from RGB components.

pub fn with_id(container: Container, id: Int) -> Container
pub fn with_spoiler(
  container: Container,
  spoiler: Bool,
) -> Container
Search Document