# zaun-bot 0.2.0

> API reference of the zaun_bot crate, generated from rustdoc.

Generated from rustdoc for `zaun_bot` 0.2.0. [Browse the full rustdoc HTML](/docs/api/rust/zaun-bot/zaun_bot/index.html).

# zaun-bot

The Rust SDK for **Zaun bots**: WebAssembly components that run *inside* a community's own
`zaun-host`, in a sandbox, with only the permissions and capabilities the owner granted.

```rust
use zaun_bot::prelude::*;

#[derive(Default)]
struct Ping;

impl Bot for Ping {
    fn commands(&mut self, _: &Config) -> Vec<ApplicationCommand> {
        vec![SlashCommand::new("ping", "Check that the bot is alive").build()]
    }
    fn on_command(&mut self, ctx: Context, cmd: CommandData) {
        if cmd.name == "ping" {
            let _ = ctx.reply("pong");
        }
    }
}

export_bot!(Ping);
```

The data shapes follow the Zaun the protocol–the protocol, which follow Discord's
interaction model. The WIT world in `wit/` is the source of truth.

## Constants

| Item | Summary |
|---|---|
| [`mention::EVERYONE`](/docs/reference/rust/zaun-bot/constant-mention-everyone/) | The text that shows `@everyone`. |
| [`mention::MAX_MEMBERS`](/docs/reference/rust/zaun-bot/constant-mention-max_members/) | Most members one message may mention (spec the protocol). |
| [`mention::MAX_ROLES`](/docs/reference/rust/zaun-bot/constant-mention-max_roles/) | Most roles one message may mention (spec the protocol). |

## Enums

| Item | Summary |
|---|---|
| [`presence::ActivityType`](/docs/reference/rust/zaun-bot/enum-presence-activitytype/) | "Playing {name}", "Streaming {name}", "Listening to {name}", "Watching {name}", "Competing in {name}", or free text (`custom`). |
| [`audio::AudioFormat`](/docs/reference/rust/zaun-bot/enum-audio-audioformat/) | How the bot's audio is encoded. |
| [`bindings::zaun::bot::types::ButtonStyle`](/docs/reference/rust/zaun-bot/enum-bindings-zaun-bot-types-buttonstyle/) | components Button styles 1-5; premium (6) is not supported. |
| [`prelude::ChoiceValue`](/docs/reference/rust/zaun-bot/enum-prelude-choicevalue/) |  |
| [`bindings::zaun::bot::types::CommandEntry`](/docs/reference/rust/zaun-bot/enum-bindings-zaun-bot-types-commandentry/) |  |
| [`bindings::zaun::bot::types::CommandKind`](/docs/reference/rust/zaun-bot/enum-bindings-zaun-bot-types-commandkind/) | application commands Type 1, 2, 3. |
| [`bindings::zaun::bot::types::Component`](/docs/reference/rust/zaun-bot/enum-bindings-zaun-bot-types-component/) | A top-level message component. Without `components-v2` only `action-row` is allowed. |
| [`bindings::zaun::bot::types::ContainerChild`](/docs/reference/rust/zaun-bot/enum-bindings-zaun-bot-types-containerchild/) |  |
| [`bindings::zaun::bot::types::DefaultValueKind`](/docs/reference/rust/zaun-bot/enum-bindings-zaun-bot-types-defaultvaluekind/) |  |
| [`bindings::zaun::bot::types::EntityKind`](/docs/reference/rust/zaun-bot/enum-bindings-zaun-bot-types-entitykind/) | Types 5 (user), 6 (role), 7 (mentionable), 8 (channel). |
| [`prelude::Event`](/docs/reference/rust/zaun-bot/enum-prelude-event/) | The events a bot asked for in its manifest (`events`: wire types, groups such as `messages`, `members`, `dms`, or `*`). Anything without a typed case arrives as `other` with the ev |
| [`bindings::zaun::bot::http::HttpError`](/docs/reference/rust/zaun-bot/enum-bindings-zaun-bot-http-httperror/) |  |
| [`bindings::zaun::bot::types::InteractionData`](/docs/reference/rust/zaun-bot/enum-bindings-zaun-bot-types-interactiondata/) |  |
| [`bindings::zaun::bot::types::LabelChild`](/docs/reference/rust/zaun-bot/enum-bindings-zaun-bot-types-labelchild/) |  |
| [`bindings::zaun::bot::log::Level`](/docs/reference/rust/zaun-bot/enum-bindings-zaun-bot-log-level/) |  |
| [`voice::LoopMode`](/docs/reference/rust/zaun-bot/enum-voice-loopmode/) | What happens when a track ends: go on (`off`), play it again (`track`), or put it at the end of the queue (`queue`). |
| [`bindings::zaun::bot::types::ModalItem`](/docs/reference/rust/zaun-bot/enum-bindings-zaun-bot-types-modalitem/) |  |
| [`bindings::zaun::bot::types::OptionKind`](/docs/reference/rust/zaun-bot/enum-bindings-zaun-bot-types-optionkind/) | Option types 3-11 (1 and 2 are sub-commands and groups). |
| [`bindings::zaun::bot::types::OptionValue`](/docs/reference/rust/zaun-bot/enum-bindings-zaun-bot-types-optionvalue/) | interactions |
| [`voice::PlayerStatus`](/docs/reference/rust/zaun-bot/enum-voice-playerstatus/) |  |
| [`bindings::zaun::bot::types::Response`](/docs/reference/rust/zaun-bot/enum-bindings-zaun-bot-types-response/) | Callback types 4-9 (8, the autocomplete result, is the return value of `on-autocomplete`). |
| [`bindings::zaun::bot::types::RowItem`](/docs/reference/rust/zaun-bot/enum-bindings-zaun-bot-types-rowitem/) |  |
| [`bindings::zaun::bot::types::SectionAccessory`](/docs/reference/rust/zaun-bot/enum-bindings-zaun-bot-types-sectionaccessory/) |  |
| [`Select`](/docs/reference/rust/zaun-bot/enum-select/) | Builds a select menu: string options or members, roles, mentionables or channels. |
| [`bindings::zaun::bot::types::SeparatorSpacing`](/docs/reference/rust/zaun-bot/enum-bindings-zaun-bot-types-separatorspacing/) |  |
| [`bindings::zaun::bot::voice::Source`](/docs/reference/rust/zaun-bot/enum-bindings-zaun-bot-voice-source/) | Where a track's audio comes from. |
| [`presence::Status`](/docs/reference/rust/zaun-bot/enum-presence-status/) | `invisible` looks offline to everyone. |
| [`bindings::zaun::bot::types::TextInputStyle`](/docs/reference/rust/zaun-bot/enum-bindings-zaun-bot-types-textinputstyle/) | modals |
| [`voice::VoiceEvent`](/docs/reference/rust/zaun-bot/enum-voice-voiceevent/) | What happened, for `on-voice-event`. |

