Skip to content

zaun_bot::Button · Struct

pub struct Button(…)

Builds a types::Button.

pub fn primary<impl Into<String>, impl Into<String>>(custom_id: impl Into<String>, label: impl Into<String>) -> Self

A primary (blurple) button.

pub fn secondary<impl Into<String>, impl Into<String>>(custom_id: impl Into<String>, label: impl Into<String>) -> Self

A secondary (grey) button.

pub fn success<impl Into<String>, impl Into<String>>(custom_id: impl Into<String>, label: impl Into<String>) -> Self

A success (green) button.

pub fn danger<impl Into<String>, impl Into<String>>(custom_id: impl Into<String>, label: impl Into<String>) -> Self

A danger (red) button.

pub fn link<impl Into<String>, impl Into<String>>(url: impl Into<String>, label: impl Into<String>) -> Self

A link button: https:// only; clients ask before opening it. Sends no interaction.

pub fn emoji<impl Into<String>>(self, emoji: impl Into<String>) -> Self

Adds a Unicode emoji.

pub fn disabled(self, disabled: bool) -> Self

Greys it out.

pub fn build(self) -> Button

The finished button.

Clone, Debug

Full rustdoc page