kitazith/component/container
Types
Learn more: Components > Container
pub type Container {
Container(
id: option.Option(Int),
components: List(ContainerChild),
accent_color: option.Option(Int),
spoiler: option.Option(Bool),
)
}
Constructors
-
Container( id: option.Option(Int), components: List(ContainerChild), accent_color: option.Option(Int), spoiler: option.Option(Bool), )Arguments
- accent_color
-
RGB value from
0x000000to0xFFFFFF.
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
-
ContainerTextDisplay(text_display.TextDisplay) -
ContainerSection(section.Section) -
ContainerMediaGallery(media_gallery.MediaGallery) -
ContainerFile(file.File) -
ContainerSeparator(separator.Separator)
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 with_accent_color(
container: Container,
accent_color: Int,
) -> Container
Use kitazith/color.from_rgb to build the packed integer from RGB components.