## Functions

| Item | Summary |
|---|---|
| [`bindings::zaun::bot::community::add_role`](/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-community-add_role/) | `member.roles.update`. |
| [`bindings::zaun::bot::timers::after`](/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-timers-after/) | Fires once after `ms`. |
| [`bindings::zaun::bot::audio::buffered_ms`](/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-audio-buffered_ms/) | The audio written and not yet played, in ms (0 without a stream). |
| [`bindings::zaun::bot::timers::cancel`](/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-timers-cancel/) |  |
| [`bindings::zaun::bot::audio::clear`](/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-audio-clear/) | Drops everything buffered at once, keeping the stream open (to interrupt speech). |
| [`bindings::zaun::bot::voice::clear_queue`](/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-voice-clear_queue/) | Empties the queue; the current track keeps playing. |
| [`presence::clear_status`](/docs/reference/rust/zaun-bot/function-presence-clear_status/) | Clears the custom status. |
| [`bindings::zaun::bot::dms::close`](/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-dms-close/) | `dm.close`: hides it from the bot's list. |
| [`bindings::zaun::bot::audio::close`](/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-audio-close/) | Closes the stream: once the buffer has played (`drain`), or at once. The player resumes. Nothing happens without a stream. |
| [`bindings::zaun::bot::messages::delete`](/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-messages-delete/) | `message.delete`. |
| [`bindings::zaun::bot::storage::delete`](/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-storage-delete/) |  |
| [`bindings::zaun::bot::interactions::delete_original`](/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-interactions-delete_original/) | Deletes the original response. |
| [`dispatch`](/docs/reference/rust/zaun-bot/function-dispatch/) | Calls the `Bot` handler for `event`. |
| [`bindings::zaun::bot::messages::dm`](/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-messages-dm/) | A direct message to member `member-id` (capability `dms`): opens the DM when needed, then sends. Returns the DM's channel id and the message id. |
| [`bindings::zaun::bot::messages::edit`](/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-messages-edit/) | `message.edit` of one of the bot's messages. |
| [`bindings::zaun::bot::interactions::edit_original`](/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-interactions-edit_original/) | Edits the original response (ends a deferred "thinking" state). |
| [`bindings::zaun::bot::voice::end_stream`](/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-voice-end_stream/) | The `pushed` track ends once its buffered packets have played. |
| [`bindings::zaun::bot::voice::enqueue`](/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-voice-enqueue/) | Adds `track` to the queue (≤ 100); returns the queue's length. |
| [`bindings::zaun::bot::timers::every`](/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-timers-every/) | Fires every `ms` (≥ 1000). |
| [`bindings::zaun::bot::http::fetch`](/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-http-fetch/) |  |
| [`bindings::zaun::bot::interactions::followup`](/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-interactions-followup/) | A follow-up message, within 15 minutes; at most 10. |
| [`bindings::zaun::bot::storage::get`](/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-storage-get/) |  |
| [`bindings::zaun::bot::community::get_channel`](/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-community-get_channel/) |  |
| [`bindings::zaun::bot::community::get_member`](/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-community-get_member/) | Needs capability `members` for members the bot has not seen. |
| [`bindings::zaun::bot::community::get_role`](/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-community-get_role/) |  |
| [`bindings::zaun::bot::messages::history`](/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-messages-history/) | `message.history`: up to `limit` (1-100) messages before `before`. |
| [`mention::is_id`](/docs/reference/rust/zaun-bot/function-mention-is_id/) | Whether `id` is a well-formed Zaun id: 16 bytes in unpadded base64url (22 characters, the last one of `A`, `Q`, `g`, `w`). |
| [`bindings::zaun::bot::voice::join`](/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-voice-join/) | Joins voice channel `channel` (leaving another one first). Returns once media can flow (at most about 10 s). `FORBIDDEN` without `voice`, `CONNECT` or `SPEAK`. |
| [`bindings::zaun::bot::community::kick`](/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-community-kick/) | `member.kick`. |
| [`bindings::zaun::bot::voice::leave`](/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-voice-leave/) | Leaves; playback stops and the queue is cleared. |
| [`bindings::zaun::bot::community::list_channels`](/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-community-list_channels/) |  |
| [`bindings::zaun::bot::storage::list_keys`](/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-storage-list_keys/) | Keys starting with `prefix`, in order, after `after`, at most `limit` (≤ 1000). |
| [`bindings::zaun::bot::community::list_members`](/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-community-list_members/) |  |
| [`bindings::zaun::bot::dms::list_open`](/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-dms-list_open/) | `dm.list`: the DMs the bot has open. |
| [`bindings::zaun::bot::community::list_roles`](/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-community-list_roles/) |  |
| [`mention::member`](/docs/reference/rust/zaun-bot/function-mention-member/) | The text that shows a member mention: `<@id>` (discord.js `userMention`). |
| [`bindings::zaun::bot::voice::move_`](/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-voice-move_/) | Moves the queued track at `from` to `to` (both 0-based); the tracks between shift. `NOT_FOUND` past the end. |
| [`mention::none`](/docs/reference/rust/zaun-bot/function-mention-none/) | No mentions. |
| [`bindings::zaun::bot::dms::open`](/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-dms-open/) | `dm.open`: the DM with `member-id`, created when there is none. |
| [`bindings::zaun::bot::audio::open`](/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-audio-open/) | Opens the stream in the bot's voice channel, pausing the player. `CONFLICT` when the bot is in no voice channel or a stream is open; `UNSUPPORTED` for a format the host cannot take |
| [`mention::parse`](/docs/reference/rust/zaun-bot/function-mention-parse/) | The mentions `content` shows: `<@id>` (and Discord's `<@!id>`) for members, `<@&id>` for roles, `@everyone`. Each id once, in order, at most `MAX_MEMBERS` members and `MAX_ROLES` r |
| [`bindings::zaun::bot::voice::pause`](/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-voice-pause/) |  |
| [`bindings::zaun::bot::voice::play`](/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-voice-play/) | Plays `track` now, replacing the current one; the queue stays. |
| [`bindings::zaun::bot::voice::push`](/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-voice-push/) | Opus packets (2.5 to 120 ms each, ≤ 1000 bytes) for the current `pushed` track. Returns the audio buffered, in ms; `BUSY` past 3 s, so push about as fast as it plays. |
| [`bindings::zaun::bot::messages::react`](/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-messages-react/) | `reaction.add`. |
| [`bindings::zaun::bot::voice::remove`](/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-voice-remove/) | Removes the queued track at `index` (0 plays next); returns its title. `NOT_FOUND` past the end. |
| [`bindings::zaun::bot::community::remove_role`](/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-community-remove_role/) |  |
| [`bindings::zaun::bot::interactions::respond`](/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-interactions-respond/) | The initial response, within 3 s (the runtime defers automatically at 2.5 s). Returns the message id when the response created a channel message. |
| [`bindings::zaun::bot::voice::resume`](/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-voice-resume/) |  |
| [`mention::role`](/docs/reference/rust/zaun-bot/function-mention-role/) | The text that shows a role mention: `<@&id>` (discord.js `roleMention`). |
| [`bindings::zaun::bot::voice::seek`](/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-voice-seek/) | Jumps to `ms` into the current track (past the end: the track ends). `UNSUPPORTED` for live streams and pushed audio, and on hosts that cannot seek; `CONFLICT` when nothing plays. |
| [`bindings::zaun::bot::messages::send`](/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-messages-send/) | `message.send`. Returns the new message id. |
| [`presence::set`](/docs/reference/rust/zaun-bot/function-presence-set/) | Sets the bot's status and activity (`None`: no activity). |
| [`bindings::zaun::bot::commands::set`](/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-commands-set/) |  |
| [`bindings::zaun::bot::storage::set`](/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-storage-set/) | `QUOTA_EXCEEDED` when the grant is used up. |
| [`bindings::zaun::bot::presence::set`](/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-presence-set/) | Sets the bot's status and activity (`signal.presence`). The host shows changes at most every 3 s: a later call within that time replaces an earlier one that has not gone out. The b |
| [`bindings::zaun::bot::voice::set_loop`](/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-voice-set_loop/) | Sets what happens when a track ends (`off` when the bot joins). |
| [`presence::set_status`](/docs/reference/rust/zaun-bot/function-presence-set_status/) | Sets the custom status text and emoji, cleared by the host at `expires_at` (ms) if given. |
| [`presence::set_status_text`](/docs/reference/rust/zaun-bot/function-presence-set_status_text/) | Sets the custom status text, kept until changed. |
| [`bindings::zaun::bot::presence::set_status_text`](/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-presence-set_status_text/) | Sets the custom status text and emoji (`member.status.set`), kept until `expires-at` (or changed); `none` for both clears it. |
| [`bindings::zaun::bot::voice::set_volume`](/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-voice-set_volume/) | Sets the playback volume, 0-200 % (100 when the bot joins; `BAD_REQUEST` above 200). Changing it means decoding and re-encoding the Opus audio, so hosts without an Opus encoder ans |
| [`bindings::zaun::bot::voice::shuffle`](/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-voice-shuffle/) | Puts the queue in a random order (the current track keeps playing). |
| [`bindings::zaun::bot::voice::skip`](/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-voice-skip/) | Ends the current track; the next one starts. |
| [`bindings::zaun::bot::voice::state`](/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-voice-state/) | Where the bot is and what it plays. |
| [`bindings::zaun::bot::voice::stop`](/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-voice-stop/) | Ends the current track and clears the queue. |
| [`text_choice`](/docs/reference/rust/zaun-bot/function-text_choice/) | A text `Choice` (autocomplete results and fixed choices). |
| [`bindings::zaun::bot::community::timeout`](/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-community-timeout/) | `member.timeout`; `none` clears. |
| [`bindings::zaun::bot::messages::unreact`](/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-messages-unreact/) | `reaction.remove` of the bot's own reaction. |
| [`bindings::zaun::bot::messages::upload`](/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-messages-upload/) | Uploads a file for the bot's next message (capability `attachments`). Returns the attachment id to put in `message-body.attachments`. |
| [`bindings::zaun::bot::log::write`](/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-log-write/) |  |
| [`bindings::zaun::bot::audio::write_opus`](/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-audio-write_opus/) | Opus packets, for an `opus` stream. Returns the audio buffered, in ms; `BUSY` past 3 s. |
| [`bindings::zaun::bot::audio::write_pcm`](/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-audio-write_pcm/) | Interleaved samples, for a `pcm` stream; any count (the host frames them). Returns the audio buffered, in ms; `BUSY` past 3 s. |

## Macros

| Item | Summary |
|---|---|
| [`export_bot`](/docs/reference/rust/zaun-bot/macro-export_bot/) | Exports a `Bot` type as the component's `zaun:bot/bot` implementation. |
| [`log_info`](/docs/reference/rust/zaun-bot/macro-log_info/) | Writes an `info` line to the bot's log (`zaun-host bot logs`). |

## Structs

| Item | Summary |
|---|---|
| [`bindings::zaun::bot::types::ActionRow`](/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-actionrow/) | Type 1: up to 5 buttons, or one select. |
| [`ActionRow`](/docs/reference/rust/zaun-bot/struct-actionrow/) | Builds a types::ActionRow: up to 5 buttons, or one select. |
| [`presence::Activity`](/docs/reference/rust/zaun-bot/struct-presence-activity/) | What the bot is doing: build one with `Activity::playing`, `Activity::listening`, … |
| [`bindings::zaun::bot::types::Activity`](/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-activity/) | What a member (or the bot) is doing. |
| [`prelude::ApplicationCommand`](/docs/reference/rust/zaun-bot/struct-prelude-applicationcommand/) |  |
| [`bindings::zaun::bot::types::Attachment`](/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-attachment/) |  |
| [`Audio`](/docs/reference/rust/zaun-bot/struct-audio/) | The bot's audio output stream. |
| [`bindings::zaun::bot::types::Button`](/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-button/) | Type 2. |
| [`Button`](/docs/reference/rust/zaun-bot/struct-button/) | Builds a `types::Button`. |
| [`prelude::Channel`](/docs/reference/rust/zaun-bot/struct-prelude-channel/) |  |
| [`bindings::zaun::bot::types::Checkbox`](/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-checkbox/) | Type 23. |
| [`bindings::zaun::bot::types::CheckboxGroup`](/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-checkboxgroup/) | Type 22: 1-10 options. |
| [`prelude::Choice`](/docs/reference/rust/zaun-bot/struct-prelude-choice/) |  |
| [`bindings::zaun::bot::types::ChoiceOption`](/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-choiceoption/) |  |
| [`prelude::CommandData`](/docs/reference/rust/zaun-bot/struct-prelude-commanddata/) |  |
| [`bindings::zaun::bot::types::CommandOption`](/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-commandoption/) |  |
| [`CommandOptionBuilder`](/docs/reference/rust/zaun-bot/struct-commandoptionbuilder/) | Builds a `CommandOption`. |
| [`bindings::zaun::bot::types::CommunityProfile`](/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-communityprofile/) |  |
| [`prelude::ComponentData`](/docs/reference/rust/zaun-bot/struct-prelude-componentdata/) |  |
| [`Config`](/docs/reference/rust/zaun-bot/struct-config/) | The bot's configuration: the keys its manifest declares in `config`, each with the value the owner set or else its default. Keys with neither are absent. Given to `Bot::on_start` a |
| [`bindings::zaun::bot::types::Container`](/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-container/) | Type 17. |
| [`Container`](/docs/reference/rust/zaun-bot/struct-container/) | Builds a Components V2 `types::Container`. |
| [`Context`](/docs/reference/rust/zaun-bot/struct-context/) | The interaction being handled, without its data (handlers get the data separately). |
| [`bindings::zaun::bot::types::DefaultValue`](/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-defaultvalue/) |  |
| [`bindings::zaun::bot::types::Embed`](/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-embed/) |  |
| [`bindings::zaun::bot::types::EmbedAuthor`](/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-embedauthor/) | embeds |
| [`EmbedBuilder`](/docs/reference/rust/zaun-bot/struct-embedbuilder/) | Builds an `Embed`. Pictures are attachment ids of the same message. |
| [`bindings::zaun::bot::types::EmbedField`](/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-embedfield/) |  |
| [`bindings::zaun::bot::types::EmbedFooter`](/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-embedfooter/) |  |
| [`bindings::zaun::bot::types::EntitySelect`](/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-entityselect/) |  |
| [`EventContext`](/docs/reference/rust/zaun-bot/struct-eventcontext/) | What an event handler can do: send, reply, react, delete and send direct messages. Every call is an ordinary command on the bot's member, checked by the host. |
| [`bindings::zaun::bot::types::File`](/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-file/) | Type 13. |
| [`bindings::zaun::bot::types::FileUpload`](/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-fileupload/) | Type 19. |
| [`prelude::HostError`](/docs/reference/rust/zaun-bot/struct-prelude-hosterror/) | What the host refused, mirroring the protocol's error codes. |
| [`bindings::zaun::bot::types::Interaction`](/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-interaction/) |  |
| [`bindings::zaun::bot::types::InteractionMetadata`](/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-interactionmetadata/) |  |
| [`bindings::zaun::bot::types::Label`](/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-label/) | Type 18. |
| [`bindings::zaun::bot::types::Localized`](/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-localized/) |  |
| [`bindings::zaun::bot::types::MediaGallery`](/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-mediagallery/) | Type 12: 1-10 items. |
| [`bindings::zaun::bot::types::MediaItem`](/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-mediaitem/) |  |
| [`prelude::Member`](/docs/reference/rust/zaun-bot/struct-prelude-member/) | community objects |
| [`bindings::zaun::bot::types::MemberRoles`](/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-memberroles/) |  |
| [`bindings::zaun::bot::types::MemberTimeout`](/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-membertimeout/) | `until` is `none` when the timeout was cleared. |
| [`prelude::Mentions`](/docs/reference/rust/zaun-bot/struct-prelude-mentions/) |  |
| [`prelude::Message`](/docs/reference/rust/zaun-bot/struct-prelude-message/) |  |
| [`bindings::zaun::bot::types::MessageBody`](/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-messagebody/) | What a bot sends: `message.send`, responses, follow-ups and edits. |
| [`bindings::zaun::bot::types::MessageDeleted`](/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-messagedeleted/) |  |
| [`bindings::zaun::bot::types::MessageEvent`](/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-messageevent/) | A message, and whether it is in a direct-message channel with the bot. |
| [`bindings::zaun::bot::types::MessageFlags`](/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-messageflags/) | messages Discord's values: 4, 64, 4096, 32768. `LOADING` is host-set only. |
| [`bindings::zaun::bot::types::MessagesDeleted`](/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-messagesdeleted/) |  |
| [`bindings::zaun::bot::types::Modal`](/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-modal/) |  |
| [`Modal`](/docs/reference/rust/zaun-bot/struct-modal/) | Builds a types::Modal: 1–5 labelled inputs and text blocks. |
| [`prelude::ModalData`](/docs/reference/rust/zaun-bot/struct-prelude-modaldata/) |  |
| [`bindings::zaun::bot::types::ModalValue`](/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-modalvalue/) |  |
| [`audio::PcmFormat`](/docs/reference/rust/zaun-bot/struct-audio-pcmformat/) | PCM the host encodes to Opus. |
| [`bindings::zaun::bot::types::Presence`](/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-presence/) | `status`: `online`, `idle`, `dnd` or `offline` (invisible members look offline). |
| [`bindings::zaun::bot::types::RadioGroup`](/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-radiogroup/) | Type 21: 2-10 options. |
| [`bindings::zaun::bot::types::RawEvent`](/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-rawevent/) |  |
| [`prelude::Reaction`](/docs/reference/rust/zaun-bot/struct-prelude-reaction/) |  |
| [`prelude::Ready`](/docs/reference/rust/zaun-bot/struct-prelude-ready/) | events The bot's own identity, once its connection is up. |
| [`bindings::zaun::bot::types::ReceivedOption`](/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-receivedoption/) | One option the invoker filled in, with the sub-command path flattened onto the data. |
| [`bindings::zaun::bot::types::RegisteredCommand`](/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-registeredcommand/) |  |
| [`bindings::zaun::bot::types::Registration`](/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-registration/) | What `init` returns. |
| [`Reply`](/docs/reference/rust/zaun-bot/struct-reply/) | Builds a `MessageBody`. `Reply::from("text")` is the common case. |
| [`bindings::zaun::bot::http::Request`](/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-http-request/) |  |
| [`bindings::zaun::bot::types::Resolved`](/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-resolved/) |  |
| [`bindings::zaun::bot::http::Response`](/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-http-response/) |  |
| [`prelude::Role`](/docs/reference/rust/zaun-bot/struct-prelude-role/) |  |
| [`bindings::zaun::bot::types::Section`](/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-section/) | Type 9: 1-3 text displays and an accessory. |
| [`Section`](/docs/reference/rust/zaun-bot/struct-section/) | A Components V2 section: 1–3 text blocks with a button beside them. |
| [`bindings::zaun::bot::types::SelectOption`](/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-selectoption/) |  |
| [`bindings::zaun::bot::types::Separator`](/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-separator/) | Type 14. |
| [`SlashCommand`](/docs/reference/rust/zaun-bot/struct-slashcommand/) | Builds an ApplicationCommand: a slash command, or a user or message context command. |
| [`audio::StreamOptions`](/docs/reference/rust/zaun-bot/struct-audio-streamoptions/) |  |
| [`bindings::zaun::bot::types::StringSelect`](/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-stringselect/) | Type 3. |
| [`bindings::zaun::bot::types::SubCommand`](/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-subcommand/) | Type 1. |
| [`SubCommand`](/docs/reference/rust/zaun-bot/struct-subcommand/) | Builds a sub-command. |
| [`bindings::zaun::bot::types::SubCommandGroup`](/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-subcommandgroup/) | Type 2. |
| [`SubCommandGroup`](/docs/reference/rust/zaun-bot/struct-subcommandgroup/) | Builds a group of sub-commands (`/name group sub`). |
| [`bindings::zaun::bot::types::TextDisplay`](/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-textdisplay/) | Type 10. |
| [`TextDisplay`](/docs/reference/rust/zaun-bot/struct-textdisplay/) | A Components V2 text block (markdown, ≤ 4 000 per message in all). |
| [`bindings::zaun::bot::types::TextInput`](/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-textinput/) | Type 4. |
| [`TextInput`](/docs/reference/rust/zaun-bot/struct-textinput/) | Builds a `types::TextInput` for a modal. |
| [`bindings::zaun::bot::types::Thumbnail`](/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-thumbnail/) | Type 11: an image attachment of the same message. |
| [`bindings::zaun::bot::voice::Track`](/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-voice-track/) | Something to play. |
| [`bindings::zaun::bot::types::Typing`](/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-typing/) |  |
| [`Voice`](/docs/reference/rust/zaun-bot/struct-voice/) | The bot's voice: one stay at a time. |
| [`voice::VoiceState`](/docs/reference/rust/zaun-bot/struct-voice-voicestate/) |  |

## Traits

| Item | Summary |
|---|---|
| [`Bot`](/docs/reference/rust/zaun-bot/trait-bot/) | A Zaun bot. Every handler has a no-op default; implement the ones you need. |
| [`bindings::Guest`](/docs/reference/rust/zaun-bot/trait-bindings-guest/) |  |
| [`Options`](/docs/reference/rust/zaun-bot/trait-options/) | Reads option and modal values by name. |

## Type aliass

| Item | Summary |
|---|---|
| [`bindings::zaun::bot::presence::Activity`](/docs/reference/rust/zaun-bot/type-alias-bindings-zaun-bot-presence-activity/) |  |
| [`bindings::zaun::bot::commands::ApplicationCommand`](/docs/reference/rust/zaun-bot/type-alias-bindings-zaun-bot-commands-applicationcommand/) |  |
| [`bindings::zaun::bot::dms::Channel`](/docs/reference/rust/zaun-bot/type-alias-bindings-zaun-bot-dms-channel/) |  |
| [`bindings::zaun::bot::community::Channel`](/docs/reference/rust/zaun-bot/type-alias-bindings-zaun-bot-community-channel/) |  |
| [`bindings::Choice`](/docs/reference/rust/zaun-bot/type-alias-bindings-choice/) |  |
| [`bindings::Event`](/docs/reference/rust/zaun-bot/type-alias-bindings-event/) |  |
| [`bindings::zaun::bot::messages::HostError`](/docs/reference/rust/zaun-bot/type-alias-bindings-zaun-bot-messages-hosterror/) |  |
| [`bindings::zaun::bot::interactions::HostError`](/docs/reference/rust/zaun-bot/type-alias-bindings-zaun-bot-interactions-hosterror/) |  |
| [`bindings::zaun::bot::commands::HostError`](/docs/reference/rust/zaun-bot/type-alias-bindings-zaun-bot-commands-hosterror/) |  |
| [`bindings::zaun::bot::dms::HostError`](/docs/reference/rust/zaun-bot/type-alias-bindings-zaun-bot-dms-hosterror/) |  |
| [`bindings::zaun::bot::community::HostError`](/docs/reference/rust/zaun-bot/type-alias-bindings-zaun-bot-community-hosterror/) |  |
| [`bindings::zaun::bot::storage::HostError`](/docs/reference/rust/zaun-bot/type-alias-bindings-zaun-bot-storage-hosterror/) |  |
| [`bindings::zaun::bot::timers::HostError`](/docs/reference/rust/zaun-bot/type-alias-bindings-zaun-bot-timers-hosterror/) |  |
| [`bindings::zaun::bot::voice::HostError`](/docs/reference/rust/zaun-bot/type-alias-bindings-zaun-bot-voice-hosterror/) |  |
| [`bindings::zaun::bot::audio::HostError`](/docs/reference/rust/zaun-bot/type-alias-bindings-zaun-bot-audio-hosterror/) |  |
| [`bindings::zaun::bot::presence::HostError`](/docs/reference/rust/zaun-bot/type-alias-bindings-zaun-bot-presence-hosterror/) |  |
| [`bindings::zaun::bot::types::Id`](/docs/reference/rust/zaun-bot/type-alias-bindings-zaun-bot-types-id/) | A Zaun id: base64url without padding (22 characters for 16-byte ids). |
| [`bindings::zaun::bot::messages::Id`](/docs/reference/rust/zaun-bot/type-alias-bindings-zaun-bot-messages-id/) |  |
| [`bindings::zaun::bot::interactions::Id`](/docs/reference/rust/zaun-bot/type-alias-bindings-zaun-bot-interactions-id/) |  |
| [`bindings::zaun::bot::dms::Id`](/docs/reference/rust/zaun-bot/type-alias-bindings-zaun-bot-dms-id/) |  |
| [`bindings::zaun::bot::community::Id`](/docs/reference/rust/zaun-bot/type-alias-bindings-zaun-bot-community-id/) |  |
| [`bindings::zaun::bot::voice::Id`](/docs/reference/rust/zaun-bot/type-alias-bindings-zaun-bot-voice-id/) |  |
| [`bindings::Interaction`](/docs/reference/rust/zaun-bot/type-alias-bindings-interaction/) |  |
| [`bindings::zaun::bot::community::Member`](/docs/reference/rust/zaun-bot/type-alias-bindings-zaun-bot-community-member/) |  |
| [`bindings::zaun::bot::messages::Message`](/docs/reference/rust/zaun-bot/type-alias-bindings-zaun-bot-messages-message/) |  |
| [`bindings::zaun::bot::messages::MessageBody`](/docs/reference/rust/zaun-bot/type-alias-bindings-zaun-bot-messages-messagebody/) |  |
| [`bindings::zaun::bot::interactions::MessageBody`](/docs/reference/rust/zaun-bot/type-alias-bindings-zaun-bot-interactions-messagebody/) |  |
| [`bindings::zaun::bot::types::Permissions`](/docs/reference/rust/zaun-bot/type-alias-bindings-zaun-bot-types-permissions/) | A permission bitfield (permissions.md the protocol). |
| [`bindings::zaun::bot::commands::RegisteredCommand`](/docs/reference/rust/zaun-bot/type-alias-bindings-zaun-bot-commands-registeredcommand/) |  |
| [`bindings::Registration`](/docs/reference/rust/zaun-bot/type-alias-bindings-registration/) |  |
| [`bindings::zaun::bot::interactions::Response`](/docs/reference/rust/zaun-bot/type-alias-bindings-zaun-bot-interactions-response/) |  |
| [`bindings::zaun::bot::community::Role`](/docs/reference/rust/zaun-bot/type-alias-bindings-zaun-bot-community-role/) |  |
| [`bindings::zaun::bot::types::Timestamp`](/docs/reference/rust/zaun-bot/type-alias-bindings-zaun-bot-types-timestamp/) | Milliseconds since the Unix epoch. |
| [`bindings::zaun::bot::community::Timestamp`](/docs/reference/rust/zaun-bot/type-alias-bindings-zaun-bot-community-timestamp/) |  |
| [`bindings::zaun::bot::presence::Timestamp`](/docs/reference/rust/zaun-bot/type-alias-bindings-zaun-bot-presence-timestamp/) |  |
| [`bindings::VoiceEvent`](/docs/reference/rust/zaun-bot/type-alias-bindings-voiceevent/) |  |
