pub trait Guest {
// Required methods
fn init(config: Vec<(String, String)>) -> Registration;
fn on_config_change(config: Vec<(String, String)>);
fn on_event(event: Event);
fn on_interaction(interaction: Interaction);
fn on_autocomplete(interaction: Interaction) -> Vec<Choice> ⓘ;
fn on_timer(id: u64, tag: String);
fn on_voice_event(event: VoiceEvent);
}Required Methods§
Sourcefn init(config: Vec<(String, String)>) -> Registration
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.
Sourcefn on_config_change(config: Vec<(String, String)>)
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.
Sourcefn on_interaction(interaction: Interaction)
fn on_interaction(interaction: Interaction)
An application command, component click or modal submit.
Sourcefn on_autocomplete(interaction: Interaction) -> Vec<Choice> ⓘ
fn on_autocomplete(interaction: Interaction) -> Vec<Choice> ⓘ
Autocomplete: return up to 25 choices for the focused option.
Sourcefn on_voice_event(event: VoiceEvent)
fn on_voice_event(event: VoiceEvent)
Something happened in the bot’s voice stay or player.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".