Skip to content

Trait bindings::Guest

zaun_bot::bindings::Guest · Trait

pub trait Guest { … }
fn init(config: Vec<(String, String)>) -> Registration;

Called once per instance start with the bot’s configuration: the keys its manifest declares in [config], each with the owner’s value or else the declared default (keys with neither are left out). Secret values are passed like any other.

fn on_config_change(config: Vec<(String, String)>);

The owner changed the configuration while the bot runs: every value again, as for init. The instance is not restarted and its commands stay registered.

fn on_event(event: Event);

A subscribed event.

fn on_interaction(interaction: Interaction);

An application command, component click or modal submit.

fn on_autocomplete(interaction: Interaction) -> Vec<Choice>;

Autocomplete: return up to 25 choices for the focused option.

fn on_timer(id: u64, tag: String);

A timer fired.

fn on_voice_event(event: VoiceEvent);

Something happened in the bot’s voice stay or player.

Full rustdoc page