# Zaun documentation (full text)
All guide, example and reference pages of the Zaun docs, as Markdown. Each page starts with its URL.
---
url: https://zaunchat.github.io/docs/guide/introduction/
---
# Introduction
> What these docs cover, who they are for, and how to read them.
Welcome! These docs cover the three parts of Zaun you can build with:
| Project | What it is | Language |
|---|---|---|
| [`zaun-host`](https://github.com/zaunchat/zaun-community) | The program that runs a community: channels, roles, permissions, history, voice signalling, bots. | Rust (one binary or a Docker image) |
| [`zaun-client`](https://github.com/zaunchat/zaun-client) | The library apps and bots use to talk to a host. | Rust, and JavaScript/WebAssembly for browsers, Node.js and Bun |
| [`zaun-bot`](https://github.com/zaunchat/zaun-bot) | SDKs for bots that run *inside* a host as sandboxed WebAssembly. | TypeScript and Rust |
## How these docs are organised
- **Guide**: step-by-step pages. Start with
[What is Zaun?](/docs/guide/what-is-zaun/) and the [quick start](/docs/guide/quick-start/), then follow
the section you need: running a host, building a client, or writing bots.
- **Examples**: complete, working programs with explanations.
- **Reference**: generated API documentation for every public type and function, plus the
`zaun-host` command line and configuration.
## What you should know first
- **For a host:** basic command-line use. Docker makes it easiest; building from source needs Rust.
- **For a client or an external bot:** Rust, or JavaScript (async/await, `npm`).
- **For a hosted bot:** TypeScript (`@zaun/bot`, the default in these docs) or Rust. See
[TypeScript or Rust?](/docs/guide/bots/typescript-or-rust/). If you have written an interactions-based
bot elsewhere, read [Porting an existing bot](/docs/guide/bots/porting-a-bot/).
> **Tip: Status**
>
> Zaun is in alpha. APIs may change before 1.0, nothing is published to crates.io or npm yet (you
> build from the Git repositories), and the software has not had a security audit.
## Getting help
Open an issue in the repository the question is about:
[zaun-community](https://github.com/zaunchat/zaun-community/issues),
[zaun-client](https://github.com/zaunchat/zaun-client/issues) or
[zaun-bot](https://github.com/zaunchat/zaun-bot/issues). Found a mistake in the docs? Use
"Edit page" at the bottom of any page.
---
url: https://zaunchat.github.io/docs/guide/what-is-zaun/
---
# What is Zaun?
> Zaun in five minutes, how a community, its host, apps and bots fit together, and the one trade-off to know.
Zaun is a community platform with **channels, roles, permissions,
invites, moderation, voice and bots**, but without accounts and without a company in the middle.
## The pieces
```
members' apps and external bots the community's host
┌──────────────────────────────┐ ┌─────────────────────────┐
│ zaun-client (Rust or JS) │ ◀── SimpleX ─▶ │ zaun-host │
│ cache · events · voice │ post-quantum │ roles · channels │
└──────────────────────────────┘ encrypted │ history · bans │
│ hosted bots (WASM) ◀─┐ │
└───────────────────────┼─┘
in-process, no network
```
- **A community** is owned by a person (the owner), who holds the community's signing key.
- **A host** (`zaun-host`) runs the community. The owner signs a delegation that says which
host serves the community; anyone can run a host, and a community can [move to another
one](/docs/guide/host/moving-a-community/).
- **Members** connect to the host over [SimpleX](https://simplex.chat), a private messaging
network with no user identifiers. Each member has its own post-quantum key.
- **Apps and external bots** use [`zaun-client`](/docs/guide/client/installation/).
- **Hosted bots** are WebAssembly packages the host runs for a community, with only the
permissions they were granted. See [Bots](/docs/guide/bots/why-bots-in-the-host/).
## What a community has
- Text and announcement channels, categories, edits, deletes, reactions and history.
- Attachments (25 MB by default), sent as encrypted SimpleX files.
- Voice channels, end-to-end encrypted, relayed through the host's TURN server by default.
- Roles and permissions, with per-channel overrides and a hierarchy.
- Invites with use limits, expiry and optional approval.
- Moderation: probation for newcomers, kicks, bans, timeouts, suspensions, reports, an audit
log, and an emergency lockdown.
- Rate limits that never rely on IP addresses.
- Rich embeds, and for bots: slash commands, buttons, selects and modals, events, direct messages
and music in voice channels.
- Typing indicators per channel: with names, anonymous, or off.
- Status and presence: online, idle, do not disturb or invisible, an activity ("Listening to …"),
and a custom status text, for members and bots alike.
## The one trade-off to know
**Connections are end-to-end encrypted between each member and the host, but the host can read
the channels.** Channel messages are not end-to-end encrypted between members. Whoever runs the
host is trusted, and you can run it yourself.
That is what makes large communities work: one host sends each post to thousands of members,
search and moderation are simple, and members who were offline catch up by asking for
"everything after message 41". Voice audio is the exception: it is end-to-end encrypted between
participants, and the host never hears it.
## Next steps
- [Quick start](/docs/guide/quick-start/): a host, a community and a bot, end to end.
- [Concepts](/docs/guide/concepts/communities-and-hosts/): the ideas in a little more depth.
---
url: https://zaunchat.github.io/docs/guide/quick-start/
---
# Quick start
> Run a host with Docker, create a community from a script, and invite yourself, in about ten minutes.
This page takes you from nothing to a running community you own. You need Docker, and either
Rust or Node.js 22+ for the small script that creates the community.
1. **Start a host.**
```sh
docker run -d --name zaun-host --restart unless-stopped --memory 512m \
-v zaun-host:/var/lib/zaun-host ghcr.io/zaunchat/zaun-host
```
The first start creates the host's keys, database and configuration in the `zaun-host`
volume, then serves. There are no ports to publish: members reach it through SimpleX relays.
2. **Allow community creation, once.** By default nobody may create communities on a host.
Open it while you create yours:
```sh
docker exec zaun-host sed -i 's/^community_creation = .*/community_creation = "open"/' \
/var/lib/zaun-host/zaun-host.toml
docker restart zaun-host
```
3. **Note the host's address and key.**
```sh
docker exec zaun-host zaun-host address # the SimpleX address
docker exec zaun-host zaun-host id # the host id and public key
```
4. **Create the community** with `zaun-client`. You become its owner, and its root key (its
identity) is saved in the client's directory: back it up.
**JavaScript:**
```js
import { Client } from "zaun-client";
const client = await Client.start({ name: "Me", key: "a store passphrase" });
const community = await client.createCommunity({
host: "
",
hostKey: "",
name: "My community",
displayName: "Me",
});
console.log(await community.createInvite({ maxUses: 10 }));
```
**Rust:**
```rust
use zaun_client::Client;
use zaun_client::protocol::{b64, keys::PublicKey};
let client = Client::builder("./owner").name("Me").key("a store passphrase").start()?;
let host_key = PublicKey::from_bytes(&b64::decode("")?)?;
let community = client.create_community("", host_key, "My community", "Me")?;
let invite = community.create_invite(10, None)?; // 10 uses, no expiry
println!("{invite}");
```
5. **Close creation again**, so strangers can't create communities on your host:
```sh
docker exec zaun-host sed -i 's/^community_creation = .*/community_creation = "closed"/' \
/var/lib/zaun-host/zaun-host.toml
docker restart zaun-host
```
6. **Invite people** with the `zaun://join/…` link. Treat it as a secret: anyone with it can join.
> **Caution: Back up the owner's directory**
>
> The community's root key lives in the owner's client directory (`./owner/zaun//root.key`).
> Without it you can never move the community to another host or change its signed profile.
## What next?
- [Install a bot](/docs/guide/bots/quickstart/) that answers `/ping`.
- [Configure the host](/docs/guide/host/configuration/): attachments, voice, bots, your own relays.
- [Build an app](/docs/guide/client/connecting/) with `zaun-client`.
---
url: https://zaunchat.github.io/docs/guide/concepts/communities-and-hosts/
---
# Communities and hosts
> Who owns a community, what a host does, and how a community can move between hosts.
## A community has an owner, not an account
When someone creates a community, their client makes a **root key**. The community's id is
derived from that key, so the community *is* its key: nobody can take the name, and nothing
depends on a central registry. The owner signs a small **descriptor** (name, description, icon,
rules) with it.
## A host serves the community
The owner also signs a **delegation**: "this host serves my community". The host proves it holds
that delegation every time a member connects, so a fake host can't pretend to be the community.
A host:
- stores the community's state in SQLite: members, roles, channels, messages, bans, the audit log;
- checks every command against the permission rules;
- sends events (new messages, edits, role changes…) to every member who may see them;
- keeps attachments, relays voice signalling and keys, and runs hosted bots.
One host can serve many communities. Anyone can run one: on a PC, a VPS or a Raspberry Pi 4/5.
## Moving to another host
A community isn't tied to its host. The owner signs a new delegation for a new host, the old
host's operator exports the community (one encrypted, signed file), and the new host imports it.
Members' apps follow on their own and keep their identity, roles and history; bans stay in force.
See [Moving a community](/docs/guide/host/moving-a-community/).
## Who decides what
| Who | Can |
|---|---|
| **Owner** | Everything in the community; signs the descriptor and delegation; installs bots. |
| **Host operator** | Runs the program; sets limits for every community on the host (attachments, voice, a ceiling on bot grants); can read host-readable channels. |
| **Members** | What their roles allow. |
---
url: https://zaunchat.github.io/docs/guide/concepts/members-roles-permissions/
---
# Members, roles and permissions
> How membership, roles, per-channel overrides and the management hierarchy work.
## Members
A member is a key, not an account. When you join with an invite, your client makes a
**member key** (a hybrid of ML-DSA-65 and Ed25519, safe against future quantum computers) and
registers it. Your display name is per community.
Membership has states: **pending** (waiting for approval, when the invite or community requires
it), **probation** (new members, with newcomer restrictions the community chooses), **active**,
**suspended**, **banned** and **left**.
## Roles
Each role has a name, a colour, a position and a set of permission
bits. Everyone has the implicit `@everyone` role. A member's permissions are the union of their
roles' bits, then adjusted per channel.
## Per-channel overrides
A channel can **allow** or **deny** bits for a role or a member, on top of the community-wide
roles. Categories can pass their overrides to synced channels.
## The hierarchy
Nobody can act above their own rank:
- you can only manage roles below your highest role;
- you can only kick, ban or time out members whose highest role is below yours;
- nobody can act on the owner;
- you can't grant a permission you don't have yourself (unless you are the owner or an
administrator).
## Permission names
The same names appear in the Rust API (`Permissions::SEND_MESSAGES`), the JavaScript API
(`"SendMessages"`) and bot manifests (`SEND_MESSAGES`):
| Permission | Lets a member |
|---|---|
| `VIEW_CHANNEL` | see a channel and its messages |
| `SEND_MESSAGES` | post |
| `READ_MESSAGE_HISTORY` | read older messages |
| `MANAGE_MESSAGES` | delete others' messages |
| `ATTACH_FILES`, `EMBED_LINKS`, `ADD_REACTIONS`, `MENTION_EVERYONE` | as named |
| `MANAGE_CHANNELS`, `MANAGE_ROLES`, `MANAGE_COMMUNITY` | edit structure and settings |
| `CREATE_INVITE`, `MANAGE_INVITES` | invite, and manage everyone's invites |
| `KICK_MEMBERS`, `BAN_MEMBERS`, `TIMEOUT_MEMBERS` | moderate |
| `APPROVE_MEMBERS` | approve pending members |
| `VIEW_AUDIT_LOG`, `MANAGE_REPORTS`, `MANAGE_SAFETY` | read the audit log, handle reports, run lockdowns and admission policy |
| `CHANGE_NICKNAME`, `MANAGE_NICKNAMES` | rename yourself, or others |
| `BYPASS_SLOWMODE` | ignore a channel's slowmode |
| `CONNECT`, `SPEAK`, `MUTE_MEMBERS`, `DEAFEN_MEMBERS`, `MOVE_MEMBERS` | voice |
| `USE_APPLICATION_COMMANDS` | use bots' slash commands and components (on `@everyone` by default) |
| `ADMINISTRATOR` | everything, still within the hierarchy |
> **Note**
>
> Client libraries can check permissions locally (`member.can(...)` in Rust,
> `member.permissions(channel).has(...)` in JavaScript) to hide buttons a member can't use. The
> host always has the final say: it also applies lockdowns and newcomer rules the client can't see.
---
url: https://zaunchat.github.io/docs/guide/concepts/channels-and-messages/
---
# Channels, messages and sync
> Channel kinds, messages, attachments, embeds, and how members never miss anything.
## Channels
| Kind | What it is |
|---|---|
| `text` | messages, reactions, attachments, embeds |
| `announcement` | like text, usually posting-restricted |
| `voice` | voice chat (with text chat too) |
| `category` | groups channels; can pass permission overrides to them |
Channels have a topic, a position, optional **slowmode**, an optional **locked** flag, and a
retention and history policy the community chooses (for example, newcomers see only messages from
after they joined).
## Messages
A message has text (up to 4 000 characters), optional **embeds**, **attachments**, **mentions**
(named explicitly, never parsed from text) and reactions. Messages from bots can also carry
**components** (buttons, selects, layouts).
### Attachments
Files travel as SimpleX files over the same post-quantum connection; each is encrypted with a fresh
key. The host checks each file's size and SHA3-256 before keeping it, and is the archive: members
download from the host.
### Embeds
Embeds are rich cards (title, description, colour, fields, author, footer, image, thumbnail),
with one rule that matters: **pictures are attachments of the same message, never URLs**, so no reader's
app ever fetches an image from a third party (which would reveal its IP address).
## Nobody misses anything
Every channel's events are numbered. An app that was offline reconnects and asks for "everything
after number 41"; nothing is lost or doubled. Clients keep a cursor per channel and acknowledge
what they received, so the host knows what to resend.
---
url: https://zaunchat.github.io/docs/guide/concepts/transport-and-trust/
---
# SimpleX transport and trust
> How members reach a host over SimpleX, what is encrypted, what the host can see, and the post-quantum design.
## SimpleX, in one paragraph
[SimpleX](https://simplex.chat) is a messaging network with **no user identifiers**: not even
random ones. Messages go through relay servers (SMP for messages, XFTP for files) that only see
encrypted packets and can't tell who talks to whom. Zaun uses the official SimpleX servers by
default; a host can use its own.
## What is encrypted
| Between | Protection |
|---|---|
| A member and the host | SimpleX's end-to-end encryption, with post-quantum key exchange required: a client refuses a connection that isn't post-quantum |
| Attachments | a fresh symmetric key per file, sent only inside that connection |
| Voice | end to end between participants: SFrame (RFC 9605) with keys exchanged using X-Wing, a post-quantum hybrid, and signed by each member's key |
| Relays | see only ciphertext and timing |
## What the host can see
The host reads **channel content** (that's how it sends one post to thousands of members, keeps
history and enforces moderation). It does **not** hear voice, and it never learns members' IP
addresses (SimpleX hides them).
So whoever runs the host is trusted with the community's text, and that can be the owner
themselves. End-to-end encrypted
channels between members are [planned](/docs/resources/coming-soon/).
## Keys and signatures
Every key in Zaun (the community's root key, the host's key, each member's key, bot publishers'
keys) is a **composite** of ML-DSA-65 and Ed25519: a signature is valid only if both parts are.
An attacker would have to break both a post-quantum and a classical scheme.
## Voice and IP addresses
Voice media goes **through the host's TURN relay** by default, so participants don't learn each
other's IP addresses. A direct peer-to-peer path is an option apps can turn on (`allow_direct`), and
a host with no TURN relay only gets voice from apps that allow direct connections.
---
url: https://zaunchat.github.io/docs/guide/concepts/typing-indicators/
---
# Typing indicators
> Each channel decides how typing shows: with names, anonymously as a count, or not at all.
While a member writes, their app tells the host they are typing, and the host passes it on to the
others in the channel. How it is passed on is a **per-channel setting**, `typing`, which anyone
with `MANAGE_CHANNELS` can change:
| Mode | What others see |
|---|---|
| `named` (default) | who is typing: "Ada and Bea are typing…" |
| `anonymous` | only how many: "Someone is typing…", "2 people are typing…", "Several people are typing…" |
| `off` | nothing; apps don't even send typing signals there |
## Anonymous, precisely
- The host never puts member ids in an anonymous channel's typing event; apps and bots get only a
count.
- The count is capped at **1, 2 or 3**, where 3 means "three or more": an exact number would add
little and could help someone work out who is typing in a larger channel.
- Your own typing is never counted in what you see.
- In a very small channel, "someone is typing" can still give a person away. Anonymous typing hides
names; it can't hide that someone is there.
## Off
The host drops typing signals in an `off` channel, and well-behaved apps stop sending them. Use it
for announcement channels or anywhere typing would be noise.
Direct messages with bots always use `named` typing: there are only two people in them.
Categories don't pass the setting down; set it on each channel. Bots subscribed to typing events get
the same shape as members' apps. For the client API, see [Typing indicators](/docs/guide/client/typing/).
---
url: https://zaunchat.github.io/docs/guide/host/installing/
---
# Installing zaun-host
> Run zaun-host with Docker, Docker Compose, systemd, or a binary you build from source.
`zaun-host` is one static binary. It runs on Linux, x86_64 or aarch64 (Raspberry Pi 4/5), in about
512 MB of memory. Pick one way to run it:
**Docker:**
```sh
docker run -d --name zaun-host --restart unless-stopped --memory 512m \
-v zaun-host:/var/lib/zaun-host ghcr.io/zaunchat/zaun-host
docker exec zaun-host zaun-host address # the address members and owners connect to
```
The first start runs `zaun-host init` for you, then serves. The image is Alpine with one static
binary, runs as an unprivileged user, and is built for amd64 and arm64. There are **no ports to
publish**: members reach the host through SimpleX relays.
**Docker Compose:**
The repository's `deploy/compose.yaml` runs the same image with a read-only root file system and no
Linux capabilities:
```sh
curl -O https://raw.githubusercontent.com/zaunchat/zaun-community/main/deploy/compose.yaml
docker compose up -d
docker compose exec zaun-host zaun-host address
```
**From source:**
You need Rust; the exact version is pinned in `rust-toolchain.toml` and installed for you by
`rustup`.
```sh
git clone https://github.com/zaunchat/zaun-community && cd zaun-community
cargo build --release -p zaun-host
./target/release/zaun-host init --data-dir ./zaun-data
./target/release/zaun-host run --data-dir ./zaun-data
```
**systemd:**
Build or copy the binary to `/usr/local/bin/zaun-host`, then use the hardened unit from
`deploy/zaun-host.service` (it runs as `zaun-host`, reads `/var/lib/zaun-host/zaun-host.toml`, and
limits memory to 512 MB):
```sh
sudo useradd --system --no-create-home zaun-host
sudo install -d -o zaun-host -g zaun-host -m 0700 /var/lib/zaun-host
sudo -u zaun-host zaun-host init --data-dir /var/lib/zaun-host
sudo cp deploy/zaun-host.service /etc/systemd/system/
sudo systemctl enable --now zaun-host
```
## Choosing relays
By default the host uses the official SimpleX servers. To use your own `smp-server` (or anyone
else's), pass `--smp smp://@` to `init`, or list servers in `smp_servers`. With
your own SMP servers, also list an XFTP server (`--xftp`), or attachments are off.
> **Note**
>
> Server addresses that embed a queue-creation password are refused in the configuration: that's a
> secret, and the config file never holds secrets.
## Next
[First run](/docs/guide/host/first-run/): check the host and create your first community.
---
url: https://zaunchat.github.io/docs/guide/host/first-run/
---
# First run
> Check the host's health, find its address and key, and allow community creation.
## Files a host keeps
`zaun-host init --data-dir D` creates `D` (mode 0700) with:
| File | What it is |
|---|---|
| `host.key` | the host's signing key (mode 0600) |
| `simplex.key` | the SimpleX store's passphrase (mode 0600), unless you use `ZAUN_HOST_PASSPHRASE` |
| `host.db` | the communities' state (SQLite) |
| `zaun-host.toml` | the configuration, with no secrets in it |
| `simplex/` | the SimpleX client's encrypted store and attachment files |
| `bots/` | installed bots' compiled code cache and storage |
`init` refuses to overwrite any of them.
## Health checks
```sh
zaun-host status --data-dir D # config, files and permissions; non-zero exit on a failure
zaun-host doctor --data-dir D # offline read-only checks, each ok / warn / FAIL
```
Both connect to nothing and are safe while the host is running.
## Address and key
```sh
zaun-host address --data-dir D # the SimpleX address (after the first run)
zaun-host id --data-dir D # the host id and public key
```
An owner needs both to create a community on your host.
## Who may create communities
`community_creation` in `zaun-host.toml` decides:
| Value | Who may create a community |
|---|---|
| `"closed"` (default) | nobody |
| `"allow_list"` | owners whose community ids are listed in `creation_allow_list` |
| `"open"` | anyone who connects (rate-limited) |
For your own community, open creation briefly (see the [quick start](/docs/guide/quick-start/)), or
create the community's root key first and allow-list its id (`create_community_with_root` in
`zaun-client`).
## Logs
The host logs to stderr (good for systemd and containers) at `log_level` (`off`, `error`,
`warn`, `info`, `debug`). It never logs message content, keys, passphrases or invite links.
---
url: https://zaunchat.github.io/docs/guide/host/configuration/
---
# Configuring a host
> zaun-host.toml explained, section by section; relays, community creation, attachments, voice and bots.
The configuration is one TOML file: `/zaun-host.toml`, or `--config F`, or
`$ZAUN_HOST_CONFIG`, or `/etc/zaun-host/zaun-host.toml`. **It holds no secrets and refuses
unknown keys**, so a secret pasted into it stops the host instead of being used. Restart the host
after editing it. Every key is listed in the [configuration reference](/docs/reference/configuration/).
## The basics
```toml
data_dir = "/var/lib/zaun-host"
smp_servers = [] # empty: the official SimpleX servers
xftp_servers = [] # file servers; see below
max_connections = 1000 # connected or connecting, before new requests are refused
community_creation = "closed"
log_level = "info"
```
The store passphrase comes from `simplex.key`, `$ZAUN_HOST_PASSPHRASE`, or a file named by
`passphrase_file` (for example a systemd credential), never from this file.
## Attachments
```toml
[attachments]
enabled = true
max_file_mb = 25 # largest file
community_quota_mb = 2048 # what one community may store
transfers = 8 # uploads and downloads at once, host-wide
```
Files travel through XFTP servers: the official ones when `smp_servers` is empty, otherwise list
your own in `xftp_servers`, or attachments are off. The host keeps every file under its data
directory and re-sends it for each download, so keep limits modest on shared machines.
## Voice
```toml
[voice]
enabled = true
mesh_max = 8 # participants per voice channel, up to 10
ice_servers = ["turn:turn.example.net:3478"]
ice_policy = "relay" # media only through TURN, hiding participants' IP addresses
ice_credentials_file = "/run/credentials/zaun-host.service/turn.toml"
```
Audio never passes through the host: participants send it to each other, end-to-end encrypted.
The host only relays signalling and keys. List a TURN server and keep `ice_policy = "relay"` so
participants don't learn each other's addresses. TURN credentials live in their own file (mode
0600), never here.
## Bots
```toml
[bots]
enabled = true
allow_remote_install = true # community owners may install bots from their app
allow_unsigned = false # development only
max_bots = 20 # per community
allow_network = false # may any bot be granted internet access?
network_allow_list = [] # if set, granted hosts must be among these
max_memory_mb = 64
cpu_ms_per_call = 500
max_storage_mb = 64
allow_update_checks = false
allow_voice = true # bots may be granted voice: join voice channels and play audio
allow_dms = true # bots may be granted direct messages with members
# http_proxy = "socks5h://127.0.0.1:9050" # send bots' requests through Tor
```
Every value is a **ceiling**: a community owner can grant a bot less, never more. A bot's internet
requests leave from the host, so they reveal the host's IP address to the server it contacts; keep
`allow_network = false` unless you need it, or route requests through a proxy. A bot in voice
streams through the host's own media relay; set `allow_voice = false` to keep bots out of voice
channels, and `allow_dms = false` to stop any bot from messaging members privately. See
[Installing bots on a host](/docs/guide/bots/installing/).
---
url: https://zaunchat.github.io/docs/guide/host/moving-a-community/
---
# Moving a community and backups
> Hand a community to a new host with zaun-host export and import, and what members see.
A community belongs to its owner, not to its host. Moving it takes three steps:
1. **The owner signs a new delegation** naming the new host (from their app), and publishes it on
the old host, so members learn where to go.
2. **The old host's operator exports** the community:
```sh
zaun-host export --data-dir D --community --out community.zaun --passphrase-file pass.txt
```
The bundle holds the members, roles, channels, bans, admission policy, history, audit log and
attachment files, is signed by the old host and encrypted with the passphrase (mode 0600, at
least 16 bytes). Invitation secrets never leave. Stop `run` first.
3. **The new host's operator imports** it:
```sh
zaun-host import --data-dir D --passphrase-file pass.txt community.zaun
```
The import checks every signature and hash first, and that the owner's delegation names this
host. If the owner published the delegation after the export, pass it with
`--descriptor F` (JSON with `descriptor` and `delegation`). Stop `run` first.
Members' apps follow on their own (`communityMoving`, then `communityMoved` events in
`zaun-client`) and keep their identity, roles and history. Bans stay in force.
## Backups
An export is also a backup of one community. Back up, too:
- `host.key`: without it, owners must delegate to a new host key;
- the owner's client directory: the community's **root key** lives there, and nothing can replace it.
---
url: https://zaunchat.github.io/docs/guide/client/installation/
---
# Installing zaun-client
> Add zaun-client to a Rust project, or build its JavaScript/WebAssembly package for browsers, Node.js and Bun.
`zaun-client` is Zaun's client library: objects that act for themselves (`message.reply(...)`,
`member.kick(...)`) and named events (`messageCreate`, `memberAdd`). It is not
on crates.io or npm yet; you use it from Git.
**JavaScript:**
The JavaScript package is the same Rust code compiled to WebAssembly, so you build it once:
```sh
git clone https://github.com/zaunchat/zaun-client && cd zaun-client
rustup target add wasm32-unknown-unknown
cargo install wasm-bindgen-cli --version 0.2.130
scripts/build-zaun-js.sh # writes zaun/pkg/web and zaun/pkg/node
```
Then add it to your project (Node.js 22+, Bun, or a bundler for browsers):
```sh
npm install /path/to/zaun-client/zaun
```
```js
```
Node.js and Bun need `werift` for voice (`npm install werift@0.27`).
**Rust:**
```toml title="Cargo.toml"
[dependencies]
zaun-client = { git = "https://github.com/zaunchat/zaun-client" }
```
The crate needs Rust 1.95 or newer. Native builds link `aws-lc` (for voice's DTLS
certificates), so a C compiler must be available.
## Browsers need a tunnel
Browsers can't open raw TCP connections, and SimpleX relays listen on TCP. The browser build
connects through a **WebSocket tunnel** that only pipes bytes: TLS runs inside the WebAssembly
client, pinned to the relay's certificate fingerprint, so the tunnel only sees ciphertext. The
zaun-client repository's `worker/` is such a tunnel as a Cloudflare Worker; pass its URL as
`tunnel` to `Client.start`.
## Next
[Connecting and joining](/docs/guide/client/connecting/).
---
url: https://zaunchat.github.io/docs/guide/client/connecting/
---
# Connecting and joining
> Start a client, join a community with an invite, keep its state between runs, and handle your first events.
1. **Start a client.** A client keeps its keys and state in a store sealed with a passphrase.
**JavaScript:**
```js
import fs from "node:fs";
import { Client } from "zaun-client";
const file = "bot.snapshot";
const snapshot = fs.existsSync(file) ? fs.readFileSync(file) : undefined;
const client = await Client.start({ name: "Ping bot", key: process.env.ZAUN_KEY, snapshot });
client.on("change", () => fs.writeFileSync(file, client.save())); // keep the store
```
**Rust:**
```rust
use zaun_client::Client;
// Keys and state live under ./bot/zaun/ (key files mode 0600).
let client = Client::builder("./bot").name("Ping bot").key("store passphrase").start()?;
```
Without relays named, the official SimpleX servers are used. Name your own with
`.relay("smp://…")` (Rust) or `relays: ["smp://…"]` (JavaScript).
2. **Join a community** with an invite link, **only the first time**. Later runs reconnect from
the saved state.
**JavaScript:**
```js
if (client.saved.size === 0) {
await client.join(process.env.ZAUN_INVITE, "Ping bot"); // the link is a secret: never log it
}
```
**Rust:**
```rust
let community = client.join("zaun://join/…", "Ping bot")?;
println!("joined {community}");
```
Joining opens a post-quantum SimpleX connection to the host, checks the host's signed proof
that it serves the community, makes your member key and registers it, then loads the
community into the local cache.
3. **Handle events.**
**JavaScript:**
```js
client.on("ready", (community) => console.log(`ready in ${community.name}`));
client.on("messageCreate", async (message) => {
if (message.mine) return;
if (message.content === "!ping") await message.reply("pong");
});
```
**Rust:**
```rust
use zaun_client::Event;
for event in client.events() {
match event {
Event::Ready(community) => println!("ready in {community}"),
Event::MessageCreate(message) if !message.is_mine() => {
if message.content() == "!ping" {
message.reply("pong")?;
}
}
_ => {}
}
}
```
## Resulting code
See the complete [ping bot example](/docs/examples/client-ping-bot/), in Rust and JavaScript.
## Creating a community instead
An owner creates a community on a host that allows it (see [First run](/docs/guide/host/first-run/)):
`client.create_community(address, host_key, name, display_name)` in Rust,
`client.createCommunity({ host, hostKey, name, displayName })` in JavaScript. The community's root
key is saved in the client's store: back it up.
---
url: https://zaunchat.github.io/docs/guide/client/messages/
---
# Sending and managing messages
> Send, reply, edit, delete and react to messages, and read a channel's history.
## Send and reply
**JavaScript:**
```js
const general = community.channels.find((c) => c.name === "general");
const sent = await general.send("hello");
await sent.reply("replying to myself");
```
**Rust:**
```rust
let general = community.channel_by_name("general").expect("a general channel");
let sent = general.send("hello")?;
sent.reply("replying to myself")?;
```
## Edit, delete, react
**JavaScript:**
```js
const message = await general.send("typo");
await message.edit("fixed");
await message.react("👍");
await message.delete();
```
**Rust:**
```rust
let mut message = general.send("typo")?;
message.edit("fixed")?;
message.react("👍")?;
message.delete()?;
```
You can edit and delete your own messages; deleting someone else's needs `MANAGE_MESSAGES`.
## History
The client keeps no message history of its own; fetch pages from the host:
**JavaScript:**
```js
const latest = await general.messages.fetch({ limit: 50 });
```
**Rust:**
```rust
// Up to 50 messages before sequence number `before` (the newest without it), oldest first.
let latest = general.messages(None, 50)?;
```
## Partial messages
An edit or deletion event only says what changed, so it carries a **partial** message: its id, and
for an edit its new text. It still acts (`reply`, `edit`, `delete`, `react`), but fields the event
didn't include are empty.
---
url: https://zaunchat.github.io/docs/guide/client/embeds-and-attachments/
---
# Embeds and attachments
> Rich embeds built with EmbedBuilder, and files sent as encrypted attachments.
## Embeds
Embeds have a title, description, link, colour, timestamp, author, footer, up to
25 fields, an image and a thumbnail. Up to 10 per message.
**JavaScript:**
```js
const embed = new EmbedBuilder()
.setTitle("Release 1.2")
.setURL("https://example.com/releases/1.2")
.setDescription("What changed")
.setColor(0x5865f2)
.addFields({ name: "Fixes", value: "12", inline: true }, { name: "Features", value: "3", inline: true })
.setImage({ name: "screenshot.png", data: bytes })
.setFooter({ text: "zaun" });
await channel.send({ embeds: [embed] });
```
**Rust:**
```rust
use zaun_client::{EmbedBuilder, MessageOptions, Picture};
let embed = EmbedBuilder::new()
.title("Release 1.2")
.url("https://example.com/releases/1.2")
.description("What changed")
.color(0x5865F2)
.field("Fixes", "12", true)
.field("Features", "3", true)
.image(Picture::file("screenshot.png"))
.footer("zaun", None);
channel.send(MessageOptions::new().embed(embed))?;
```
> **Caution: Pictures are files, never URLs**
>
> An embed's image, thumbnail and icons are **attachments of the same message**: the client uploads
> them with the message. No reader's app ever fetches an image from a third party, which would show
> that server the reader's IP address. Links (`url`) must be `https://` and open only when clicked.
## Attachments
**JavaScript:**
```js
await channel.send({ content: "my cat", files: [{ name: "cat.png", data: bytes }] });
// on the other side
const bytes = await message.attachments.first().download();
```
**Rust:**
```rust
channel.send_files("my cat", &["cat.png"])?;
// on the other side, from an Event::MessageCreate
let saved = message.attachments()[0].download("./downloads")?;
```
Files travel as SimpleX files over the same post-quantum connection, each encrypted with a fresh
key. Sending returns once the host has checked and stored the files; downloading checks the size and
SHA3-256 before anything is saved. The host's `[attachments]` settings cap the size (25 MB by
default). With your own SMP relay, add an XFTP relay too, or there is no file server.
---
url: https://zaunchat.github.io/docs/guide/client/members-and-moderation/
---
# Members, roles and moderation
> Read members and roles, check permissions, and kick, ban and time out from code.
## Members and roles
The cache has the community's roles and channels, and the members it has seen. Fetch the full
member list when you need it:
**JavaScript:**
```js
const members = await community.members.fetch();
const mods = await community.roles.create("Moderators", { permissions: ["KickMembers", "TimeoutMembers"] });
await members.first().roles.add(mods);
```
**Rust:**
```rust
let members = community.fetch_members()?;
let mods = community.create_role("Moderators", Permissions::KICK_MEMBERS | Permissions::TIMEOUT_MEMBERS)?;
members[0].add_role(&mods)?;
```
## Checking permissions
**JavaScript:**
```js
if (member.permissions(channel).has("SendMessages")) { /* … */ }
```
**Rust:**
```rust
use zaun_client::protocol::bits::Permissions;
if author.can(Permissions::SEND_MESSAGES, Some(message.channel())) { /* … */ }
```
This uses the same resolver as the host, applied to the cache. Use it to hide what a member can't
do; the host still decides (it also applies lockdowns and newcomer rules).
## Moderation
**JavaScript:**
```js
await target.timeout(10 * 60_000, "cool down");
await target.kick("asked to");
await target.ban("spam");
```
**Rust:**
```rust
use std::time::Duration;
target.timeout(Some(Duration::from_secs(600)), Some("cool down"))?;
target.kick(Some("asked to"))?;
target.ban(Some("spam"))?;
```
Each needs the matching permission (`TIMEOUT_MEMBERS`, `KICK_MEMBERS`, `BAN_MEMBERS`) and a highest
role above the target's. Nobody can act on the owner. Bans follow the member's key, so a banned
member can't come back with the same identity.
## Invites and channels
**JavaScript:**
```js
const link = await community.createInvite({ maxUses: 5, expiresIn: 86_400 });
const lounge = await community.channels.create("lounge", { type: "voice" });
```
**Rust:**
```rust
use zaun_client::protocol::model::ChannelKind;
let link = community.create_invite(5, Some(Duration::from_secs(86_400)))?; // 5 uses, one day
let lounge = community.create_channel("lounge", ChannelKind::Voice)?;
```
---
url: https://zaunchat.github.io/docs/guide/client/voice/
---
# Voice
> Join voice channels, send and receive audio, and play music with an audio player; end-to-end encrypted.
Voice in Zaun is a mesh of WebRTC connections, one per other participant (up to 10 per channel).
Every audio frame is **end-to-end encrypted** on top of WebRTC's own encryption: each sender seals
its Opus frames with SFrame (RFC 9605) under a key that reaches the others only wrapped with X-Wing
(a post-quantum hybrid) and signed with its member key. Keys change whenever someone joins or
leaves. The host relays signalling and keys and **never hears audio**.
## Join and talk
**Rust:**
```rust
use std::time::Duration;
use zaun_client::VoiceEvent;
let voice = community.channel_by_name("lounge").expect("a voice channel").join()?;
voice.send_audio(&opus_frame); // one 20 ms Opus frame
if let Some(VoiceEvent::Audio { member, frame }) = voice.next_event(Duration::from_millis(100)) {
play(member, &frame);
}
```
Rust uses str0m and reaches the host's TURN relay over UDP, TCP or TLS (`turns:`, TLS 1.3 with the
post-quantum X25519MLKEM768 key exchange only). Your app encodes and plays Opus, or uses the built-in
`AudioPlayer` below.
**Browser:**
```js
const stream = await navigator.mediaDevices.getUserMedia({ audio: true });
const voice = await channel.join({ track: stream.getAudioTracks()[0] });
voice.on("track", ({ member, stream }) => playStream(member, stream));
```
Browsers use their own WebRTC with an encoded transform (`RTCRtpScriptTransform` in Firefox,
Safari and Chromium; Chromium's older encoded streams as a fallback). Pages with a
Content-Security-Policy need `worker-src blob:`.
**Node.js / Bun:**
```js
const voice = await channel.join();
const { finished } = voice.play("song.opus"); // an Ogg Opus file, in real time
voice.on("audio", ({ member, frame }) => decode(member, frame));
await finished;
```
Node.js and Bun use werift (`npm install werift@0.27`). `voice.sendAudio(frame)` sends one Opus
frame.
## Playing music (Rust)
`AudioPlayer` plays resources into every voice session
subscribed to it, on absolute 20 ms deadlines so the stream keeps real time.
```rust
use zaun_client::{AudioPlayer, AudioPlayerEvent, AudioResource};
let voice = community.channel_by_name("music").expect("a voice channel").join()?;
let player = AudioPlayer::new()?;
voice.subscribe(&player);
player.play(AudioResource::ogg_file("intro.opus")?); // no transcoding
player.enqueue(AudioResource::ffmpeg_file("song.flac", Default::default())?); // anything ffmpeg reads
for event in player.events() {
if let AudioPlayerEvent::TrackEnd { .. } = event {
// pick the next song
}
}
```
A player with nobody able to hear it (no subscriber, or everyone muted) pauses itself, and resumes
when someone can hear it again.
## Privacy
Media goes only through the host's TURN relay unless both the host and your app allow a direct
connection (`allow_direct` / `allowDirect`), since a direct connection shows your IP address to the
other participants. Each member's key is **pinned** the first time the client sees it; if a host
later lists another key for that member, the participant is skipped with a `KeyChanged` event, and
`member.fingerprint()` gives people something to compare out of band.
---
url: https://zaunchat.github.io/docs/guide/client/bots/
---
# Using bots
> List a community's bots and commands, run commands, click components, submit modals, and (as the owner) install and manage bots.
Bots answer through the same connection as everything else, so an app uses them with a few calls.
This page is about an app **using** bots; to write one, see [Bots](/docs/guide/bots/quickstart/) (hosted)
or [External bots](/docs/guide/bots/external-bots/).
## Bots and their commands
The client keeps the community's bot commands and bot cards up to date, and loads them once the
community is ready.
**JavaScript:**
```js
client.on("appsReady", (community) => {
for (const command of community.commands.values()) console.log(`/${command.name}`);
for (const card of community.bots.values()) console.log(card.name, card.capabilities);
});
client.on("commandsUpdate", (community, botId) => { /* a bot changed its commands */ });
client.on("botUpdate", (community, card) => { /* installed, updated, re-granted, disabled */ });
const me = community.member(community.data.me);
const usable = [...community.commands.values()].filter((c) => me.canUse(c, channel));
```
A member's `isBot` and `botId` tell whether it is a bot; `community.bot(botId)` fetches its card.
**Rust:**
```rust
use zaun_client::Event;
for event in client.events() {
match event {
Event::AppsReady(community) => {
for command in community.commands() { println!("/{}", command.name); }
for card in community.bots() { println!("{} {:?}", card.name, card.capabilities); }
}
Event::CommandsUpdate { .. } | Event::BotUpdate { .. } => { /* refresh the picker */ }
_ => {}
}
}
```
`Member::is_bot()`, `Member::bot_id()` and `can_use(command, channel)` mirror the JavaScript calls.
Every member can read every bot's card: its permissions, whether it can read message content, the
hosts it may contact, its storage, voice and direct-message capabilities. Show it wherever a bot's
name appears (the BOT badge).
## Running commands, clicking, submitting
The host passes each use to the bot; the bot's answer arrives as an event (a normal message, or
one of the events below).
**JavaScript:**
```js
// /weather city: Cairo
await channel.invokeCommand(weather, [{ name: "city", type: 3, value: "Cairo" }]);
// A button or select on a bot's message
await message.click("vote:yes");
// Suggestions while typing: they come as `autocomplete`
await channel.autocomplete(weather, [{ name: "city", type: 3, value: "Ca", focused: true }]);
client.on("autocomplete", ({ choices }) => showSuggestions(choices));
// A modal the bot opened
client.on("modalOpen", async ({ channel, interaction, customId, components }) => {
await channel.submitModal(interaction, customId, [{ custom_id: "subject", value: "Hello" }]);
});
// Replies only you see, and failures
client.on("interactionReply", ({ op, message }) => { /* ephemeral: created, updated, deleted */ });
client.on("interactionFail", ({ reason }) => { /* "timeout", "bot_error" or "bot_unavailable" */ });
```
**Rust:**
```rust
let interaction = channel.invoke_command(weather.command_id, options, None)?;
message.click("vote:yes", vec![])?;
channel.autocomplete(weather.command_id, focused_options)?;
channel.submit_modal(modal_interaction, "feedback", inputs)?;
```
The answers arrive as `Event::InteractionReply`, `Event::ModalOpen`, `Event::Autocomplete` and
`Event::InteractionFail`.
Using a command needs `USE_APPLICATION_COMMANDS` (on `@everyone` by default) and whatever default
permissions the command asks for.
## Installing and managing bots (owners)
Only the community's owner, or the host's operator with `zaun-host bot`, installs bots. Upload the
`.zbot` file as an attachment first, then install it; show the owner what it asks for before they
confirm.
**JavaScript:**
```js
const card = await community.installBot(attachmentId); // grants: what the manifest asks, within the host's ceiling
await community.grantBot(card.bot_id, { capabilities: { message_content: false } });
await community.disableBot(card.bot_id);
await community.enableBot(card.bot_id);
await community.updateBot(card.bot_id, newAttachmentId); // wider requests wait for approval
await community.removeBot(card.bot_id);
await community.registerBot(member, "Helper"); // mark a member as an external bot
```
**Rust:**
`Community::install_bot`, `grant_bot`, `enable_bot`, `disable_bot`, `update_bot`, `remove_bot` and
`register_bot` mirror the JavaScript calls.
---
url: https://zaunchat.github.io/docs/guide/client/direct-messages/
---
# Direct messages with bots
> Open, read, send in and close direct messages with bots, and let members turn DMs from bots off.
A **direct message** (DM) is a private channel between one bot and one member, relayed by the host.
Only those two can see it: not the owner, not administrators. Members can open a DM with any bot
that has the `dms` capability; bots can open one with a member who allows DMs from bots.
## Opening and sending
**JavaScript:**
```js
const bot = community.member(botMemberId);
const dm = await bot.dm(); // the DM channel, opened if needed
await dm.send("hi!");
await bot.send("hi again"); // the same, in one call
for (const channel of community.dms) { // this member's open DMs
console.log(channel.recipient?.displayName, channel.isDM);
}
await dm.closeDm(); // hides it for this member
```
**Rust:**
```rust
let bot = community.member(bot_member_id);
let dm = bot.dm()?; // the DM channel, opened if needed
dm.send("hi!")?;
bot.send("hi again")?;
for channel in community.dms() {
println!("{:?} {}", channel.recipient(), channel.is_dm());
}
dm.close_dm()?;
```
A DM is a channel: messages, replies, reactions, embeds, a bot's components and modals, and that
bot's slash commands all work in it. Message events in a DM are marked as such.
## Events
**JavaScript:**
```js
client.on("dmCreate", (channel, recipient) => { /* opened by either side, or found at load */ });
client.on("dmDelete", (channel) => { /* this member closed it */ });
client.on("messageCreate", (message) => {
if (message.channel.isDM) { /* a message in a DM */ }
});
```
**Rust:**
`Event::DmCreate { channel, recipient }` and `Event::DmDelete(channel)`; messages in DMs come as
`Event::MessageCreate` like any other.
## The member decides
Each member chooses, per community, whether bots may open DMs with them:
**JavaScript:**
```js
const { dms_from_bots } = await community.dmSettings();
await community.setDmsFromBots(false);
```
**Rust:**
```rust
let settings = community.dm_settings()?;
community.set_dms_from_bots(false)?;
```
A closed DM stays closed to the bot until the member writes in it or opens it again. Bots are also
rate limited (at most 10 new DMs a minute, and 5 messages an hour into a DM the member never wrote
in). Errors your app may show: `FORBIDDEN` with reason `dms_closed`, `RATE_LIMITED` with category
`dms`, and `NOT_FOUND` for a DM the member isn't part of.
---
url: https://zaunchat.github.io/docs/guide/client/typing/
---
# Typing indicators
> Send and show typing, and set a channel's typing mode: named, anonymous or off.
Each channel has a **typing mode** (see [Typing indicators](/docs/guide/concepts/typing-indicators/)):
`named` (the default) shows who is typing, `anonymous` only how many, and `off` nothing at all.
The client knows each channel's mode and does the right thing.
## Sending
**JavaScript:**
```js
// Call on keystrokes; it sends at most what the host accepts, and nothing where typing is off.
const sent = channel.startTyping(); // false: typing is off here, nothing was sent
```
**Rust:**
```rust
let sent = channel.start_typing()?; // false: typing is off here, nothing was sent
```
## Showing
**JavaScript:**
```js
client.on("typingStart", ({ channel, anonymous, count, members }) => {
const text = anonymous
? count === 1 ? "Someone is typing…" : count === 2 ? "2 people are typing…" : "Several people are typing…"
: `${members.map((m) => m.displayName).join(", ")} typing…`;
showTyping(channel, text);
});
channel.typing; // now: { kind: "named", member_ids } | { kind: "anonymous", count } | null
```
**Rust:**
```rust
use zaun_client::{Event, TypingNow};
if let Event::TypingStart { channel, typing } = event {
match typing {
TypingNow::Named { member_ids } => { /* show names */ }
TypingNow::Anonymous { count } => { /* 1, 2, or 3 meaning "three or more" */ }
}
}
let now = channel.typing(); // Option
```
In an anonymous channel the count is capped: 1, 2, or 3 meaning "three or more", and your own
typing is never counted. A typing state lasts a few seconds unless it's repeated.
## Setting a channel's mode
Needs `MANAGE_CHANNELS`:
**JavaScript:**
```js
await channel.setTypingMode("anonymous"); // "named", "anonymous" or "off"
channel.typingMode; // the current mode
```
**Rust:**
```rust
use zaun_client::protocol::model::TypingMode;
channel.set_typing_mode(TypingMode::Anonymous)?;
let mode = channel.typing_mode();
```
---
url: https://zaunchat.github.io/docs/guide/client/status-and-presence/
---
# Status and presence
> Set your status, activity and custom status text, and show everyone else's: online, idle, do not disturb, invisible.
Every member has a **presence**: a status (online, idle, do not disturb, or offline) and
optionally an **activity**, what they are doing ("Playing chess", "Listening to lofi radio"). A
member can also set a **custom status text** with an emoji, which the host keeps until it is
changed or expires. Bots have the same presence as members
([bots: status and presence](/docs/guide/bots/status-and-presence/)).
## Setting your status and activity
Presence is set once for the whole client and goes to every community it is connected to.
**JavaScript:**
```js
client.setPresence("online", { type: "listening", name: "lofi radio", state: "ChilledCow" });
client.setPresence("dnd"); // no activity
client.setPresence("invisible"); // everyone else sees you offline
```
`setPresence` returns `false`, and sends nothing, when the status or the activity is not valid.
**Rust:**
```rust
use zaun_client::presence::{activity, ActivityType, Status};
let mut listening = activity(ActivityType::Listening, "lofi radio");
listening.state = Some("ChilledCow".into());
client.set_presence(Status::Online, Some(listening))?;
client.set_presence(Status::Dnd, None)?; // no activity
client.set_presence(Status::Invisible, None)?; // everyone else sees you offline
```
| Status | Everyone else sees |
|---|---|
| `online` | online |
| `idle` | idle (away) |
| `dnd` | do not disturb |
| `invisible` | offline, with no activity |
An activity has a `type` (`kind` in Rust): `playing`, `streaming`, `listening`, `watching`,
`competing` or `custom`; a `name`; and optionally `details` and `state` (a second and third line),
`started_at` (ms since the epoch, to show an elapsed time), `url` (an `https://` link, streaming
only) and `emoji` (custom only).
The host shows at most one change per member every 3 seconds. Call it as often as you like: the
client keeps the latest, sends it when the window allows, and sends it again after each
reconnection.
## Custom status text
The custom status is set per community, and the host keeps it (presence is live only).
**JavaScript:**
```js
await community.setStatusText("Back soon", { emoji: "☕", expiresAt: new Date(Date.now() + 3_600_000) });
await community.setStatusText("Reviewing PRs"); // kept until changed
await community.setStatusText(null); // clears it
```
**Rust:**
```rust
community.set_status_text(Some("Back soon"), Some("☕"), Some(expires_at_ms))?;
community.set_status_text(Some("Reviewing PRs"), None, None)?; // kept until changed
community.set_status_text(None, None, None)?; // clears it
```
When it is set, changed, cleared or expires, everyone else gets a **member update**
(`memberUpdate` / `Event::MemberUpdate`).
## Showing presence
**JavaScript:**
```js
const verbs = { playing: "Playing", streaming: "Streaming", listening: "Listening to",
watching: "Watching", competing: "Competing in" };
const line = (a) => a.type === "custom" ? `${a.emoji ?? ""} ${a.name}`.trim() : `${verbs[a.type]} ${a.name}`;
client.on("presenceUpdate", ({ member, status, activity }) => {
showPresence(member, status, activity ? line(activity) : null);
});
member.presence; // { status: "online" | "idle" | "dnd" | "offline", activity }
member.statusText; // custom status text, or null
member.statusEmoji; // its emoji, or null
community.presences; // every member who is not offline: [{ member, status, activity }]
```
**Rust:**
```rust
use zaun_client::Event;
use zaun_client::presence::Status;
if let Event::PresenceUpdate { community, presence } = event {
let member = community.member(presence.member);
let away = presence.status == Status::Idle;
let line = presence.activity_line(); // "Listening to lofi radio", or the custom text
}
let p = member.presence(); // offline when unknown
let text = member.status_text(); // Option
let emoji = member.status_emoji(); // Option
let online = community.presences(); // every member who is not offline
```
After a community is ready, the client loads who is online and emits `presencesReady`
(`Event::PresencesReady`); from then on each change arrives as `presenceUpdate`
(`Event::PresenceUpdate`). Invisible members look offline, and a member who goes offline leaves
`community.presences`.
A streaming activity's link should open only after the reader confirms. Activities carry no
pictures and no other links, so showing one never makes your app fetch anything.
## Limits
| Item | Limit |
|---|---|
| Activity name | 1–128 characters |
| Activity details, state | 0–128 characters each |
| Custom status text | 1–128 characters, plus an optional emoji |
| Emoji | one Unicode emoji, ≤ 64 bytes |
| Presence changes shown | one every 3 s per member; the latest wins |
---
url: https://zaunchat.github.io/docs/guide/client/events-and-cache/
---
# Events and the cache
> Every event zaun-client emits, in Rust and JavaScript, and what the local cache holds.
## The cache
For each community the client keeps a local copy of its profile, channels, roles and the members
it has seen, kept current from the host's events. Reading it needs no network round trip:
`community.channels()`, `community.roles()`, `community.members()` in Rust; `community.channels`,
`.roles`, `.members` (`Collection`s, maps with `find`/`filter`/`map`) in JavaScript.
The client keeps **no message history**: fetch it from the host when you need it.
## Events
Rust delivers events from `client.events()` (blocking) or `client.next_event(timeout)`; JavaScript
from `client.on(name, handler)`.
| Rust `Event::` | JavaScript event | When |
|---|---|---|
| `Ready(community)` | `ready` | a community is loaded and current |
| `MessageCreate(message)` | `messageCreate` | a message was posted |
| `MessageUpdate { .. }` | `messageUpdate` | a message was edited (partial message) |
| `MessageDelete { .. }` | `messageDelete` | a message was deleted (partial message) |
| `MessageDeleteBulk { .. }` | `messageDeleteBulk` | many messages were deleted (a ban's cleanup) |
| `ReactionAdd` / `ReactionRemove` | `messageReactionAdd` / `messageReactionRemove` | reactions |
| `ChannelCreate` / `ChannelUpdate` / `ChannelDelete` | `channelCreate` / `channelUpdate` / `channelDelete` | channel changes, including access gained or lost |
| `RoleCreate` / `RoleUpdate` / `RoleDelete` | `roleCreate` / `roleUpdate` / `roleDelete` | role changes |
| `MemberAdd` / `MemberUpdate` / `MemberRemove` | `memberAdd` / `memberUpdate` / `memberRemove` | members joining, changing, leaving |
| `PresencesReady(community)` | `presencesReady` | who is online in a community loaded (just after `ready`) |
| `PresenceUpdate { .. }` | `presenceUpdate` | a member's [status or activity](/docs/guide/client/status-and-presence/) changed |
| `VoiceStateUpdate` | `voiceStateUpdate` | someone joined, left or (un)muted in voice |
| `CommunityUpdate` | `communityUpdate` | the community's profile changed |
| `CommunityDelete { .. }` | `communityDelete` | you were kicked, banned or left |
| `CommunityMoving` / `CommunityMoved` / `CommunityMoveRefused` | same names | the owner moved the community to a new host; the client follows |
| `Disconnect` | `disconnect` | the connection to one host dropped |
| `Offline` / `Online` | `offline` / `online` | the network went away or came back |
| `Warning` | `warning` | something odd but recoverable happened |
| — | `change` | the store changed: save it (`client.save()`) |
| — | `raw` | every event as the host sent it |
## Any other command
Objects wrap the common commands. For anything else, `client.command(community, channel, body)`
(Rust) sends any protocol command with a typed body from `zaun_client::protocol::command` and
decodes the answer. JavaScript has `client.raw` for the low-level client.
---
url: https://zaunchat.github.io/docs/guide/bots/why-bots-in-the-host/
---
# Why bots run in the host
> How Zaun bots work, and why they run as sandboxed WebAssembly inside the community's own host.
On most chat platforms, a bot is somebody else's service. You invite it, and from then on your community's
messages are sent to wherever it runs. In Zaun, a bot is a **package** that whoever runs the host
installs, and it runs **inside the host**.
## What that gives you
- **No new reader.** The host already holds the community's channels. A bot inside it sees only what
it was granted, and no third party receives your messages unless you also grant the bot internet
access *and* it chooses to send them out.
- **No extra network hops.** A bot talks to the community in-process. Only members' own messages
cross SimpleX, so bots answer as fast as the host can.
- **A real sandbox.** A bot is WebAssembly with no files, no environment and no sockets. Memory and
CPU time per call are capped, and its internet access is off unless granted, host by host.
- **Transparency.** Every member sees a BOT badge and can open the bot's **card**: its permissions,
whether it can read messages, which internet hosts it may reach, its storage. Every change is
announced to everyone.
- **Only the owner decides.** Only whoever controls the host installs, updates, grants or removes
bots, and the operator's configuration is a ceiling even the owner can't exceed.
## A familiar interaction model
Bots use a familiar interaction model: slash, user and message commands with options and autocomplete; buttons,
selects and Components V2 layouts; modals; ephemeral replies; deferred responses and follow-ups.
If you have written an interactions-based bot before, see
[Porting an existing bot](/docs/guide/bots/porting-a-bot/).
## How it works
1. The host verifies the package's signature and hashes.
2. It creates a **member** for the bot, with a BOT marker, and a **managed role** holding exactly the
granted permission bits.
3. It starts the component in the sandbox and connects it to the community **in-process**.
4. From then on the bot acts through ordinary commands, checked by the same permission engine as a
human member's. There is no bot shortcut.
## External bots
A program using [`zaun-client`](/docs/guide/client/installation/) that joined like any member can also
act as a bot: it's slower (every exchange crosses SimpleX) and not sandboxed by the host, but the
protocol is the same. See [External bots](/docs/guide/bots/external-bots/).
---
url: https://zaunchat.github.io/docs/guide/bots/quickstart/
---
# Bot quick start
> Write, build, pack and install a /ping bot with zbot, in TypeScript (the default) or Rust.
A Zaun bot is a WebAssembly component that runs inside the community's own host. You can write it
in **TypeScript** with `@zaun/bot` or in **Rust** with the `zaun-bot` crate: both build to the same
kind of package and use the same host features. This guide shows TypeScript first; pick the Rust
tab to follow along in Rust. [TypeScript or Rust?](/docs/guide/bots/typescript-or-rust/) compares them.
1. **Install the tools.**
**TypeScript:**
You need Node.js 22 or newer with npm, and `zbot`:
```sh
cargo install --git https://github.com/zaunchat/zaun-bot zbot
```
Or download `zbot` for Linux, macOS or Windows from the
[zaun-bot releases](https://github.com/zaunchat/zaun-bot/releases). esbuild and jco (which
turn your TypeScript into a component) are installed into the project by `npm install`, so
`zbot` never downloads anything itself.
**Rust:**
```sh
rustup target add wasm32-wasip2
cargo install --git https://github.com/zaunchat/zaun-bot zbot
```
Or download `zbot` for Linux, macOS or Windows from the
[zaun-bot releases](https://github.com/zaunchat/zaun-bot/releases).
2. **Create a bot.**
**TypeScript:**
```sh
zbot new ping --lang ts && cd ping
npm install
```
- ping/
- package.json depends on @zaun/bot
- tsconfig.json
- zaun-bot.toml the manifest: what the bot asks for
- src/
- index.ts a /ping bot
**Rust:**
```sh
zbot new ping && cd ping
```
- ping/
- Cargo.toml a cdylib depending on zaun-bot
- zaun-bot.toml the manifest: what the bot asks for
- src/
- lib.rs a /ping bot
3. **Write the bot.**
**TypeScript:**
A bot is a `Bot` object: register commands with `bot.command(builder, handler)`, then export
the functions the host calls, once, at the end of the entry file.
```ts title="src/index.ts"
import { Bot, SlashCommandBuilder } from '@zaun/bot';
const bot = new Bot();
bot.command(
new SlashCommandBuilder().setName('ping').setDescription('Check that the bot is alive'),
(interaction) => {
interaction.reply('pong 🏓');
},
);
export const { init, onEvent, onInteraction, onAutocomplete, onTimer, onVoiceEvent } = bot.exports();
```
**Rust:**
A bot is a type implementing `Bot`, exported once with `export_bot!`. Every handler has a no-op
default; implement the ones you need.
```rust title="src/lib.rs"
use zaun_bot::prelude::*;
#[derive(Default)]
struct Ping;
impl Bot for Ping {
fn commands(&mut self, _: &Config) -> Vec {
vec![SlashCommand::new("ping", "Check that the bot is alive").build()]
}
fn on_command(&mut self, ctx: Context, command: CommandData) {
if command.name == "ping" {
let _ = ctx.reply("pong 🏓");
}
}
}
export_bot!(Ping);
```
4. **Say what it needs** in the manifest. Ask for the least you can: owners see every request in
plain words before they install. The manifest is the same for both languages.
```toml title="zaun-bot.toml"
app_id = "org.example.ping"
version = "0.1.0"
name = "Ping"
description = "Answers /ping with pong."
permissions = ["VIEW_CHANNEL", "SEND_MESSAGES"]
[capabilities]
# nothing beyond interactions: no message content, no network, no storage
```
5. **Build, pack and inspect.**
**TypeScript:**
```sh
zbot build # esbuild src/index.ts → jco componentize → target/bot.wasm
zbot pack --unsigned # org.example.ping-0.1.0.zbot
zbot inspect *.zbot # what it is and what it asks for, in plain words
```
**Rust:**
```sh
zbot build # cargo build --release --target wasm32-wasip2
zbot pack --unsigned # org.example.ping-0.1.0.zbot
zbot inspect *.zbot # what it is and what it asks for, in plain words
```
6. **Install it on a host.** For a development package, the host needs `allow_unsigned = true` in
its `[bots]` configuration.
```sh
zaun-host bot install --community org.example.ping-0.1.0.zbot
```
The command shows what the bot asks for and asks you to confirm. Members now see `/ping` in
their command picker.
> **Caution: Answer within 3 seconds**
>
> Every interaction must be answered within 3 seconds: with a reply, a modal, an update, or a
> deferral followed later by an edit (`interaction.deferReply()` then `interaction.editReply(..)` in
> TypeScript, `ctx.defer(..)` then `ctx.edit_original(..)` in Rust). The host defers for you at
> 2.5 s if a handler is still running, but one handler runs at a time per bot, so slow handlers hold
> up the others.
> **Tip: TypeScript notes**
>
>
> `setTimeout` and `setInterval` never fire between calls: use `bot.timers` and listen to
> `timer`. There is no `fetch`; use `bot.http.fetch(..)`. An autocomplete handler must call
> `interaction.respond(..)` before its first `await`.
## Next
- [Slash commands](/docs/guide/bots/slash-commands/) and [options](/docs/guide/bots/options-and-autocomplete/)
- [Interactions and responses](/docs/guide/bots/interactions/)
- [Events](/docs/guide/bots/events/), [direct messages](/docs/guide/bots/direct-messages/) and [voice](/docs/guide/bots/voice-and-music/)
- More complete [examples](/docs/examples/)
---
url: https://zaunchat.github.io/docs/guide/bots/typescript-or-rust/
---
# TypeScript or Rust?
> Both SDKs build the same kind of bot. How they differ in size, speed and the few TypeScript-specific rules.
`@zaun/bot` (TypeScript) and the `zaun-bot` crate (Rust) are two SDKs for the same thing: a
WebAssembly component the host runs in its sandbox, with the same commands, components, modals,
events, direct messages, voice, storage, timers and HTTP. The manifest, `zbot pack`, signing and
installing are identical. These docs show TypeScript first.
| | TypeScript (`@zaun/bot`) | Rust (`zaun-bot`) |
|---|---|---|
| API style | builder classes and interaction objects (`SlashCommandBuilder`, `interaction.reply`) | a `Bot` trait with handler methods, builders |
| Build | `zbot build`: esbuild bundles `src/index.ts`, jco makes the component | `zbot build`: `cargo build --target wasm32-wasip2` |
| Package size | about **24 MB** (the JavaScript engine is inside) | about **300 KB** |
| First load on a host | about **11 s** to compile, then cached | well under a second |
| A warm call | tens of microseconds (about 22 µs) | under a microsecond (about 0.4 µs) |
| Errors | thrown `ZaunError { code, detail, retryAfterMs }` | `Result<_, HostError>` |
Either is fast enough for chat: a call is a tiny part of what a member waits for. Choose
TypeScript if you know JavaScript, Rust if you want the smallest, fastest package.
## Rules that are specific to TypeScript
- **No `setTimeout` or `setInterval`.** Nothing runs between calls, so they never fire. Use
`bot.timers.after(ms, tag)` or `bot.timers.every(ms, tag)` and listen with `bot.on('timer', …)`.
- **Autocomplete answers synchronously.** Call `interaction.respond(choices)` before the
handler's first `await`: the choices are taken when the handler returns.
- **Async is fine otherwise.** Host calls are synchronous, so awaiting them (or promises that are
already resolved) completes inside the same call.
- **No `fetch`.** Use `bot.http.fetch(url, options)`, which goes only to hosts in the bot's
`network` grant.
- **The entry exports the world.** End `src/index.ts` with
`export const { init, onEvent, onInteraction, onAutocomplete, onTimer, onVoiceEvent } = bot.exports();`
- Builders check the limits (custom ids ≤ 100 bytes, ≤ 5 buttons per row, modal titles ≤ 45, …)
and throw `ZaunValidationError` before anything reaches the host.
## Reference
- [`@zaun/bot` API](/docs/reference/js/zaun-bot/readme/) (generated from the TypeScript source)
- [`zaun-bot` crate](/docs/reference/rust/zaun-bot/) (generated from rustdoc)
- [Bot WIT interface](/docs/reference/wit/), which both SDKs wrap
---
url: https://zaunchat.github.io/docs/guide/bots/slash-commands/
---
# Slash commands
> Register slash, user and message commands, sub-commands and groups, and control who can use them.
Three kinds of application command:
| Kind | `type` | Shown as | TypeScript | Rust |
|---|---|---|---|---|
| Slash command | 1 `CHAT_INPUT` | `/name options…` in the composer | `new SlashCommandBuilder()` | `SlashCommand::new(name, description)` |
| User command | 2 `USER` | Apps → name, on a member | `new ContextMenuCommandBuilder().setType(ApplicationCommandType.User)` | `SlashCommand::user(name)` |
| Message command | 3 `MESSAGE` | Apps → name, on a message | `new ContextMenuCommandBuilder().setType(ApplicationCommandType.Message)` | `SlashCommand::message(name)` |
## Registering
The SDK registers your commands every time the bot starts, as a bulk overwrite: a command keeps
its id as long as its name stays.
**TypeScript:**
Each `bot.command(builder, execute)` registers one command and its handler:
```ts
const bot = new Bot();
bot.command(new SlashCommandBuilder().setName('weather').setDescription("Today's weather"), (interaction) => {
interaction.reply('☀️ 24 °C');
});
bot.command(new ContextMenuCommandBuilder().setName('Show profile').setType(ApplicationCommandType.User), (interaction) => {
if (!interaction.isUserContextMenuCommand()) return;
interaction.reply({ content: `That is ${interaction.targetMember?.displayName}`, ephemeral: true });
});
bot.command(new ContextMenuCommandBuilder().setName('Quote').setType(ApplicationCommandType.Message), (interaction) => {
if (!interaction.isMessageContextMenuCommand()) return;
interaction.reply(`> ${interaction.targetMessage?.content ?? ''}`);
});
```
To change commands while running, call `setCommands([...])` (exported by `@zaun/bot`).
**Rust:**
Return your commands from `Bot::commands`. To change them while running, call
`zaun_bot::commands::set`.
```rust
fn commands(&mut self, _: &Config) -> Vec {
vec![
SlashCommand::new("weather", "Today's weather").build(),
SlashCommand::user("Show profile").build(),
SlashCommand::message("Translate").build(),
]
}
```
## Sub-commands and groups
**TypeScript:**
```ts
bot.command(
new SlashCommandBuilder().setName('remind').setDescription('Reminders')
.addSubcommand((s) => s.setName('add').setDescription('Add a reminder')
.addStringOption((o) => o.setName('what').setDescription('What to remind').setRequired(true))
.addIntegerOption((o) => o.setName('minutes').setDescription('In how many minutes').setRequired(true).setMinValue(1).setMaxValue(1440)))
.addSubcommand((s) => s.setName('list').setDescription('Your reminders')),
(interaction) => {
if (!interaction.isChatInputCommand()) return;
switch (interaction.options.getSubcommand()) {
case 'add': {
const what = interaction.options.getString('what', true);
const minutes = interaction.options.getInteger('minutes', true);
interaction.reply({ content: `I'll remind you of "${what}" in ${minutes} min.`, ephemeral: true });
break;
}
case 'list':
interaction.reply({ content: 'No reminders yet.', ephemeral: true });
break;
}
},
);
```
Groups use `addSubcommandGroup(..)`; read the path with `options.getSubcommandGroup()` and
`options.getSubcommand()`.
**Rust:**
```rust
use zaun_bot::prelude::*;
SlashCommand::new("remind", "Reminders")
.sub_command(
SubCommand::new("add", "Add a reminder")
.option(CommandOptionBuilder::string("what", "What to remind").required())
.option(CommandOptionBuilder::integer("minutes", "In how many minutes").required().range(1.0, 1440.0)),
)
.sub_command(SubCommand::new("list", "Your reminders"))
.build();
```
`on_command` then receives the path in `CommandData.group` and `CommandData.sub_command`:
```rust
fn on_command(&mut self, ctx: Context, cmd: CommandData) {
match (cmd.name.as_str(), cmd.sub_command.as_deref()) {
("remind", Some("add")) => { /* cmd.str("what"), cmd.int("minutes") */ }
("remind", Some("list")) => { /* … */ }
_ => {}
}
}
```
## Who can use a command
- Members need `USE_APPLICATION_COMMANDS` (on `@everyone` by default) and `VIEW_CHANNEL`.
- Default member permissions additionally require those bits in the channel:
`.setDefaultMemberPermissions(PermissionFlagsBits.ManageMessages)` in TypeScript,
`.default_member_permissions(bits)` in Rust. `0` makes a command owner-only.
- Two bots may register the same name; clients show the bot's name beside each command.
- In a [direct message](/docs/guide/bots/direct-messages/), only that bot's own commands work.
## Limits
100 slash, 15 user and 15 message commands per bot; up to 25 options and 25 choices; names 1–32
characters (slash commands: lowercase letters, digits, `-` and `_`); descriptions 1–100; at most
8 000 characters of text per command.
---
url: https://zaunchat.github.io/docs/guide/bots/options-and-autocomplete/
---
# Options and autocomplete
> Command option types, choices, bounds, reading values, and suggesting values as members type.
## Option types
| `type` | Kind | TypeScript builder / reader | Rust value |
|---|---|---|---|
| 3 | string | `addStringOption` / `getString` | `OptionValue::Text` |
| 4 | integer (\|x\| < 2^53) | `addIntegerOption` / `getInteger` | `OptionValue::Integer` |
| 5 | boolean | `addBooleanOption` / `getBoolean` | `OptionValue::Boolean` |
| 6 | user | `addUserOption` / `getUser`, `getMember` | `OptionValue::Id` + `resolved.members` |
| 7 | channel | `addChannelOption` / `getChannel` | `OptionValue::Id` + `resolved.channels` |
| 8 | role | `addRoleOption` / `getRole` | `OptionValue::Id` + `resolved.roles` |
| 9 | mentionable | `addMentionableOption` / `getMentionable` | `OptionValue::Id` + a member or role in `resolved` |
| 10 | number | `addNumberOption` / `getNumber` | `OptionValue::Number` |
| 11 | attachment | `addAttachmentOption` / `getAttachment` | `OptionValue::Id` + `resolved.attachments` |
Types 1 and 2 are sub-commands and groups ([Slash commands](/docs/guide/bots/slash-commands/)).
Per option: required (required options come first), up to 25 choices (string, integer,
number), minimum and maximum values, minimum and maximum lengths (0–6 000), channel types,
autocomplete (not together with choices), and localized names and descriptions.
> **Tip: The host validates for you**
>
> Values are checked **before** the bot sees them: types, choices, bounds and required options. A bot
> never receives an integer out of range or a missing required option.
## Reading values
**TypeScript:**
```ts
const what = interaction.options.getString('what', true); // required: never null
const minutes = interaction.options.getInteger('minutes') ?? 5;
const loud = interaction.options.getBoolean('loud') ?? false;
const who = interaction.options.getUser('who'); // the member, resolved
```
**Rust:**
The `Options` trait reads options by name:
```rust
let what = cmd.str("what").unwrap_or_default();
let minutes = cmd.int("minutes").unwrap_or(5);
let loud = cmd.bool("loud").unwrap_or(false);
```
## Autocomplete
Mark an option as autocomplete, then return suggestions while the member types (at most 25).
During autocomplete the focused option holds what was typed so far, unvalidated.
**TypeScript:**
The third argument of `bot.command` is the autocomplete handler. Call `respond` **before** any
`await`: the choices are taken when the handler returns.
```ts
const bot = new Bot();
const cities = ['Berlin', 'Cairo', 'Lagos', 'Lima'];
bot.command(
new SlashCommandBuilder().setName('weather').setDescription("Today's weather")
.addStringOption((o) => o.setName('city').setDescription('Which city').setRequired(true).setAutocomplete()),
(interaction) => {
if (!interaction.isChatInputCommand()) return;
const city = interaction.options.getString('city', true);
interaction.reply({ embeds: [new EmbedBuilder().setTitle(`Weather in ${city}`).setDescription('☀️ 24 °C')] });
},
(interaction) => {
const typed = interaction.options.getFocused().toLowerCase();
interaction.respond(cities.filter((c) => c.toLowerCase().startsWith(typed)).map((c) => ({ name: c, value: c })));
},
);
export const { init, onEvent, onInteraction, onAutocomplete, onTimer, onVoiceEvent } = bot.exports();
```
**Rust:**
Return the suggestions from `on_autocomplete`; the runtime answers with them.
```rust
use zaun_bot::prelude::*;
use zaun_bot::types::OptionKind;
#[derive(Default)]
struct Weather;
impl Bot for Weather {
fn commands(&mut self, _: &Config) -> Vec {
let city = CommandOptionBuilder::new(OptionKind::String, "city", "Which city")
.required()
.autocomplete();
vec![SlashCommand::new("weather", "Today's weather").option(city).build()]
}
fn on_autocomplete(&mut self, _: Context, cmd: CommandData) -> Vec {
let typed = cmd.str("city").unwrap_or_default().to_lowercase();
["Berlin", "Cairo", "Lagos", "Lima"]
.into_iter()
.filter(|c| c.to_lowercase().starts_with(&typed))
.map(|c| text_choice(c, c))
.collect()
}
fn on_command(&mut self, ctx: Context, cmd: CommandData) {
let city = cmd.str("city").unwrap_or("?");
let _ = ctx.reply(EmbedBuilder::new().title(format!("Weather in {city}")).description("☀️ 24 °C"));
}
}
export_bot!(Weather);
```
---
url: https://zaunchat.github.io/docs/guide/bots/interactions/
---
# Interactions and responses
> Replies, ephemeral replies, deferrals, message updates, follow-ups and modals; the 3-second and 15-minute rules.
An **interaction** is a member using one of the bot's commands, clicking a component on one of its
messages, typing in an autocomplete option, or submitting its modal.
| `type` | Interaction | TypeScript | Rust |
|---|---|---|---|
| 2 | application command | `bot.command(builder, execute)` | `on_command` |
| 3 | message component | `bot.component(customId, handler)` | `on_component` |
| 4 | autocomplete | the third argument of `bot.command`; `interaction.respond(choices)` | `on_autocomplete` (return the choices) |
| 5 | modal submit | `bot.modal(customId, handler)` | `on_modal` |
In TypeScript, `bot.on('interactionCreate', …)` also sees every interaction. A custom id ending
in `:` matches as a prefix (`'vote:'` matches `'vote:yes'`); a `RegExp` or a function works too.
## The first answer: within 3 seconds
| Callback `type` | TypeScript | Rust | Allowed for | Effect |
|---|---|---|---|---|
| 4 | `reply(..)`, `reply({ ephemeral: true, .. })` | `reply`, `reply_ephemeral` | command, component, modal | a message in the channel, or one only the invoker sees |
| 5 | `deferReply({ ephemeral? })` | `defer(ephemeral)` | command, component, modal | "thinking…", finished later with an edit |
| 6 | `deferUpdate()` | `defer_update` | component, modal opened from a component | nothing visible yet |
| 7 | `update(..)` | `update_message` | component, modal opened from a component | replaces the clicked message (it must be the bot's) |
| 8 | `respond(choices)` | return from `on_autocomplete` | autocomplete | up to 25 suggestions |
| 9 | `showModal(modal)` | `show_modal` | command, component | opens a form |
**TypeScript:**
```ts
bot.command(new SlashCommandBuilder().setName('report').setDescription('Build a report'), async (interaction) => {
interaction.deferReply(); // "thinking…"
const result = buildReport(); // slow work
interaction.editReply(result); // replaces the thinking state
});
```
**Rust:**
```rust
fn on_command(&mut self, ctx: Context, cmd: CommandData) {
let _ = ctx.defer(false); // "thinking…"
let result = slow_work(&cmd);
let _ = ctx.edit_original(result); // replaces the thinking state
}
```
## After the first answer: 15 minutes
| TypeScript | Rust | Does |
|---|---|---|
| `followUp(..)` | `followup(..)` | up to 10 more messages (ephemeral or not) |
| `editReply(..)` | `edit_original(..)` | replaces the first answer |
| `deleteReply()` | `delete_original()` | removes it |
If no answer arrives in time, the invoker sees "the bot did not respond". The runtime sends a
deferral by itself at 2.5 s while your handler is still running, so in practice that happens only
when the bot crashes.
## Ephemeral replies
An ephemeral reply (`reply({ content, ephemeral: true })` in TypeScript, `ctx.reply_ephemeral(..)`
in Rust) reaches only the invoker. It is never stored in the channel and disappears with the
interaction (15 minutes). Use it for confirmations, errors and private results.
## What a handler receives
The interaction carries its id, the channel, the invoker (`interaction.member`, and
`interaction.userId` in TypeScript), the bot's effective permissions in the channel, the invoker's
locale when known, and for components the message holding the component. The data:
- **Commands:** name, sub-command path, options (validated), resolved members, channels, roles
and attachments, and the target of user and message commands (`targetMember`, `targetMessage`
in TypeScript; `target_id` in Rust).
- **Components:** `customId` and, for selects, the chosen `values`.
- **Modals:** the modal's `customId` and each input (`interaction.fields.getTextInputValue('subject')`
in TypeScript, `modal.text("subject")` in Rust).
In TypeScript the type guards `isChatInputCommand()`, `isUserContextMenuCommand()`,
`isMessageContextMenuCommand()`, `isButton()`, `isStringSelectMenu()`, `isModalSubmit()` and
`isAutocomplete()` narrow the type.
In TypeScript, a handler that throws is logged and emitted as `error`, and the invoker gets an
ephemeral "Something went wrong."
## Security
Only the bot that received an interaction can answer it: the host checks that the answer comes from
that bot's own connection, so there are no tokens to leak. A click is accepted only if the member can
read the message and the component exists and is enabled; a modal submission only if this member has
that modal open.
---
url: https://zaunchat.github.io/docs/guide/bots/components/
---
# Buttons, selects and layouts
> Message components: buttons, selects, and Components V2 containers, sections and media.
Only bots may send components, and **pictures and files are attachments of the same message, never
URLs**: clients never load anything remote to show a component.
## Buttons and selects (classic layout)
Up to 5 **action rows**; each holds up to 5 buttons or one select.
**TypeScript:**
```ts
interaction.reply({
content: 'Pick one',
components: [
new ActionRowBuilder().addComponents(
new ButtonBuilder().setCustomId('a').setLabel('Option A').setStyle(ButtonStyle.Primary),
new ButtonBuilder().setCustomId('b').setLabel('Option B').setStyle(ButtonStyle.Secondary),
new ButtonBuilder().setURL('https://zaun.example/help').setLabel('Help'),
),
new ActionRowBuilder().addComponents(
new StringSelectMenuBuilder().setCustomId('colour').setPlaceholder('Colour')
.addOptions({ label: 'Red', value: 'red' }, { label: 'Blue', value: 'blue' }),
),
],
});
```
Clicks go to `bot.component(customId, handler)`. Answer with `interaction.update(..)` to change the
message in place, `interaction.reply(..)` for a new message, or `interaction.deferUpdate()`.
```ts
bot.component('a', (interaction) => interaction.update({ content: 'You picked A', components: [] }));
bot.component('colour', (interaction) =>
interaction.reply({ content: `Colour: ${interaction.values.join(', ')}`, ephemeral: true }));
```
**Rust:**
```rust
Reply::new()
.content("Pick one")
.row(ActionRow::buttons([
Button::primary("a", "Option A"),
Button::secondary("b", "Option B"),
Button::link("https://zaun.example/help", "Help"),
]))
.row(ActionRow::select(
Select::strings("colour", &[("Red", "red"), ("Blue", "blue")]).placeholder("Colour"),
));
```
Clicks arrive in `on_component` with the component's `custom_id` (and `values` for selects).
Answer with `ctx.update_message(..)` to change the message in place, `ctx.reply(..)` for a new
message, or `ctx.defer_update()`.
```rust
fn on_component(&mut self, ctx: Context, c: ComponentData) {
match c.custom_id.as_str() {
"a" => { let _ = ctx.update_message(Reply::new().content("You picked A")); }
"colour" => { let _ = ctx.reply_ephemeral(format!("Colour: {}", c.values.join(", "))); }
_ => {}
}
}
```
Link buttons take `https://` only, and readers confirm before they open.
## Components V2
A Components V2 message has no content or embeds: components carry everything. The flag can't be
removed later. In TypeScript, a reply whose components are layout builders (a container, section,
text display, …) is sent as V2; in Rust, `Reply::v2()` or `Reply::container(..)` turns it on.
**TypeScript:**
```ts
import {
ActionRowBuilder, ButtonBuilder, ButtonStyle, ContainerBuilder, SectionBuilder,
SeparatorBuilder, TextDisplayBuilder,
} from '@zaun/bot';
interaction.reply({
components: [
new ContainerBuilder().setAccentColor(0x5865f2)
.addTextDisplayComponents(new TextDisplayBuilder().setContent('## Release 1.2\nEverything new this week.'))
.addSeparatorComponents(new SeparatorBuilder())
.addSectionComponents(new SectionBuilder()
.addTextDisplayComponents(new TextDisplayBuilder().setContent('Read the notes'))
.setButtonAccessory(new ButtonBuilder().setCustomId('notes').setLabel('Open').setStyle(ButtonStyle.Primary)))
.addActionRowComponents(new ActionRowBuilder().addComponents(
new ButtonBuilder().setCustomId('ok').setLabel('Got it').setStyle(ButtonStyle.Success))),
],
});
```
**Rust:**
```rust
Reply::new().container(
Container::new()
.accent(0x5865F2)
.text("## Release 1.2\nEverything new this week.")
.separator()
.section(Section::with_button(&["Read the notes"], Button::primary("notes", "Open")))
.row(ActionRow::buttons([Button::success("ok", "Got it")])),
);
```
## Reference
| `type` | Component | TypeScript builder | Where | Key fields and limits |
|---|---|---|---|---|
| 1 | Action Row | `ActionRowBuilder` | message, container | 1–5 buttons or 1 select |
| 2 | Button | `ButtonBuilder` | action row, section accessory | styles 1 primary, 2 secondary, 3 success, 4 danger, 5 link; label ≤ 80; emoji; custom id for 1–4 |
| 3 | String Select | `StringSelectMenuBuilder` | action row, modal label | ≤ 25 options; placeholder ≤ 150; min/max values 0–25 |
| 4 | Text Input | `TextInputBuilder` | modal label | short or paragraph; length 0–4 000 |
| 5–8 | User / Role / Mentionable / Channel Select | `UserSelectMenuBuilder`, `RoleSelectMenuBuilder`, `MentionableSelectMenuBuilder`, `ChannelSelectMenuBuilder` | action row, modal label | default values; channel types (8) |
| 9 | Section | `SectionBuilder` | V2 message, container | 1–3 text displays + a button or thumbnail |
| 10 | Text Display | `TextDisplayBuilder` | V2 message, container, section, modal | Markdown; ≤ 4 000 characters per message in all |
| 11 | Thumbnail | `ThumbnailBuilder` | section accessory | an image attachment |
| 12 | Media Gallery | `MediaGalleryBuilder` | V2 message, container | 1–10 attachments |
| 13 | File | `FileBuilder` | V2 message, container | one attachment |
| 14 | Separator | `SeparatorBuilder` | V2 message, container | divider; small or large spacing |
| 17 | Container | `ContainerBuilder` | V2 message | children 1, 9, 10, 12, 13, 14; accent colour; spoiler |
| 18 | Label | `LabelBuilder` | modal | label ≤ 45, description ≤ 100, one input |
| 19 | File Upload | `FileUploadBuilder` | modal label | 0–10 files |
| 21 | Radio Group | `RadioGroupBuilder` | modal label | 2–10 options |
| 22 | Checkbox Group | `CheckboxGroupBuilder` | modal label | 1–10 options |
| 23 | Checkbox | `CheckboxBuilder` | modal label | never required |
Totals: classic messages up to 5 action rows; V2 messages up to 40 components counting nested ones.
Custom ids are 1–100 bytes and unique per message or modal. Premium buttons are not supported.
---
url: https://zaunchat.github.io/docs/guide/bots/modals/
---
# Modals
> Open a form from a command or a button, and read what the member submitted.
A modal is a form the client shows over the conversation. Open one in answer to a command or a
component click. A modal has a custom id, a title (≤ 45 characters) and 1–5 top-level items:
**labels**, each wrapping one input (text input, select, radio group, checkbox group, checkbox or
file upload), and text displays.
**TypeScript:**
```ts
import {
LabelBuilder, ModalBuilder, StringSelectMenuBuilder, TextDisplayBuilder, TextInputBuilder,
TextInputStyle,
} from '@zaun/bot';
interaction.showModal(new ModalBuilder().setCustomId('report').setTitle('Report a problem')
.addTextDisplayComponents(new TextDisplayBuilder().setContent('Tell us what happened. Moderators will read it.'))
.addTextInput('Summary', new TextInputBuilder().setCustomId('summary').setStyle(TextInputStyle.Short).setMinLength(5).setMaxLength(80))
.addTextInput('Details', new TextInputBuilder().setCustomId('details').setStyle(TextInputStyle.Paragraph).setRequired(false))
.addLabelComponents(new LabelBuilder().setLabel('Area').setComponent(
new StringSelectMenuBuilder().setCustomId('area').addOptions({ label: 'Chat', value: 'chat' }, { label: 'Voice', value: 'voice' }))));
```
**Rust:**
```rust
let modal = Modal::new("report", "Report a problem")
.text("Tell us what happened. Moderators will read it.")
.input("Summary", TextInput::short("summary").length(5, 80))
.input("Details", TextInput::paragraph("details").required(false))
.select("Area", Select::strings("area", &[("Chat", "chat"), ("Voice", "voice")]));
ctx.show_modal(modal)?;
```
## Reading the submission
**TypeScript:**
```ts
bot.modal('report', (interaction) => {
const summary = interaction.fields.getTextInputValue('summary');
const details = interaction.fields.getTextInputValue('details') || '(none)';
const area = interaction.fields.getStringSelectValues('area')[0];
interaction.reply({ content: `Thanks! We got: ${summary} (${area})`, ephemeral: true });
});
```
Also `getRadioValue`, `getCheckbox`, `getSelectedMembers` and `getUploadedFiles`.
**Rust:**
```rust
fn on_modal(&mut self, ctx: Context, modal: ModalData) {
let summary = modal.text("summary").unwrap_or_default();
let details = modal.text("details").unwrap_or("(none)");
let _ = ctx.reply_ephemeral(format!("Thanks! We got: {summary}"));
}
```
A text input gives its text; a checkbox gives `"true"` or `"false"`; selects, radio and checkbox
groups give their chosen values; a file upload gives attachment ids.
## What the host checks
The host checks every submission against the modal it showed: required inputs present, lengths and
counts in bounds, choices among the options. A modal can be submitted **once**, by the member it was
shown to, within 15 minutes.
## Resulting code
See the [feedback form example](/docs/examples/feedback-modal/).
---
url: https://zaunchat.github.io/docs/guide/bots/embeds/
---
# Embeds
> Rich embed cards in bot messages, their limits, and the rules for pictures and links.
Embeds are rich cards attached to a message:
**TypeScript:**
```ts
interaction.reply({
embeds: [
new EmbedBuilder()
.setTitle('Build #412 passed')
.setURL('https://ci.example.org/412')
.setDescription('All 1 204 tests green.')
.setColor(0x2ecc71)
.addFields(
{ name: 'Duration', value: '6 min', inline: true },
{ name: 'Commit', value: '`995900c`', inline: true },
)
.setFooter({ text: 'CI bot' }),
],
});
```
**Rust:**
```rust
let _ = ctx.reply(
EmbedBuilder::new()
.title("Build #412 passed")
.url("https://ci.example.org/412")
.description("All 1 204 tests green.")
.color(0x2ECC71)
.field("Duration", "6 min", true)
.field("Commit", "`995900c`", true)
.footer("CI bot"),
);
```
| Field | Limit |
|---|---|
| title | ≤ 256 |
| description | ≤ 4 096 |
| fields | ≤ 25; name ≤ 256, value ≤ 1 024 |
| author name / footer text | ≤ 256 / ≤ 2 048 |
| per message | ≤ 10 embeds, ≤ 6 000 characters of text in all |
## Rules
- **Pictures** (image, thumbnail, author and footer icons) are **attachments of the same message**,
never URLs. Upload them first (needs the `attachments` capability): `bot.messages.upload(..)` in
TypeScript, `zaun_bot::messages::upload` in Rust; then `setImage(attachmentId)`.
- **Links** are `https://` only, with no user name or password, and open only when clicked.
- An embed must show something: a title, description, author, footer, picture or field.
- Embeds need the `EMBED_LINKS` permission.
---
url: https://zaunchat.github.io/docs/guide/bots/events/
---
# Events
> Follow what happens in the community: messages, reactions, members, channels, roles, typing, presence and direct messages.
Beyond its own commands and components, a bot can follow what happens in the community. It gets
only what its manifest asks for, some groups need a capability the owner grants, and it only ever
sees events for channels it can view.
## Asking for events
In `zaun-bot.toml`, `events` lists groups, exact event types, or `*` for everything the
capabilities allow:
```toml title="zaun-bot.toml"
events = ["messages", "reactions", "members"] # groups
# events = ["message.created", "member.joined"] # or exact types
# events = ["*"] # everything the capabilities allow
[capabilities]
members = true # needed for the members group
```
| Group | Event types | Needs |
|---|---|---|
| `messages` | `message.created`, `message.updated`, `message.deleted`, `messages.bulk_deleted` | — |
| `reactions` | `reaction.added`, `reaction.removed` | — |
| `members` | `member.joined`, `member.updated`, `member.left`, `member.removed`, `member.roles_updated`, `member.timed_out` | capability `members` |
| `channels` | `channel.created`, `channel.updated`, `channel.deleted`, `channel.reordered` | — |
| `roles` | `role.created`, `role.updated`, `role.deleted`, `role.reordered` | — |
| `typing` | `signal.typing` | — |
| `presence` | `signal.presence` | capability `presence` |
| `community` | `community.updated` | — |
| `commands` | `command.updated` | — |
| `dms` | `dm.created`, `dm.closed` | capability `dms` |
**Message content.** Without the `message_content` capability, other members' messages arrive with
empty content, no embeds and no attachments, except messages that mention the bot, reply to it, or
are in a direct message with it. Every member can see on the bot card whether a bot reads all
messages.
## Handlers
The `ready` event always comes first, once the bot's connection is up, with its own ids and
community. Every handler gets an **event context** to act with.
**TypeScript:**
```ts
const bot = new Bot();
bot.on('ready', (me) => bot.log.info(`up as ${me.memberId}`));
bot.on('messageCreate', (message, ctx) => {
if (ctx.isMe(message.authorId)) return; // never answer yourself
if (message.content.includes('hello')) {
ctx.react(message, '👋');
ctx.reply(message, 'Hello!');
}
if (message.isDM) ctx.send(message.channelId, 'Thanks for writing.');
});
bot.on('memberAdd', (member, ctx) => {
ctx.dm(member.memberId, 'Welcome!'); // capability `dms`
});
export const { init, onEvent, onInteraction, onAutocomplete, onTimer, onVoiceEvent } = bot.exports();
```
`init` runs earlier, when the instance starts; `ready` tells the bot who it is (`bot.me`).
**Rust:**
```rust
use zaun_bot::prelude::*;
#[derive(Default)]
struct Greeter;
impl Bot for Greeter {
fn on_message_create(&mut self, ctx: EventContext, message: Message, is_dm: bool) {
if ctx.is_me(&message.author_id) {
return; // never answer yourself
}
if message.content.contains("hello") {
let _ = ctx.react(&message, "👋");
let _ = ctx.reply_to(&message, "Hello!");
}
if is_dm {
let _ = ctx.send(&message.channel_id, "Thanks for writing.");
}
}
fn on_member_join(&mut self, ctx: EventContext, member: Member) {
let _ = ctx.dm(&member.member_id, "Welcome!"); // capability `dms`
}
}
export_bot!(Greeter);
```
To see events before the typed handlers, override `on_event(ctx, event)`; call
`zaun_bot::dispatch(self, ctx, event)` to keep the typed handlers too.
## Every event
| TypeScript `bot.on(..)` | Rust handler | Group |
|---|---|---|
| `ready` | `on_ready` | always |
| `messageCreate`, `messageUpdate`, `messageDelete`, `messageDeleteBulk` (messages carry `isDM`) | `on_message_create`, `on_message_update`, `on_message_delete`, `on_message_delete_bulk` | `messages` |
| `messageReactionAdd`, `messageReactionRemove` | `on_reaction_add`, `on_reaction_remove` | `reactions` |
| `memberAdd`, `memberUpdate`, `memberRemove` | `on_member_join`, `on_member_update`, `on_member_leave` | `members` |
| `removed` (this bot was kicked or banned) | `on_removed` | `members` |
| `memberRolesUpdate`, `memberTimeout` | `on_member_roles_update`, `on_member_timeout` | `members` |
| `channelCreate`, `channelUpdate`, `channelDelete` | `on_channel_create`, `on_channel_update`, `on_channel_delete` | `channels` |
| `roleCreate`, `roleUpdate`, `roleDelete` | `on_role_create`, `on_role_update`, `on_role_delete` | `roles` |
| `typingStart` | `on_typing_start` | `typing` |
| `presenceUpdate` (`{ memberId, status, activity }`; see [Status and presence](/docs/guide/bots/status-and-presence/#other-members-presence)) | `on_presence_update` | `presence` |
| `communityUpdate` | `on_community_update` | `community` |
| `commandsUpdate` | `on_commands_update` | `commands` |
| `dmCreate`, `dmDelete` | `on_dm_open`, `on_dm_close` | `dms` |
| `raw` (anything without a typed event, such as `channel.reordered`) | `on_raw` | — |
TypeScript also has `interactionCreate`, `timer`, `voiceEvent` (and `trackStart`, `trackEnd`, …;
see [Voice and music](/docs/guide/bots/voice-and-music/)) and `error`.
## The event context
| TypeScript | Rust | Does |
|---|---|---|
| `ctx.send(channelId, reply)` | `ctx.send(channel_id, reply)` | posts a message |
| `ctx.reply(message, reply)` | `ctx.reply_to(&message, reply)` | posts a reply in the message's channel |
| `ctx.react(message, emoji)` | `ctx.react(&message, emoji)` | adds a reaction |
| `ctx.delete(message)` | `ctx.delete_message(&message)` | deletes it (the bot's own, or any with `MANAGE_MESSAGES`) |
| `ctx.dm(memberId, reply)` | `ctx.dm(member_id, reply)` | sends a [direct message](/docs/guide/bots/direct-messages/) |
| `ctx.isMe(memberId)` | `ctx.is_me(member_id)` | whether that is the bot itself |
| `ctx.setPresence(status, activity?)`, `ctx.setStatusText(text)` | `zaun_bot::presence::set(..)`, `presence::set_status_text(..)` | sets the bot's own [status and presence](/docs/guide/bots/status-and-presence/) |
Handlers run one at a time, so keep them short: long work blocks the bot's next events and
interactions. Every call is an ordinary command on the bot's member, checked by the host's
permission engine.
## Typing events and privacy
A channel's typing indicator can be `named`, `anonymous` or `off`
([Typing indicators](/docs/guide/concepts/typing-indicators/)). A bot subscribed to `typing` gets the
same shape a member's app would: names in a named channel, only a count in an anonymous one, and
nothing in a channel where typing is off.
---
url: https://zaunchat.github.io/docs/guide/bots/direct-messages/
---
# Direct messages
> A bot talks privately with one member: what it needs, how to send, what the member controls, and the limits against spam.
A bot can talk to a member privately, in a **direct message** (DM): a channel only the bot and that
member can see. Not the owner, not administrators. The host relays it like any channel, so it is as
private as the rest of the community: it never leaves the host, and no third party gets it.
A DM is always between one bot and one member; members don't DM each other through the host.
## What the bot needs
- The **`dms` capability** in its manifest, granted by the owner. The operator can forbid it for the
whole host with `[bots] allow_dms = false`. Members see "can send direct messages" on the bot
card.
- `events = ["dms"]` (or `*`) to hear DMs opening and closing, and `messages` to hear what members
write in them. A DM to the bot always arrives whole, even without `message_content`.
```toml title="zaun-bot.toml"
events = ["dms", "messages"]
[capabilities]
dms = true
```
## Sending
**TypeScript:**
```ts
// From any event listener:
const { channelId, messageId } = ctx.dm(memberId, 'Hi! Your report was received.');
// From a command, to the person who used it:
bot.messages.dm(interaction.member.memberId, { content: 'Here are your details', embeds: [details] });
interaction.reply({ content: 'Check your direct messages.', ephemeral: true });
// Lower level:
const dm = bot.dms.open(memberId); // the DM channel, opened if needed
bot.dms.listOpen(); // the bot's open DMs
bot.dms.close(dm.channelId);
```
A refusal (the member turned DMs from bots off) throws `ZaunError` with `code: 'FORBIDDEN'` and
`detail: 'dms_closed'`.
**Rust:**
```rust
// From any event handler:
let (channel_id, message_id) = ctx.dm(&member_id, "Hi! Your report was received.")?;
// From a command handler, to the person who used it:
let me = ctx.member.member_id.clone();
ctx.dm(&me, Reply::from("Here are your details").embed(details))?;
ctx.reply_ephemeral("Check your direct messages.")?;
```
The lower-level calls are in `zaun_bot::dms`: `open(member_id)`, `close(channel_id)`,
`list_open()`. A refusal is a `HostError` with code `FORBIDDEN` and reason `dms_closed`.
`dm` opens the DM when there is none, then sends. Replies, reactions, embeds, components and modals
all work in a DM, and so do the bot's own slash commands (only that bot's commands work there).
Message events in a DM are marked (`message.isDM` in TypeScript, `is_dm` in Rust).
## The member decides
- A member can turn **DMs from bots off**, per community. Then a bot can't open a new DM with them:
the call fails with `FORBIDDEN` and reason `dms_closed`. Handle it; it isn't an error in your
bot.
- A member can **close** a DM. Until they open it again (or write in it), the bot can't write into
it (`dms_closed`).
- Members can open a DM with a bot themselves, if the bot has `dms`.
In apps, members do this with [zaun-client](/docs/guide/client/direct-messages/): `member.dm()`,
`channel.closeDm()` and `community.setDmsFromBots(false)`.
## Limits against spam
- A bot opens at most **10 new DMs per minute**.
- Into a DM the member has never written in, a bot writes at most **5 messages per hour**. Once the
member writes (or uses a command or button there), the limit lifts.
- Beyond either: `RATE_LIMITED` with category `dms` and a retry time.
Answers to interactions are never limited this way: the member asked.
## Resulting code
See the [welcome DM example](/docs/examples/welcome-dm/): it greets new members by DM, answers what they
write back, and offers `/dm-me`.
---
url: https://zaunchat.github.io/docs/guide/bots/status-and-presence/
---
# Status and presence
> Set the bot's status, activity and custom status text, at start or from a handler, and follow other members' presence.
Every member sees a bot's presence next to its name, as they see anyone's: a **status** (online,
idle, do not disturb) and an **activity**, what it is doing: "Playing chess", "Listening to lofi
radio", "Watching the queue". A bot can also set a **custom status text**: short text with an
emoji, kept by the host until the bot changes it or it expires.
Setting its own presence and status text needs no capability: it only describes the bot itself.
Receiving other members' presence needs the `presence` capability.
## Setting the status and activity
Set it when the instance starts: presence is not kept across restarts, and a bot starts `online`
without an activity.
**TypeScript:**
```ts
const bot = new Bot();
bot.on('init', () =>
bot.presence.set('online', Activity.listening('lofi radio').setState('ChilledCow')),
);
export const { init, onEvent, onInteraction, onAutocomplete, onTimer, onVoiceEvent } = bot.exports();
```
**Rust:**
```rust
use zaun_bot::prelude::*;
use zaun_bot::presence;
#[derive(Default)]
struct Dj;
impl Bot for Dj {
fn on_start(&mut self, _: &Config) {
presence::set(Status::Online, Activity::listening("lofi radio").state("ChilledCow"));
}
}
export_bot!(Dj);
```
`init` (TypeScript) and `on_start` (Rust) run each time the instance starts, before its commands
register. The [ping example](/docs/examples/ping/) shows "Listening to /ping" this way.
### Statuses
| TypeScript | Rust | Members see |
|---|---|---|
| `'online'` | `Status::Online` | online |
| `'idle'` | `Status::Idle` | idle (away) |
| `'dnd'` | `Status::Dnd` | do not disturb |
| `'invisible'` | `Status::Invisible` | offline, with no activity |
A bot shows as offline when it stops, crashes or is disabled.
### Activities
**TypeScript:**
| Activity | Members see |
|---|---|
| `Activity.playing('chess')` | Playing chess |
| `Activity.streaming('speedrun', 'https://video.example.org/live')` | Streaming speedrun, with a link |
| `Activity.listening('lofi radio')` | Listening to lofi radio |
| `Activity.watching('the queue')` | Watching the queue |
| `Activity.competing('the cup')` | Competing in the cup |
| `Activity.custom('Taking requests').setEmoji('🎵')` | 🎵 Taking requests |
Add a second and third line with `setDetails(..)` and `setState(..)`, and an elapsed time with
`setStartedAt(ms)` (ms since the epoch). Each returns a new `Activity`.
**Rust:**
| Activity | Members see |
|---|---|
| `Activity::playing("chess")` | Playing chess |
| `Activity::streaming("speedrun", "https://video.example.org/live")` | Streaming speedrun, with a link |
| `Activity::listening("lofi radio")` | Listening to lofi radio |
| `Activity::watching("the queue")` | Watching the queue |
| `Activity::competing("the cup")` | Competing in the cup |
| `Activity::custom("Taking requests").emoji("🎵")` | 🎵 Taking requests |
Add a second and third line with `.details(..)` and `.state(..)`, and an elapsed time with
`.started_at(ms)` (ms since the epoch).
A streaming link is `https://` only, and a member's app opens it only after the member confirms.
Activities carry no pictures and no other links, so showing one never makes an app fetch anything.
To clear the activity, set the status alone: `bot.presence.set('online')` in TypeScript,
`presence::set(Status::Online, None)` in Rust.
## Changing it from a handler
A bot can change its presence at any time: when a command runs, when a track starts, on a timer.
**TypeScript:**
```ts
const bot = new Bot();
bot.command(
new SlashCommandBuilder().setName('focus').setDescription('Do not disturb for a while'),
(interaction) => {
bot.presence.set('dnd', Activity.custom('Focusing').setEmoji('🎧'));
interaction.reply('Do not disturb is on.');
},
);
bot.on('trackStart', (title) => bot.presence.set('online', Activity.listening(title ?? 'music')));
bot.on('trackEnd', () => bot.presence.set('online'));
export const { init, onEvent, onInteraction, onAutocomplete, onTimer, onVoiceEvent } = bot.exports();
```
`bot.presence` works everywhere. In an event listener, `ctx.setPresence(status, activity?)` and
`ctx.setStatusText(text)` do the same.
**Rust:**
```rust
use zaun_bot::prelude::*;
#[derive(Default)]
struct Focus;
impl Bot for Focus {
fn commands(&mut self, _: &Config) -> Vec {
vec![SlashCommand::new("focus", "Do not disturb for a while").build()]
}
fn on_command(&mut self, ctx: Context, command: CommandData) {
if command.name == "focus" {
ctx.set_presence(Status::Dnd, Activity::custom("Focusing").emoji("🎧"));
let _ = ctx.reply("Do not disturb is on.");
}
}
}
export_bot!(Focus);
```
`zaun_bot::presence::set` works everywhere, including event handlers. In an interaction handler,
`ctx.set_presence(status, activity)` and `ctx.set_status_text(text)` do the same.
The [music example](/docs/examples/music/) shows "Listening to" the current track while it plays.
**Rate.** The host shows at most one change every 3 seconds. Set it as often as you like: a newer
call replaces one that has not gone out yet, so the latest always wins.
## Custom status text
**TypeScript:**
```ts
bot.presence.setStatusText('Type /play'); // kept until changed
bot.presence.setStatus('Back soon', '☕', until); // text, emoji, and when the host clears it
bot.presence.clearStatus();
```
**Rust:**
```rust
use zaun_bot::presence;
presence::set_status_text("Type /play")?; // kept until changed
presence::set_status(Some("Back soon"), Some("☕"), Some(until))?; // text, emoji, and when the host clears it
presence::clear_status()?;
```
`until` is a time in ms since the epoch; leave it out to keep the status until it changes. Unlike
presence, the host **keeps** a custom status: it survives restarts. These calls go to the host
and return its refusal (TypeScript throws a `ZaunError`; Rust returns a `HostError`), for example
for text that is too long.
## Other members' presence
Ask for the `presence` event group and the `presence` capability:
```toml title="zaun-bot.toml"
events = ["presence"]
[capabilities]
presence = true # receive other members' status and activity
```
**TypeScript:**
```ts
bot.on('presenceUpdate', (p, ctx) => {
// p: { memberId, status, activity? }
if (ctx.isMe(p.memberId)) return;
if (p.activity?.kind === 'listening') {
bot.log.info(`${p.memberId} is listening to ${p.activity.name}`);
}
});
```
**Rust:**
```rust
use zaun_bot::prelude::*;
use zaun_bot::presence::ActivityType;
use zaun_bot::types::Presence;
#[derive(Default)]
struct Watcher;
impl Bot for Watcher {
fn on_presence_update(&mut self, ctx: EventContext, p: Presence) {
if ctx.is_me(&p.member_id) {
return;
}
if let Some(a) = p.activity.filter(|a| a.kind == ActivityType::Listening) {
log_info!("{} is listening to {}", p.member_id, a.name);
}
}
}
export_bot!(Watcher);
```
`status` is `online`, `idle`, `dnd` or `offline`: invisible members arrive as `offline`, with no
activity. The activity has the same fields a bot sets: `kind` (`playing`, `streaming`,
`listening`, `watching`, `competing` or `custom`), `name`, and optionally `details`, `state`,
`url` (streaming), `startedAt` / `started_at` and `emoji` (custom).
Other members' custom status text is not part of what a bot receives.
## Limits
| Item | Limit |
|---|---|
| Activity name | 1–128 characters |
| Activity details, state | 0–128 characters each |
| Streaming link | `https://` only, streaming activities only |
| Activity emoji | one Unicode emoji (≤ 64 bytes), custom activities only |
| Custom status text | 1–128 characters of plain text, plus an optional emoji |
| Presence changes shown | one every 3 s; the latest wins |
An activity outside these limits is not shown.
---
url: https://zaunchat.github.io/docs/guide/bots/voice-and-music/
---
# Voice and music
> A bot joins a voice channel and plays Opus audio from a URL, from bytes it holds, or from packets it makes; queue, controls and events.
A bot with the `voice` capability can join a voice channel and play audio: a music bot, a
soundboard, text-to-speech, an alarm. The **host** joins as the bot and sends the audio in real
time; the bot only says what to play, so it never runs a codec, a network stack or a clock.
**TypeScript:**
```ts
bot.voice.join(channelId); // returns once audio can flow
bot.voice.play({ url: 'https://music.example.org/intro.opus', title: 'Intro' });
bot.voice.enqueue({ url: 'https://music.example.org/song.opus', title: 'Song' });
bot.voice.pause();
bot.voice.resume();
bot.voice.skip();
bot.voice.stop(); // and clear the queue
bot.voice.leave();
```
**Rust:**
```rust
use zaun_bot::Voice;
Voice::join(channel_id)?; // returns once audio can flow
Voice::play_url("https://music.example.org/intro.opus", Some("Intro"))?;
Voice::enqueue_url("https://music.example.org/song.opus", Some("Song"))?;
Voice::pause();
Voice::resume();
Voice::skip();
Voice::stop(); // and clear the queue
Voice::leave();
```
The complete bot is the [music example](/docs/examples/music/): `/join`, `/play`, `/queue`, `/skip`,
`/pause`, `/resume`, `/stop`, `/leave`, and buttons on the now-playing message.
## What the bot needs
```toml title="zaun-bot.toml"
permissions = ["VIEW_CHANNEL", "SEND_MESSAGES", "CONNECT", "SPEAK"]
[capabilities]
voice = true # join voice channels and play audio
network = ["music.example.org"] # where URLs may be fetched from
```
- `voice` is a capability the owner grants, within the operator's ceiling (`[bots] allow_voice`,
on by default). Every member can see it on the bot card.
- `CONNECT` and `SPEAK` apply exactly as for members, per channel. A bot without `SPEAK` (or
server-muted) stays in the channel and its player pauses itself.
- Playing a URL fetches through the bot's `network` grant, with the same checks as
[HTTP](/docs/guide/bots/storage-timers-http/): `https://` only, no private addresses, no redirects.
The server learns the host's network address.
## Audio sources
Nothing is transcoded: audio is **Opus**, the codec every Zaun client plays.
| Source | TypeScript | Rust | Notes |
|---|---|---|---|
| An `https://` Ogg Opus file or stream (`.opus`, or `.ogg` holding Opus) | `play({ url })`, `enqueue({ url })`, or a plain URL string | `Voice::play_url`, `Voice::enqueue_url` | fetched by the host as it plays; ≤ 128 MiB |
| Ogg Opus bytes the bot holds | `play({ ogg: bytes })` | `Voice::play_ogg` | ≤ 16 MiB per call |
| Opus packets the bot makes | `play({ pushed: true })`, `push(packets)`, `endStream()` | `Voice::start_stream`, `Voice::push_opus`, `Voice::end_stream` | 2.5–120 ms per packet, ≤ 1 000 bytes; `BUSY` past 3 s buffered |
To play MP3, FLAC or anything else, convert it to Opus once, before publishing it:
```sh
ffmpeg -i song.flac -c:a libopus -b:a 128k -vbr on -frame_duration 20 song.opus
```
A bot that synthesises audio (text to speech, tones) encodes Opus itself and pushes packets. A push
returns how many milliseconds are buffered; past 3 s it fails with `BUSY`, so push again on the
next [timer](/docs/guide/bots/storage-timers-http/).
## Queue and state
Playing replaces the current track; enqueueing adds to the queue (≤ 100 tracks). The state
(`bot.voice.state()` in TypeScript, `Voice::state()` in Rust) answers the channel, the player's
status (idle, playing, paused, or auto-paused while nobody can hear), the current title and the
queued titles.
## Events
**TypeScript:**
```ts
bot.on('trackStart', (title) => bot.log.info(`now playing ${title ?? 'a track'}`));
bot.on('trackEnd', (title) => bot.log.info(`finished ${title ?? 'a track'}`));
bot.on('trackError', (text) => bot.log.warn(text));
bot.on('voiceEnd', (reason) => bot.log.info('left voice', reason));
```
`voiceEvent` sees every one; also `voiceMemberJoin` and `voiceMemberLeave`. Every TypeScript bot's
entry exports `onVoiceEvent` for this.
**Rust:**
Implement `Bot::on_voice_event`; the event is one of `TrackStart(title)`, `TrackEnd(title)`,
`TrackError(text)`, `MemberJoined(id)`, `MemberLeft(id)` or `Ended(reason)`.
| Event | When |
|---|---|
| track start / track end | a track starts; it played out, was skipped, stopped, or failed |
| track error | a track could not be fetched or read (the text names no URL) |
| member joined / member left | someone joined or left the bot's channel |
| ended | the bot's stay ended: it left, was moved or disconnected by a moderator, or the host or relay went away |
## How it works
The host runs a voice participant for the bot, the same code a member's app runs: it publishes the
bot's post-quantum key package (signed with the bot member's key), shares a fresh media key with
each listener on every join and leave, and sends each Opus packet end-to-end encrypted through
WebRTC and the host's relay. Listeners' apps need nothing new: to them the bot is a member
speaking. Incoming audio is never decrypted: a bot joins deafened.
## Not yet
- **Volume** and formats other than Opus: both need an Opus encoder in the host.
- **Listening** (speech recognition, recording): a bot joins deafened.
---
url: https://zaunchat.github.io/docs/guide/bots/storage-timers-http/
---
# Storage, timers and HTTP
> A bot's private key-value storage, timers, and HTTPS requests to granted hosts.
These are host services. Each needs a capability in the [manifest](/docs/guide/bots/manifest-and-grants/)
that the owner granted; without it the call fails with `NOT_GRANTED`.
## Storage (`storage_bytes`)
A private key-value store per bot, kept on the host in its own database (never the community's) and
limited to the granted bytes.
**TypeScript:**
```ts
bot.storage.setJSON('counter', 42);
const n = bot.storage.getJSON('counter'); // number | null
const keys = bot.storage.keys('user:', { limit: 100 });
bot.storage.delete('counter');
```
**Rust:**
```rust
use zaun_bot::storage;
storage::set("counter", &42u32.to_be_bytes())?;
let bytes = storage::get("counter")?; // Option>
let keys = storage::list_keys("user:", None, 100)?;
storage::delete("counter")?;
```
`QUOTA_EXCEEDED` means the grant is used up. Data survives restarts and updates, moves with the
community's export, and is deleted when the bot is removed.
## Timers (`timers`)
**TypeScript:**
```ts
const id = bot.timers.after(60_000, 'reminder:42'); // once, in 60 s
const tick = bot.timers.every(3_600_000, 'hourly'); // repeating, at least every second
bot.timers.cancel(id);
bot.on('timer', ({ id, tag }) => bot.log.info('timer', id, tag));
```
`setTimeout` and `setInterval` never fire in a bot: nothing runs between calls. Use these timers.
**Rust:**
```rust
use zaun_bot::timers;
let id = timers::after(60_000, "reminder:42")?; // once, in 60 s
let tick = timers::every(3_600_000, "hourly")?; // repeating, at least every second
timers::cancel(id);
```
`Bot::on_timer(id, tag)` runs when one fires.
Timers don't survive a restart: store what matters and arm timers again when the bot starts (in
`init`/`ready` in TypeScript, in `commands()` in Rust).
## HTTP (`network`)
**TypeScript:**
```ts
const res = bot.http.fetch('https://api.open-meteo.com/v1/forecast?latitude=30&longitude=31', { timeoutMs: 5_000 });
const forecast = res.json<{ current?: unknown }>(); // HttpError (kind 'not-granted', …) when refused
```
There is no global `fetch` in a bot; this is the only way out.
**Rust:**
```rust
use zaun_bot::http::{fetch, Request};
let res = fetch(&Request {
method: "GET".into(),
url: "https://api.open-meteo.com/v1/forecast?latitude=30&longitude=31".into(),
headers: vec![],
body: None,
timeout_ms: Some(5_000),
})?;
```
- Only `https://` URLs, to hosts in both the bot's grant and the operator's ceiling.
- The host resolves the name and **refuses loopback, private, link-local and reserved addresses**, so
a bot can't reach the host's own network.
- Requests leave from the host: **the remote server learns the host's IP address**, never a
member's. Owners see the list of hosts on the bot card before granting it.
- Responses are limited in size (4 MiB) and time.
- Bots have no sockets: this is the only way out.
> **Note: State can vanish**
>
> A bot instance may restart at any time (an update, a crash, a host restart). Keep anything that must
> survive in storage, not in variables or struct fields.
---
url: https://zaunchat.github.io/docs/guide/bots/manifest-and-grants/
---
# Manifest, grants and the bot card
> What a bot asks for in zaun-bot.toml, how grants are decided, and what every member can see.
## The manifest
`zbot pack` turns `zaun-bot.toml` into the manifest inside the package. Unknown keys are refused,
so a typo can't silently drop a request. The manifest is the same whether the bot is written in
TypeScript or Rust.
```toml title="zaun-bot.toml"
app_id = "org.example.weather" # lowercase reverse-DNS; one install per community
version = "1.2.0" # updates must increase it
name = "Weather" # the bot member's display name, 1-32
description = "Forecasts on demand."
permissions = ["VIEW_CHANNEL", "SEND_MESSAGES", "EMBED_LINKS"]
events = ["messages"] # event groups or types to receive (default: only interactions)
update_url = "https://example.org/weather/" # optional
[capabilities]
message_content = false # read every message (privileged; shown to all members)
members = false # list members
presence = false # receive other members' status and activity
dms = false # direct messages with members
voice = false # join voice channels and play audio
timers = true
attachments = false # upload files
storage_bytes = 1048576 # private storage (≤ 1 GiB)
network = ["api.open-meteo.com"] # HTTPS hosts; "*.example.org" allowed as a leading label
[limits] # requests; the host may lower them
memory_bytes = 33554432
cpu_ms = 200
```
Answering an interaction doesn't need `SEND_MESSAGES`; posting on its own does.
Ask for the least you need: owners see the request in plain words, and a request for
`ADMINISTRATOR` or `message_content` is a good reason to refuse a bot.
## How grants are decided
What a bot may do is the **intersection** of what its manifest asks for, what the installer chose to
grant, and the operator's ceiling (`[bots]` in the host's configuration). Permission bits are
granted through a **managed role** that only the bot holds; its bits change only by a new grant.
| Capability | Meaning |
|---|---|
| `message_content` | receive the text of messages that don't mention it (privileged) |
| `members` | list and fetch members beyond those it sees in events |
| `presence` | receive other members' status and activity (`presenceUpdate`); setting the bot's [own presence](/docs/guide/bots/status-and-presence/) needs nothing |
| `dms` | open [direct messages](/docs/guide/bots/direct-messages/) with members (the operator may forbid it host-wide: `[bots] allow_dms`) |
| `voice` | join voice channels and [play audio](/docs/guide/bots/voice-and-music/) (`[bots] allow_voice`); `CONNECT` and `SPEAK` still apply per channel |
| `timers` | schedule timers |
| `attachments` | upload files for its messages |
| `storage_bytes` | the size of its private key-value store |
| `network` | the internet hosts it may contact over HTTPS |
Without `message_content`, the host blanks the content, embeds and attachments of messages delivered
to the bot, except messages that mention it, reply to it, that it wrote, or that are in a direct
message with it. Interactions always arrive whole.
`events` takes the groups `messages`, `reactions`, `members` (needs `members`), `channels`,
`roles`, `typing`, `presence` (needs `presence`), `community`, `commands` and `dms` (needs `dms`),
exact event types, or `*`. Unknown names are refused at install. See [Events](/docs/guide/bots/events/).
## The bot card
Every member can open any bot's **card**: name, publisher, version, signed or not, state, its
permissions, whether it can read message content, the hosts it may contact, its storage and its
events. Every install, update, grant change, disable and removal is announced to every member and
written to the audit log.
## Lifecycle
| State | Meaning |
|---|---|
| `enabled` | running |
| `disabled` | stopped by the owner; its commands are hidden |
| `pending_approval` | an update asks for more than the current grants; the old version keeps running |
| `crashed` | crashed 5 times in 10 minutes; off until the owner enables it again |
---
url: https://zaunchat.github.io/docs/guide/bots/packaging-and-updates/
---
# Packaging, signing and updates
> The .zbot package format, publisher signatures, and how hosts accept updates.
## The `.zbot` package
`zbot pack` writes one file:
```
"ZBOT" ‖ 0x01 ‖ header ‖ signature ‖ manifest JSON ‖ component
```
Each variable part is length-prefixed (`u32`, big-endian). The **header** names the package and
binds everything else to it:
| # | Field | Content |
|---|---|---|
| 1 | format | `0x01` |
| 2 | package_format | `zaun-bot/v1` |
| 3 | app_id | from the manifest |
| 4 | version | from the manifest |
| 5 | publisher_key | the publisher's composite ML-DSA-65 + Ed25519 public key (1 985 bytes) |
| 6 | world | `zaun:bot/bot@0.1.0` |
| 7 | manifest_sha3 | SHA3-256 of the manifest |
| 8 | component_sha3 | SHA3-256 of the WebAssembly component |
| 9 | created_at | milliseconds since the epoch |
The signature (3 374 bytes) is the publisher key's composite signature over the header. A host
verifies it and both hashes before reading the manifest or compiling anything. Limits: header ≤ 4 KiB,
manifest ≤ 64 KiB, component ≤ 64 MiB (a TypeScript bot is about 24 MB, a Rust one a few hundred KB).
## Signing
Publisher keys use the same post-quantum composite scheme as every other Zaun key, so a package
signature stays trustworthy against a future quantum attacker.
> **Caution: Planned**
>
> `zbot keygen` and `zbot sign` are not built yet. Today, `zbot pack --unsigned` writes a development
> package with a zero signature and a zero publisher key. Hosts load it only with
> `allow_unsigned = true`, and its bot card says "unsigned".
## Updates
- The host **pins the publisher key** at install. An update must be signed by the same key and carry
a higher version; anything else is refused.
- An update that asks for nothing beyond the current grants replaces the running version.
- One that asks for more waits as **pending** until the owner grants the new request; the old version
keeps running. The previous version is kept for rollback.
Keep your publisher key offline and backed up: losing it means communities must reinstall a bot
signed with a new key.
---
url: https://zaunchat.github.io/docs/guide/bots/installing/
---
# Installing bots on a host
> Install, review, grant, update, disable and remove bots with zaun-host bot, or from a client as the owner.
Only whoever controls the host installs, updates, grants, enables, disables or removes a bot:
- the **operator**, with `zaun-host bot …` on the host's machine;
- the **community owner**, from their app (when the host allows `allow_remote_install`).
No permission bit delegates this, not even `ADMINISTRATOR`.
## From the command line
These commands talk to the running host through its local control socket
(`/control.sock`, readable only by the host's user).
```sh
zaun-host bot install --community weather-1.2.0.zbot
```
`install` prints what the bot asks for in plain words (each permission, "can read every message",
each internet host, storage) and asks you to confirm, unless you pass `--yes`. To grant less than it
asks for:
```sh
zaun-host bot install --community --grant VIEW_CHANNEL,SEND_MESSAGES,timers,storage:1 weather.zbot
```
Capabilities by name: `message_content`, `members`, `presence`, `timers`, `attachments`,
`storage:`, `network:`.
Then:
```sh
zaun-host bot list --community
zaun-host bot info --community
zaun-host bot update --community weather-1.3.0.zbot
zaun-host bot grant --community --capabilities timers,storage:4
zaun-host bot disable --community
zaun-host bot enable --community
zaun-host bot remove --community
```
## The operator's ceiling
The host's `[bots]` configuration caps every grant on that host. For example, with
`allow_network = false` no owner can give any bot internet access. See
[Configuring a host](/docs/guide/host/configuration/#bots).
## What members see
Installing announces the bot to every member, gives it a BOT badge, and makes its card readable by
anyone. Updates that ask for more stay pending until the owner approves them.
---
url: https://zaunchat.github.io/docs/guide/bots/external-bots/
---
# External bots with zaun-client
> A bot that runs outside the host and joins like a member, using zaun-client in Rust or JavaScript.
Not every bot has to run inside the host. A program using [`zaun-client`](/docs/guide/client/installation/)
joins a community with an invite like any member and acts through the same API as an app: read
messages, reply, react, moderate, play audio in voice.
Compared with a hosted bot:
| | Hosted bot (zaun-bot) | External bot (zaun-client) |
|---|---|---|
| Runs | inside the host, as WebAssembly | anywhere: your machine, a server |
| Latency | in-process | every exchange crosses SimpleX |
| Sandbox | enforced by the host | none: it's your program |
| Installs | by the owner or operator | joins with an invite |
| Reads messages | only with `message_content` | whatever its roles let it see |
| Slash commands, components, modals | yes | yes: `setCommands`, the `interactionCreate` event and its `Interaction` |
| Direct messages | with `dms` | yes: `member.send(..)` |
| Voice | yes (`voice`, played by the host) | yes (`AudioPlayer`) |
## A text-command bot
**JavaScript:**
```js
const client = await Client.start({ name: "Ping bot", key: process.env.ZAUN_KEY });
client.on("messageCreate", async (message) => {
if (!message.mine && message.content === "!ping") await message.reply("pong");
});
```
**Rust:**
```rust
use zaun_client::{Client, Event};
let client = Client::builder("./bot").name("Ping bot").key(std::env::var("ZAUN_BOT_KEY")?).start()?;
for event in client.events() {
if let Event::MessageCreate(message) = event {
if !message.is_mine() && message.content() == "!ping" {
message.reply("pong")?;
}
}
}
```
The owner marks such a member as a bot (`registerBot`, or Settings → Bots in the app), so it gets a
BOT badge and a card like a hosted one. Once marked, it can register slash commands and answer
interactions.
## Slash commands, buttons and modals
**JavaScript:**
```js
client.on("appsReady", async (community) => {
await community.setCommands([
new CommandBuilder().setName("ping").setDescription("Check the bot is alive"),
]);
});
client.on("interactionCreate", async (interaction) => {
if (interaction.commandName === "ping") {
await interaction.reply({
content: "pong",
components: [new ActionRowBuilder().addComponents(
new ButtonBuilder().setCustomId("again").setLabel("Ping again").setStyle(ButtonStyle.Primary))],
});
} else if (interaction.customId === "again") {
await interaction.update({ content: "pong, again" });
}
});
```
**Rust:**
```rust
use zaun_client::protocol::command::object::InteractionType;
use zaun_client::ui::{ActionRow, Button, CommandBuilder};
use zaun_client::{Event, Response};
for event in client.events() {
match event {
Event::AppsReady(community) => {
community.set_commands(vec![CommandBuilder::slash("ping", "Check the bot is alive").build()])?;
}
Event::InteractionCreate(i) => match (i.kind(), i.command_name(), i.custom_id()) {
(InteractionType::ApplicationCommand, Some("ping"), _) => { i.reply("pong")?; }
(InteractionType::MessageComponent, _, Some("again")) => { /* i.respond(Response::update(..)) */ }
_ => {}
},
_ => {}
}
}
```
The complete Rust program is `zaun/examples/slash_bot.rs` in zaun-client; a JavaScript bot that
greets members by DM is `zaun/examples/dm_bot.mjs`.
## Resulting code
The complete program is in [Examples → Ping bot with zaun-client](/docs/examples/client-ping-bot/).
---
url: https://zaunchat.github.io/docs/guide/bots/porting-a-bot/
---
# Porting an existing bot
> Moving a bot from another chat platform's interactions API to Zaun; what maps directly and what differs.
Zaun's interaction model uses the same shapes most chat platforms' bot APIs have converged on:
application commands with typed options, components, modals, deferred responses and follow-ups.
If you have written an interactions-based bot before, the concepts carry over. What changes is
where the bot runs.
## What maps directly
| Concept | In Zaun |
|---|---|
| Registering commands | TypeScript: `bot.command(builder, handler)`, or `setCommands`; Rust: return them from `Bot::commands`, or call `commands::set` |
| Command, user and message commands | TypeScript: `SlashCommandBuilder`, `ContextMenuCommandBuilder`; Rust: `SlashCommand::new`, `::user`, `::message` |
| Option types 1–11, choices, bounds, autocomplete | the same numbers and rules |
| Interaction types 2–5, callback types 4–9 | the same numbers |
| Components (types 1–14, 17–19, 21–23), button styles 1–5 | the same numbers |
| Message flags: suppress embeds 4, ephemeral 64, silent 4096, components V2 32768 | the same values |
| Limits: 25 options, 5 buttons per row, 40 V2 components, 3 s, 15 min | the same |
## Coming from a JavaScript bot library
`@zaun/bot` deliberately uses the names most JavaScript bot libraries share, so most code moves over
by changing imports and the entry point:
| You may know | In `@zaun/bot` |
|---|---|
| a client object you log in with a token | `const bot = new Bot()`; no token, no login: the host runs the bot |
| registering commands through a REST call | `bot.command(new SlashCommandBuilder()…, execute)`; registered at every start |
| an `interactionCreate` listener with `if (interaction.isChatInputCommand())` | the same listener and type guards, or per-command handlers in `bot.command` |
| `interaction.reply`, `deferReply`, `editReply`, `followUp`, `showModal`, `update`, `deferUpdate` | the same methods |
| `interaction.options.getString(..)`, `getSubcommand()`, `getFocused()` | the same |
| `interaction.fields.getTextInputValue(..)` | the same |
| `SlashCommandBuilder`, `EmbedBuilder`, `ButtonBuilder`, `ActionRowBuilder`, `StringSelectMenuBuilder`, `ModalBuilder`, `TextInputBuilder`, `ContainerBuilder`, … | the same names |
| `messageCreate`, `messageReactionAdd` and member-join events | `bot.on('messageCreate' \| 'messageReactionAdd' \| 'memberAdd', (payload, ctx) => …)`; ask for them in the manifest's `events` |
| `user.send(..)` for a direct message | `ctx.dm(memberId, ..)` or `bot.messages.dm(memberId, ..)` (capability `dms`) |
| setting the bot's presence or activity ("Listening to …") | `bot.presence.set('online', Activity.listening(..))`; custom status text with `bot.presence.setStatusText(..)` ([Status and presence](/docs/guide/bots/status-and-presence/)) |
| a voice library and an audio player | `bot.voice.join`, `play`, `enqueue`, … (capability `voice`; the host plays Opus) |
| your own database, `fetch`, `setTimeout` | `bot.storage`, `bot.http.fetch` (granted hosts only), `bot.timers` |
| `client.login(..)` at the end of the file | `export const { init, onEvent, onInteraction, onAutocomplete, onTimer, onVoiceEvent } = bot.exports();` |
## What differs
- **There's no hosting to run.** The bot is a `.zbot` package the community's owner installs, and it
runs inside their host.
- **No tokens.** The bot's own connection is the credential; only that bot can answer its
interactions, so there's nothing to leak.
- **Events are opt-in.** List the event groups or types you want in the manifest; reading message
content is a capability every member can see.
- **Ids** are Zaun ids (base64url, 16 bytes), not integers.
- **Mentions are explicit.** Messages name their mentions; nothing is parsed from text.
- **Pictures are attachments, never URLs**, in embeds and components alike. Link buttons take
`https://` only and open after the reader confirms.
- **Your own database and HTTP client** become storage (granted bytes) and HTTP fetch (granted
hosts only); `setTimeout`/cron become timers. In TypeScript, `setTimeout` never fires.
- **One handler at a time** per bot instance, and state in fields may vanish on restart.
- **Not available:** premium buttons, entitlements, pictures on activities, polls, stickers, custom emoji in
components (Unicode only), webhooks.
---
url: https://zaunchat.github.io/docs/examples/
---
# Examples
> Complete, working bots and programs with explanations, in TypeScript and Rust.
## Hosted bots (zaun-bot: TypeScript and Rust)
Every hosted-bot example is shown in TypeScript (`@zaun/bot`) and Rust (`zaun-bot`), doing exactly
the same thing.
- [Ping](/docs/examples/ping/): One slash command, one reply.
- [Poll with buttons](/docs/examples/poll-buttons/): Buttons that update a message in place.
- [Feedback form](/docs/examples/feedback-modal/): A modal, an ephemeral thanks, and a follow-up.
- [Welcome DM](/docs/examples/welcome-dm/): Member events and direct messages.
- [Music in voice](/docs/examples/music/): Voice channels, a queue and control buttons.
## With zaun-client (JavaScript and Rust)
- [Ping bot](/docs/examples/client-ping-bot/): An external bot answering text commands.
---
url: https://zaunchat.github.io/docs/examples/ping/
---
# Ping (hosted bot)
> The smallest hosted bot: /ping answers pong.
The smallest bot there is: one slash command, one reply. It asks only for `VIEW_CHANNEL` and `SEND_MESSAGES`, with no message content, no network and no storage.
Source in zaun-bot: [`examples/ts/ping`](https://github.com/zaunchat/zaun-bot/tree/main/examples/ts/ping) (TypeScript) and [`examples/rust/ping`](https://github.com/zaunchat/zaun-bot/tree/main/examples/rust/ping) (Rust).
## The code
**TypeScript:**
```ts title="src/index.ts"
// `/ping` → "pong", in TypeScript. Shows "Listening to /ping" as its activity.
const bot = new Bot();
bot.on('init', () => bot.presence.set('online', Activity.listening('/ping')));
bot.command(
new SlashCommandBuilder().setName('ping').setDescription('Check that the bot is alive'),
(interaction) => {
interaction.reply('pong 🏓');
},
);
export const { init, onEvent, onInteraction, onAutocomplete, onTimer, onVoiceEvent } = bot.exports();
```
**Rust:**
```rust title="src/lib.rs"
//! `/ping` → "pong", with the round trip the bot saw. Shows "Listening to /ping" as its
//! activity.
use zaun_bot::prelude::*;
use zaun_bot::presence;
#[derive(Default)]
struct Ping;
impl Bot for Ping {
fn on_start(&mut self, _: &Config) {
presence::set(Status::Online, Activity::listening("/ping"));
}
fn commands(&mut self, _: &Config) -> Vec {
vec![SlashCommand::new("ping", "Check that the bot is alive").build()]
}
fn on_command(&mut self, ctx: Context, command: CommandData) {
if command.name == "ping"
&& let Err(e) = ctx.reply("pong 🏓")
{
log_info!("reply refused: {}", e.code);
}
}
}
export_bot!(Ping);
```
## The manifest
**TypeScript:**
```toml title="zaun-bot.toml"
app_id = "org.zaun.examples.ts-ping"
version = "0.1.0"
name = "Ping"
description = "Answers /ping with pong."
permissions = ["VIEW_CHANNEL", "SEND_MESSAGES"]
[capabilities]
# Nothing beyond interactions: no message content, no network, no storage.
```
**Rust:**
```toml title="zaun-bot.toml"
app_id = "org.zaun.examples.ping"
version = "0.1.0"
name = "Ping"
description = "Answers /ping with pong."
permissions = ["VIEW_CHANNEL", "SEND_MESSAGES"]
[capabilities]
# Nothing beyond interactions: no message content, no network, no storage.
```
## How it works
- The command is registered every time the bot starts (`bot.command(..)` in TypeScript, `Bot::commands` in Rust).
- When the instance starts, it sets its activity: members see "Listening to /ping" next to it ([Status and presence](/docs/guide/bots/status-and-presence/)). Setting its own status needs no capability.
- The handler answers with a reply. A refused reply (for example, the bot lost `SEND_MESSAGES` in that channel) is logged (TypeScript: the `error` event and the host log; Rust: `log_info!`).
## Run it
**TypeScript:**
```sh
git clone https://github.com/zaunchat/zaun-bot && cd zaun-bot/examples/ts/ping
npm install
zbot build && zbot pack --unsigned
zaun-host bot install --community *.zbot # on a host with allow_unsigned = true
```
**Rust:**
```sh
git clone https://github.com/zaunchat/zaun-bot && cd zaun-bot/examples/rust/ping
zbot build && zbot pack --unsigned
zaun-host bot install --community *.zbot # on a host with allow_unsigned = true
```
---
url: https://zaunchat.github.io/docs/examples/poll-buttons/
---
# Poll with buttons
> A yes/no poll whose buttons update the vote counts in place.
`/poll ` posts a yes/no poll as an embed with two buttons. Clicking a button updates the counts on the same message.
Source in zaun-bot: [`examples/ts/poll-buttons`](https://github.com/zaunchat/zaun-bot/tree/main/examples/ts/poll-buttons) (TypeScript) and [`examples/rust/poll-buttons`](https://github.com/zaunchat/zaun-bot/tree/main/examples/rust/poll-buttons) (Rust).
## The code
**TypeScript:**
```ts title="src/index.ts"
// `/poll question` posts a yes/no poll; buttons update the counts in place.
// Votes live in the instance (lost on restart); a real bot would use `bot.storage`.
const bot = new Bot();
/** Voters per question. */
const votes = new Map; no: Set }>();
function render(question: string) {
const v = votes.get(question) ?? { yes: new Set(), no: new Set() };
return {
embeds: [new EmbedBuilder().setTitle(question).addFields(
{ name: 'Yes', value: String(v.yes.size), inline: true },
{ name: 'No', value: String(v.no.size), inline: true },
)],
components: [new ActionRowBuilder().addComponents(
new ButtonBuilder().setCustomId(`yes:${question}`).setLabel('Yes').setEmoji('👍').setStyle(ButtonStyle.Success),
new ButtonBuilder().setCustomId(`no:${question}`).setLabel('No').setEmoji('👎').setStyle(ButtonStyle.Danger),
)],
};
}
bot.command(
new SlashCommandBuilder().setName('poll').setDescription('Start a yes/no poll')
.addStringOption((o) => o.setName('question').setDescription('What to ask').setRequired(true).setMinLength(1).setMaxLength(80)),
(interaction) => {
if (!interaction.isChatInputCommand()) return;
const question = interaction.options.getString('question', true);
votes.set(question, { yes: new Set(), no: new Set() });
interaction.reply(render(question));
},
);
bot.component((id) => id.startsWith('yes:') || id.startsWith('no:'), (interaction) => {
const [choice, ...rest] = interaction.customId.split(':');
const question = rest.join(':');
const v = votes.get(question) ?? { yes: new Set(), no: new Set() };
v.yes.delete(interaction.userId);
v.no.delete(interaction.userId);
(choice === 'yes' ? v.yes : v.no).add(interaction.userId);
votes.set(question, v);
interaction.update(render(question));
});
export const { init, onEvent, onInteraction, onAutocomplete, onTimer, onVoiceEvent } = bot.exports();
```
**Rust:**
```rust title="src/lib.rs"
//! `/poll question` posts a yes/no poll; buttons update the counts in place.
//!
//! Votes live in the instance (lost on restart); a real bot would use `zaun_bot::storage`.
use std::collections::HashMap;
use zaun_bot::prelude::*;
use zaun_bot::types::OptionKind;
#[derive(Default)]
struct Poll {
/// Keyed by the poll's question: `(yes, no)` voters.
votes: HashMap, Vec)>,
}
fn render(question: &str, yes: usize, no: usize) -> Reply {
Reply::new()
.embed(
EmbedBuilder::new()
.title(question)
.field("Yes", yes.to_string(), true)
.field("No", no.to_string(), true),
)
.row(ActionRow::buttons([
Button::success(format!("yes:{question}"), "Yes").emoji("👍"),
Button::danger(format!("no:{question}"), "No").emoji("👎"),
]))
}
impl Bot for Poll {
fn commands(&mut self, _: &Config) -> Vec {
let question = CommandOptionBuilder::new(OptionKind::String, "question", "What to ask")
.required()
.length(1, 80);
vec![
SlashCommand::new("poll", "Start a yes/no poll")
.option(question)
.build(),
]
}
fn on_command(&mut self, ctx: Context, command: CommandData) {
let Some(question) = command.str("question") else {
return;
};
self.votes.entry(question.to_owned()).or_default();
let _ = ctx.reply(render(question, 0, 0));
}
fn on_component(&mut self, ctx: Context, component: ComponentData) {
let Some((choice, question)) = component.custom_id.split_once(':') else {
return;
};
let (yes, no) = self.votes.entry(question.to_owned()).or_default();
let voter = ctx.member.member_id.clone();
yes.retain(|m| *m != voter);
no.retain(|m| *m != voter);
if choice == "yes" {
yes.push(voter)
} else {
no.push(voter)
}
let (y, n) = (yes.len(), no.len());
let _ = ctx.update_message(render(question, y, n));
}
}
export_bot!(Poll);
```
## The manifest
**TypeScript:**
```toml title="zaun-bot.toml"
app_id = "org.zaun.examples.ts-poll"
version = "0.1.0"
name = "Poll"
description = "Yes/no polls with buttons."
permissions = ["VIEW_CHANNEL", "SEND_MESSAGES", "EMBED_LINKS"]
[capabilities]
```
**Rust:**
```toml title="zaun-bot.toml"
app_id = "org.zaun.examples.poll"
version = "0.1.0"
name = "Poll"
description = "Yes/no polls with buttons."
permissions = ["VIEW_CHANNEL", "SEND_MESSAGES", "EMBED_LINKS"]
[capabilities]
```
## How it works
- The poll is an embed plus one action row of a success and a danger button.
- Each button's custom id carries the vote and the question (`yes:`), so the bot knows which poll a click belongs to.
- The component handler records the voter (moving their vote if they change their mind) and answers with an update of the clicked message (`interaction.update(..)`, `ctx.update_message(..)`).
- Votes live in the instance and are lost on restart. A real bot would keep them in [storage](/docs/guide/bots/storage-timers-http/).
## Run it
**TypeScript:**
```sh
git clone https://github.com/zaunchat/zaun-bot && cd zaun-bot/examples/ts/poll-buttons
npm install
zbot build && zbot pack --unsigned
zaun-host bot install --community *.zbot # on a host with allow_unsigned = true
```
**Rust:**
```sh
git clone https://github.com/zaunchat/zaun-bot && cd zaun-bot/examples/rust/poll-buttons
zbot build && zbot pack --unsigned
zaun-host bot install --community *.zbot # on a host with allow_unsigned = true
```
---
url: https://zaunchat.github.io/docs/examples/feedback-modal/
---
# Feedback form (modal)
> A /feedback command that opens a form, thanks the member privately, and posts the result.
`/feedback` opens a form. When the member submits it, the bot thanks them privately and posts the feedback to the channel.
Source in zaun-bot: [`examples/ts/feedback-modal`](https://github.com/zaunchat/zaun-bot/tree/main/examples/ts/feedback-modal) (TypeScript) and [`examples/rust/feedback-modal`](https://github.com/zaunchat/zaun-bot/tree/main/examples/rust/feedback-modal) (Rust).
## The code
**TypeScript:**
```ts title="src/index.ts"
// `/feedback` opens a form; the answer is thanked privately and posted to the channel.
const bot = new Bot();
bot.command(new SlashCommandBuilder().setName('feedback').setDescription('Send feedback to the moderators'), (interaction) => {
interaction.showModal(new ModalBuilder().setCustomId('feedback').setTitle('Feedback')
.addTextInput('Subject', new TextInputBuilder().setCustomId('subject').setStyle(TextInputStyle.Short).setMinLength(1).setMaxLength(80))
.addTextInput('What should we know?', new TextInputBuilder().setCustomId('body').setStyle(TextInputStyle.Paragraph)
.setMinLength(10).setMaxLength(2000).setPlaceholder('Be specific')));
});
bot.modal('feedback', (interaction) => {
const subject = interaction.fields.getTextInputValue('subject') || '(none)';
const body = interaction.fields.getTextInputValue('body');
interaction.reply({ content: 'Thanks — your feedback was posted.', ephemeral: true });
interaction.followUp(new EmbedBuilder().setTitle(`Feedback: ${subject}`).setDescription(body)
.setFooter({ text: `from ${interaction.member.displayName}` }));
});
export const { init, onEvent, onInteraction, onAutocomplete, onTimer, onVoiceEvent } = bot.exports();
```
**Rust:**
```rust title="src/lib.rs"
//! `/feedback` opens a form; the answer is thanked privately and posted to the channel.
use zaun_bot::prelude::*;
#[derive(Default)]
struct Feedback;
impl Bot for Feedback {
fn commands(&mut self, _: &Config) -> Vec {
vec![SlashCommand::new("feedback", "Send feedback to the moderators").build()]
}
fn on_command(&mut self, ctx: Context, _: CommandData) {
let modal = Modal::new("feedback", "Feedback")
.input("Subject", TextInput::short("subject").length(1, 80))
.input(
"What should we know?",
TextInput::paragraph("body")
.length(10, 2000)
.placeholder("Be specific"),
);
let _ = ctx.show_modal(modal);
}
fn on_modal(&mut self, ctx: Context, modal: ModalData) {
let subject = modal.text("subject").unwrap_or("(none)");
let body = modal.text("body").unwrap_or_default();
let _ = ctx.reply_ephemeral("Thanks — your feedback was posted.");
let card = EmbedBuilder::new()
.title(format!("Feedback: {subject}"))
.description(body)
.footer(format!("from {}", ctx.member.display_name));
let _ = ctx.followup(card);
}
}
export_bot!(Feedback);
```
## The manifest
**TypeScript:**
```toml title="zaun-bot.toml"
app_id = "org.zaun.examples.ts-feedback"
version = "0.1.0"
name = "Feedback"
description = "A /feedback form using a modal."
permissions = ["VIEW_CHANNEL", "SEND_MESSAGES", "EMBED_LINKS"]
[capabilities]
```
**Rust:**
```toml title="zaun-bot.toml"
app_id = "org.zaun.examples.feedback"
version = "0.1.0"
name = "Feedback"
description = "A /feedback form using a modal."
permissions = ["VIEW_CHANNEL", "SEND_MESSAGES", "EMBED_LINKS"]
[capabilities]
```
## How it works
- The command answers by showing a modal, which counts as the first response.
- The host checks the submission against the modal (lengths, required inputs) before the modal handler runs.
- The modal handler answers with an ephemeral reply only the member sees, then a public follow-up embed.
## Run it
**TypeScript:**
```sh
git clone https://github.com/zaunchat/zaun-bot && cd zaun-bot/examples/ts/feedback-modal
npm install
zbot build && zbot pack --unsigned
zaun-host bot install --community *.zbot # on a host with allow_unsigned = true
```
**Rust:**
```sh
git clone https://github.com/zaunchat/zaun-bot && cd zaun-bot/examples/rust/feedback-modal
zbot build && zbot pack --unsigned
zaun-host bot install --community *.zbot # on a host with allow_unsigned = true
```
---
url: https://zaunchat.github.io/docs/examples/welcome-dm/
---
# Welcome DM
> Greets new members by direct message, answers what they write back, and offers /dm-me.
When someone joins, the bot sends them a welcome in a [direct message](/docs/guide/bots/direct-messages/) and answers what they write there. It needs the `members` capability (to hear joins) and `dms`.
Source in zaun-bot: [`examples/ts/welcome-dm`](https://github.com/zaunchat/zaun-bot/tree/main/examples/ts/welcome-dm) (TypeScript) and [`examples/rust/welcome-dm`](https://github.com/zaunchat/zaun-bot/tree/main/examples/rust/welcome-dm) (Rust).
## The code
**TypeScript:**
```ts title="src/index.ts"
// Welcomes every new member with a direct message, answers what they write back, and offers
// `/dm-me` to open the conversation on demand.
const bot = new Bot();
let greeted = 0;
bot.on('ready', (me) => bot.log.info(`welcome bot ${me.memberId} is up`));
bot.on('memberAdd', (member, ctx) => {
if (member.botId) return;
try {
ctx.dm(member.memberId, `Welcome, ${member.displayName}! Reply here if you have a question, or type \`rules\` to see them.`);
greeted += 1;
} catch (e) {
// The member turned DMs from bots off: respect it.
bot.log.info(`no welcome DM for ${member.memberId}: ${e instanceof ZaunError ? e.code : e}`);
}
});
bot.on('messageCreate', (message, ctx) => {
if (!message.isDM || ctx.isMe(message.authorId)) return;
const answer = message.content.trim().toLowerCase() === 'rules'
? '1. Be kind. 2. No spam. 3. Have fun.'
: 'Thanks! A moderator will read this soon.';
ctx.reply(message, answer);
});
bot.command(new SlashCommandBuilder().setName('dm-me').setDescription('Get a direct message from the welcome bot'), (i) => {
try {
bot.messages.dm(i.member.memberId, 'Hi! What can I help you with?');
i.reply({ content: 'Check your direct messages.', ephemeral: true });
} catch {
i.reply({ content: "I can't message you: you have direct messages from bots turned off.", ephemeral: true });
}
});
bot.command(new SlashCommandBuilder().setName('greeted').setDescription('How many members I welcomed'), (i) => {
i.reply({ content: `I welcomed ${greeted} member(s) since I started.`, ephemeral: true });
});
export const { init, onEvent, onInteraction, onAutocomplete, onTimer, onVoiceEvent } = bot.exports();
```
**Rust:**
```rust title="src/lib.rs"
//! Welcomes every new member with a direct message, answers what they write back, and offers
//! `/dm-me` to open the conversation on demand.
use zaun_bot::prelude::*;
#[derive(Default)]
struct Welcome {
/// How many members this instance greeted.
greeted: u32,
}
impl Bot for Welcome {
fn commands(&mut self, _: &Config) -> Vec {
vec![SlashCommand::new("dm-me", "Get a direct message from the welcome bot").build()]
}
fn on_ready(&mut self, _: EventContext, me: Ready) {
log_info!("welcome bot {} is up", me.member_id);
}
fn on_member_join(&mut self, ctx: EventContext, member: Member) {
if member.bot_id.is_some() {
return;
}
let text = format!(
"Welcome, {}! Reply here if you have a question, or type `rules` to see them.",
member.display_name
);
match ctx.dm(&member.member_id, text) {
Ok(_) => self.greeted += 1,
// The member turned DMs from bots off: respect it.
Err(e) => log_info!("no welcome DM for {}: {}", member.member_id, e.code),
}
}
fn on_message_create(&mut self, ctx: EventContext, message: Message, is_dm: bool) {
if !is_dm || ctx.is_me(&message.author_id) {
return;
}
let answer = if message.content.trim().eq_ignore_ascii_case("rules") {
"1. Be kind. 2. No spam. 3. Have fun."
} else {
"Thanks! A moderator will read this soon."
};
let _ = ctx.reply_to(&message, answer);
}
fn on_command(&mut self, ctx: Context, command: CommandData) {
if command.name != "dm-me" {
return;
}
let member_id = ctx.member.member_id.clone();
let answer = match ctx.dm(&member_id, "Hi! What can I help you with?") {
Ok(_) => "Check your direct messages.",
Err(_) => "I can't message you: you have direct messages from bots turned off.",
};
let _ = ctx.reply_ephemeral(answer);
}
}
export_bot!(Welcome);
```
## The manifest
**TypeScript:**
```toml title="zaun-bot.toml"
app_id = "org.zaun.examples.ts-welcome-dm"
version = "0.1.0"
name = "Welcome"
description = "Greets new members by direct message and answers their replies."
permissions = ["VIEW_CHANNEL", "SEND_MESSAGES"]
# `members` for member joins (needs the `members` capability), `dms` for the DM's own
# events, `messages` for the replies (DMs to a bot always arrive whole).
events = ["members", "dms", "messages"]
[capabilities]
members = true
dms = true
```
**Rust:**
```toml title="zaun-bot.toml"
app_id = "org.zaun.examples.welcome-dm"
version = "0.1.0"
name = "Welcome"
description = "Greets new members by direct message and answers their replies."
permissions = ["VIEW_CHANNEL", "SEND_MESSAGES"]
# `members` for member.joined (needs the `members` capability), `dms` for the DM's own
# events, `messages` for the replies (DMs to a bot always arrive whole).
events = ["members", "dms", "messages"]
[capabilities]
members = true
dms = true
```
## How it works
- `events` asks for `members`, `dms` and `messages`; DMs to a bot always arrive whole, so it needs no `message_content`.
- The member-join handler opens the DM and sends the welcome in one call (`ctx.dm(..)`). A member who turned DMs from bots off makes the call fail with `dms_closed`; the bot just logs it.
- Message events in a DM are marked (`isDM` / `is_dm`), so the bot only answers there, never in public channels, and never itself.
## Run it
**TypeScript:**
```sh
git clone https://github.com/zaunchat/zaun-bot && cd zaun-bot/examples/ts/welcome-dm
npm install
zbot build && zbot pack --unsigned
zaun-host bot install --community *.zbot # on a host with allow_unsigned = true
```
**Rust:**
```sh
git clone https://github.com/zaunchat/zaun-bot && cd zaun-bot/examples/rust/welcome-dm
zbot build && zbot pack --unsigned
zaun-host bot install --community *.zbot # on a host with allow_unsigned = true
```
---
url: https://zaunchat.github.io/docs/examples/music/
---
# Music in voice
> A music bot: /join, /play, /queue, /skip, /pause, /resume, /stop, /leave, and control buttons.
A complete [voice](/docs/guide/bots/voice-and-music/) bot. The host joins the voice channel as the bot and plays Ogg Opus files or streams from the hosts in its `network` grant.
Source in zaun-bot: [`examples/ts/music`](https://github.com/zaunchat/zaun-bot/tree/main/examples/ts/music) (TypeScript) and [`examples/rust/music`](https://github.com/zaunchat/zaun-bot/tree/main/examples/rust/music) (Rust).
## The code
**TypeScript:**
```ts title="src/index.ts"
// A music bot: `/join` a voice channel, `/play` an https:// Ogg Opus file or stream, `/queue`,
// `/skip`, `/pause`, `/resume`, `/stop`, `/leave`, and buttons on the now-playing message.
//
// The host fetches and plays the audio in real time; the bot only says what to play. URLs must
// be in the bot's `network` grant, and the audio must already be Opus: nothing is transcoded.
const bot = new Bot();
const controls = () => new ActionRowBuilder().addComponents(
new ButtonBuilder().setCustomId('music:pause').setLabel('Pause').setEmoji('⏸️').setStyle(ButtonStyle.Secondary),
new ButtonBuilder().setCustomId('music:resume').setLabel('Resume').setEmoji('▶️').setStyle(ButtonStyle.Secondary),
new ButtonBuilder().setCustomId('music:skip').setLabel('Skip').setEmoji('⏭️').setStyle(ButtonStyle.Primary),
new ButtonBuilder().setCustomId('music:stop').setLabel('Stop').setEmoji('⏹️').setStyle(ButtonStyle.Danger),
);
const STATUS = { idle: 'idle', playing: 'playing', paused: 'paused', 'auto-paused': 'waiting for listeners' } as const;
function queueText(): string {
const s = bot.voice.state();
const lines = [`Now ${STATUS[s.status]}: **${s.current ?? 'nothing'}**`];
s.queued.forEach((t, n) => lines.push(`${n + 1}. ${t ?? 'untitled'}`));
return lines.join('\n');
}
/** Runs `f`, answering the invoker privately with its result or the host's refusal. */
function act(i: Interaction, f: () => string): void {
if (!i.isRepliable() || !('reply' in i)) return;
try {
i.reply({ content: f(), ephemeral: true });
} catch (e) {
i.reply({ content: `Could not do that: ${e instanceof ZaunError ? e.code : String(e)}`, ephemeral: true });
}
}
const simple = (name: string, description: string, run: () => string) =>
bot.command(new SlashCommandBuilder().setName(name).setDescription(description), (i) => act(i, run));
bot.command(
new SlashCommandBuilder().setName('join').setDescription('Join a voice channel')
.addChannelOption((o) => o.setName('channel').setDescription('A voice channel').setRequired(true)),
(i) => {
if (!i.isChatInputCommand()) return;
const channel = i.options.getChannel('channel', true);
try {
bot.voice.join(channel?.channelId ?? '');
i.reply({ content: 'Joined. 🎶', components: [controls()] });
} catch (e) {
i.reply({ content: `Could not join: ${e instanceof ZaunError ? e.code : String(e)}`, ephemeral: true });
}
},
);
bot.command(
new SlashCommandBuilder().setName('play').setDescription('Play now, or queue if something is playing')
.addStringOption((o) => o.setName('url').setDescription('An https:// Ogg Opus file or stream').setRequired(true).setMinLength(9).setMaxLength(500))
.addStringOption((o) => o.setName('title').setDescription('What to call it').setMinLength(1).setMaxLength(80)),
(i) => act(i, () => {
if (!i.isChatInputCommand()) return '';
const url = i.options.getString('url', true) ?? '';
const title = i.options.getString('title') ?? url;
if (bot.voice.state().status === 'idle') {
bot.voice.play({ url, title });
return `Playing **${title}**`;
}
return `Queued **${title}** (#${bot.voice.enqueue({ url, title })})`;
}),
);
simple('queue', 'What is playing and what comes next', queueText);
simple('skip', 'Skip the current track', () => (bot.voice.skip(), 'Skipped.'));
simple('pause', 'Pause', () => (bot.voice.pause(), 'Paused.'));
simple('resume', 'Resume', () => (bot.voice.resume(), 'Resumed.'));
simple('stop', 'Stop and clear the queue', () => (bot.voice.stop(), 'Stopped.'));
simple('leave', 'Leave the voice channel', () => (bot.voice.leave(), 'Bye! 👋'));
bot.component('music:', (i) => act(i, () => {
switch (i.customId) {
case 'music:pause': bot.voice.pause(); return 'Paused.';
case 'music:resume': bot.voice.resume(); return 'Resumed.';
case 'music:skip': bot.voice.skip(); return 'Skipped.';
default: bot.voice.stop(); return 'Stopped.';
}
}));
// Members see "Listening to " next to the bot while it plays.
bot.on('trackStart', (title) => bot.presence.set('online', Activity.listening(title ?? 'music')));
bot.on('trackEnd', () => bot.presence.set('online'));
bot.on('trackError', (error) => bot.log.warn(`track failed: ${error}`));
bot.on('voiceEnd', (reason) => {
bot.presence.set('online');
bot.log.info(`voice stay ended: ${reason ?? 'left'}`);
});
export const { init, onEvent, onInteraction, onAutocomplete, onTimer, onVoiceEvent } = bot.exports();
```
**Rust:**
```rust title="src/lib.rs"
//! A music bot: `/join` a voice channel, `/play` an `https://` Ogg Opus file or stream,
//! `/queue`, `/skip`, `/pause`, `/resume`, `/stop`, `/leave`, and buttons on the
//! now-playing message.
//!
//! The host fetches and plays the audio in real time; the bot only says what to play. URLs
//! must be in the bot's `network` grant, and the audio must already be Opus (`.opus`, or
//! `.ogg` holding Opus): nothing is transcoded.
use zaun_bot::prelude::*;
use zaun_bot::types::OptionKind;
use zaun_bot::voice::{PlayerStatus, VoiceEvent};
#[derive(Default)]
struct Music;
fn controls() -> ActionRow {
ActionRow::buttons([
Button::secondary("music:pause", "Pause").emoji("⏸️"),
Button::secondary("music:resume", "Resume").emoji("▶️"),
Button::primary("music:skip", "Skip").emoji("⏭️"),
Button::danger("music:stop", "Stop").emoji("⏹️"),
])
}
/// A short reply only the invoker sees.
fn note(ctx: &Context, text: impl Into) {
let _ = ctx.reply(Reply::new().content(text).ephemeral());
}
fn queue_text() -> String {
let state = Voice::state();
let now = state.current.unwrap_or_else(|| "nothing".to_owned());
let status = match state.status {
PlayerStatus::Playing => "playing",
PlayerStatus::Paused => "paused",
PlayerStatus::AutoPaused => "waiting for listeners",
PlayerStatus::Idle => "idle",
};
let mut text = format!("Now {status}: **{now}**");
for (i, title) in state.queued.iter().enumerate() {
let title = title.as_deref().unwrap_or("untitled");
text.push_str(&format!("\n{}. {title}", i + 1));
}
text
}
impl Bot for Music {
fn commands(&mut self, _: &Config) -> Vec {
let channel =
CommandOptionBuilder::new(OptionKind::Channel, "channel", "A voice channel").required();
let url = CommandOptionBuilder::string("url", "An https:// Ogg Opus file or stream")
.required()
.length(9, 500);
let title = CommandOptionBuilder::string("title", "What to call it").length(1, 80);
vec![
SlashCommand::new("join", "Join a voice channel")
.option(channel)
.build(),
SlashCommand::new("play", "Play now, or queue if something is playing")
.option(url)
.option(title)
.build(),
SlashCommand::new("queue", "What is playing and what comes next").build(),
SlashCommand::new("skip", "Skip the current track").build(),
SlashCommand::new("pause", "Pause").build(),
SlashCommand::new("resume", "Resume").build(),
SlashCommand::new("stop", "Stop and clear the queue").build(),
SlashCommand::new("leave", "Leave the voice channel").build(),
]
}
fn on_command(&mut self, ctx: Context, command: CommandData) {
match command.name.as_str() {
"join" => match command.str("channel").map(Voice::join) {
Some(Ok(())) => {
let _ = ctx.reply(Reply::new().content("Joined. 🎶").row(controls()));
}
Some(Err(e)) => note(&ctx, format!("Could not join: {}", e.code)),
None => note(&ctx, "Pick a voice channel."),
},
"play" => {
let (Some(url), title) = (command.str("url"), command.str("title")) else {
return;
};
let title = title.unwrap_or(url);
let idle = Voice::state().status == PlayerStatus::Idle;
let done = if idle {
Voice::play_url(url, Some(title)).map(|()| format!("Playing **{title}**"))
} else {
Voice::enqueue_url(url, Some(title))
.map(|n| format!("Queued **{title}** (#{n})"))
};
match done {
Ok(text) => {
let _ = ctx.reply(Reply::new().content(text).row(controls()));
}
Err(e) if e.code == "CONFLICT" => note(&ctx, "Use /join first."),
Err(e) => note(&ctx, format!("Could not play: {}", e.code)),
}
}
"queue" => note(&ctx, queue_text()),
"skip" => {
Voice::skip();
note(&ctx, "Skipped.");
}
"pause" => {
Voice::pause();
note(&ctx, "Paused.");
}
"resume" => {
Voice::resume();
note(&ctx, "Resumed.");
}
"stop" => {
Voice::stop();
note(&ctx, "Stopped, queue cleared.");
}
"leave" => {
Voice::leave();
note(&ctx, "Bye. 👋");
}
_ => {}
}
}
fn on_component(&mut self, ctx: Context, component: ComponentData) {
match component.custom_id.as_str() {
"music:pause" => Voice::pause(),
"music:resume" => Voice::resume(),
"music:skip" => Voice::skip(),
"music:stop" => Voice::stop(),
_ => return,
}
let _ = ctx.update_message(Reply::new().content(queue_text()).row(controls()));
}
fn on_voice_event(&mut self, event: VoiceEvent) {
match event {
// Members see "Listening to " next to the bot while it plays.
VoiceEvent::TrackStart(title) => zaun_bot::presence::set(
zaun_bot::presence::Status::Online,
zaun_bot::presence::Activity::listening(title.unwrap_or_else(|| "music".into())),
),
VoiceEvent::TrackEnd(_) => {
zaun_bot::presence::set(zaun_bot::presence::Status::Online, None);
}
VoiceEvent::TrackError(e) => log_info!("track failed: {e}"),
VoiceEvent::Ended(why) => {
zaun_bot::presence::set(zaun_bot::presence::Status::Online, None);
log_info!("left voice: {}", why.unwrap_or_default());
}
_ => {}
}
}
}
export_bot!(Music);
```
## The manifest
**TypeScript:**
```toml title="zaun-bot.toml"
app_id = "org.zaun.examples.ts-music"
version = "0.1.0"
name = "Music"
description = "Plays Ogg Opus files and streams in voice channels, with a queue and buttons."
permissions = ["VIEW_CHANNEL", "SEND_MESSAGES", "CONNECT", "SPEAK"]
[capabilities]
# Join voice channels and play audio.
voice = true
# The hosts the music comes from. The host fetches them, so they learn the host's address.
network = ["music.example.org"]
```
**Rust:**
```toml title="zaun-bot.toml"
app_id = "org.zaun.examples.music"
version = "0.1.0"
name = "Music"
description = "Plays Ogg Opus files and streams in voice channels, with a queue and buttons."
permissions = ["VIEW_CHANNEL", "SEND_MESSAGES", "CONNECT", "SPEAK"]
[capabilities]
# Join voice channels and play audio.
voice = true
# The hosts the music comes from. The host fetches them, so they learn the host's address.
network = ["music.example.org"]
```
## How it works
- `voice` is a capability the owner grants; `CONNECT` and `SPEAK` apply per channel as for members.
- `/join` joins the channel and posts control buttons (pause, resume, skip, stop).
- `/play` plays at once when nothing is playing, and queues otherwise; the host fetches each URL
through the bot's network grant as it plays. `/queue` shows what is playing and what comes next.
- Every command and button answers the invoker privately, with the result or the host's refusal
(for example `FORBIDDEN` without `CONNECT`).
- While a track plays, members see "Listening to" the track next to the bot; it clears when the
track ends or the bot leaves ([Status and presence](/docs/guide/bots/status-and-presence/)).
- Track errors and the end of the voice stay are logged. Audio must already be Opus: convert other
formats once with `ffmpeg -c:a libopus`.
## Run it
**TypeScript:**
```sh
git clone https://github.com/zaunchat/zaun-bot && cd zaun-bot/examples/ts/music
npm install
zbot build && zbot pack --unsigned
zaun-host bot install --community *.zbot # on a host with allow_unsigned = true
```
**Rust:**
```sh
git clone https://github.com/zaunchat/zaun-bot && cd zaun-bot/examples/rust/music
zbot build && zbot pack --unsigned
zaun-host bot install --community *.zbot # on a host with allow_unsigned = true
```
---
url: https://zaunchat.github.io/docs/examples/client-ping-bot/
---
# Ping bot with zaun-client
> An external bot in Rust and JavaScript that joins with an invite and answers text commands.
A bot that joins a community like any member and answers text commands. It runs anywhere, not in the
host; see [External bots](/docs/guide/bots/external-bots/) for when to choose this over a hosted bot.
Source: [`zaun/examples`](https://github.com/zaunchat/zaun-client/tree/main/zaun/examples) in zaun-client.
**JavaScript:**
```js title="ping_bot.mjs"
// A ping bot over the JS build: joins with an invitation once, answers `!ping`, and keeps
// its state in one sealed file between runs. Build the package first
// (scripts/build-zaun-js.sh).
//
// ZAUN_KEY='store passphrase' ZAUN_INVITE='zaun://join/…' node examples/ping_bot.mjs
const file = "ping-bot.snapshot";
const key = process.env.ZAUN_KEY;
if (!key) throw new Error("set ZAUN_KEY to the store passphrase");
const snapshot = fs.existsSync(file) ? fs.readFileSync(file) : undefined;
// `relays: ["smp://…"]` picks the SimpleX servers; without it the official ones are used.
const client = await Client.start({ name: "Ping bot", key, snapshot });
client.on("change", () => fs.writeFileSync(file, client.save())); // keep the store
client.on("ready", (community) => console.log(`ready in ${community.name}`));
client.on("messageCreate", async (message) => {
if (message.mine) return;
if (message.content === "!ping") await message.reply("pong");
if (message.content === "!who") {
await message.channel.send(`${message.author.displayName}, you are in ${message.community.name}`);
}
});
if (client.saved.size === 0 && process.env.ZAUN_INVITE) {
await client.join(process.env.ZAUN_INVITE, "Ping bot"); // the link is a secret: never log it
}
```
```sh
ZAUN_KEY='store passphrase' ZAUN_INVITE='zaun://join/…' node examples/ping_bot.mjs
```
**Rust:**
```rust title="ping_bot.rs"
//! A bot that joins a Zaun community and answers `!ping`, `!members`, `!can` and `!kick`.
//!
//! ```sh
//! ZAUN_BOT_KEY='store passphrase' cargo run -p zaun-client --example ping_bot -- ./bot 'zaun://join/…'
//! ```
//!
//! The invitation is needed only the first time; later runs reconnect from `./bot`.
use zaun_client::protocol::bits::Permissions;
use zaun_client::{Client, Event, Message};
fn main() -> Result<(), Box> {
let mut args = std::env::args().skip(1);
let dir = args.next().ok_or("usage: ping_bot DIR [INVITE_LINK]")?;
let key = std::env::var("ZAUN_BOT_KEY").map_err(|_| "set ZAUN_BOT_KEY")?;
let client = Client::builder(&dir).name("Ping bot").key(key).start()?;
if let Some(link) = args.next() {
let community = client.join(&link, "Ping bot")?;
println!("joined {community}");
}
for event in client.events() {
match event {
Event::Ready(community) => {
println!(
"ready in {community} ({} channels)",
community.channels().len()
);
}
Event::MessageCreate(message) if !message.is_mine() => {
if let Err(e) = answer(&message) {
eprintln!("could not answer: {e}");
}
}
Event::MemberAdd(member) => {
println!("{member} joined {}", member.community());
}
Event::CommunityDelete { community, reason } => {
println!("removed from {}: {reason:?}", community.id().to_b64());
}
_ => {}
}
}
Ok(())
}
fn answer(message: &Message) -> zaun_client::Result<()> {
let author = message.author();
match message.content().trim() {
"!ping" => {
message.reply("pong")?;
}
"!members" => {
let members = message.community().fetch_members()?;
message
.channel()
.send(format!("{} members", members.len()))?;
}
"!can" => {
let ok = author.can(Permissions::SEND_MESSAGES, Some(message.channel()));
message.reply(format!(
"you {} post here",
if ok { "can" } else { "cannot" }
))?;
}
text if text.starts_with("!kick ") => {
let name = text.trim_start_matches("!kick ").trim();
if !author.can(Permissions::KICK_MEMBERS, None) {
message.reply("you cannot kick")?;
} else if let Some(target) =
(message.community().members().into_iter()).find(|m| m.display_name() == name)
{
target.kick(Some("asked to"))?;
message.react("👋")?;
}
}
_ => {}
}
Ok(())
}
```
```sh
ZAUN_BOT_KEY='store passphrase' cargo run -p zaun-client --example ping_bot -- ./bot 'zaun://join/…'
```
## How it works
- The invite is needed only the first time; later runs reconnect from the saved store (`./bot` in
Rust, the snapshot file in JavaScript).
- `!ping` replies, `!members` fetches the member list, `!can` checks a permission locally, and `!kick`
(Rust) kicks by display name if the author may.
- It ignores its own messages (`is_mine()` / `message.mine`).
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/readme/
---
# @zaun/bot
`@zaun/bot`: write Zaun bots in TypeScript. A bot is a WebAssembly component that runs inside
the community's own zaun-host, in a sandbox, with only the permissions it was granted.
## Classes
- [ActionRowBuilder](/docs/reference/js/zaun-bot/classes/actionrowbuilder/)
- [Activity](/docs/reference/js/zaun-bot/classes/activity/)
- [AutocompleteInteraction](/docs/reference/js/zaun-bot/classes/autocompleteinteraction/)
- [BaseInteraction](/docs/reference/js/zaun-bot/classes/baseinteraction/)
- [Bot](/docs/reference/js/zaun-bot/classes/bot/)
- [ButtonBuilder](/docs/reference/js/zaun-bot/classes/buttonbuilder/)
- [ChannelSelectMenuBuilder](/docs/reference/js/zaun-bot/classes/channelselectmenubuilder/)
- [ChatInputCommandInteraction](/docs/reference/js/zaun-bot/classes/chatinputcommandinteraction/)
- [CheckboxBuilder](/docs/reference/js/zaun-bot/classes/checkboxbuilder/)
- [CheckboxGroupBuilder](/docs/reference/js/zaun-bot/classes/checkboxgroupbuilder/)
- [CommandInteractionOptionResolver](/docs/reference/js/zaun-bot/classes/commandinteractionoptionresolver/)
- [ContainerBuilder](/docs/reference/js/zaun-bot/classes/containerbuilder/)
- [ContextMenuCommandBuilder](/docs/reference/js/zaun-bot/classes/contextmenucommandbuilder/)
- [EmbedBuilder](/docs/reference/js/zaun-bot/classes/embedbuilder/)
- [EventContext](/docs/reference/js/zaun-bot/classes/eventcontext/)
- [FileBuilder](/docs/reference/js/zaun-bot/classes/filebuilder/)
- [FileUploadBuilder](/docs/reference/js/zaun-bot/classes/fileuploadbuilder/)
- [HttpError](/docs/reference/js/zaun-bot/classes/httperror/)
- [LabelBuilder](/docs/reference/js/zaun-bot/classes/labelbuilder/)
- [MediaGalleryBuilder](/docs/reference/js/zaun-bot/classes/mediagallerybuilder/)
- [Member](/docs/reference/js/zaun-bot/classes/member/)
- [MemberRoles](/docs/reference/js/zaun-bot/classes/memberroles/)
- [MentionableSelectMenuBuilder](/docs/reference/js/zaun-bot/classes/mentionableselectmenubuilder/)
- [Message](/docs/reference/js/zaun-bot/classes/message/)
- [MessageComponentInteraction](/docs/reference/js/zaun-bot/classes/messagecomponentinteraction/)
- [MessageContextMenuCommandInteraction](/docs/reference/js/zaun-bot/classes/messagecontextmenucommandinteraction/)
- [MessageMentions](/docs/reference/js/zaun-bot/classes/messagementions/)
- [ModalBuilder](/docs/reference/js/zaun-bot/classes/modalbuilder/)
- [ModalCapableInteraction](/docs/reference/js/zaun-bot/classes/modalcapableinteraction/)
- [ModalSubmitFields](/docs/reference/js/zaun-bot/classes/modalsubmitfields/)
- [ModalSubmitInteraction](/docs/reference/js/zaun-bot/classes/modalsubmitinteraction/)
- [OptionBuilder](/docs/reference/js/zaun-bot/classes/optionbuilder/)
- [RadioGroupBuilder](/docs/reference/js/zaun-bot/classes/radiogroupbuilder/)
- [RepliableInteraction](/docs/reference/js/zaun-bot/classes/repliableinteraction/)
- [RoleSelectMenuBuilder](/docs/reference/js/zaun-bot/classes/roleselectmenubuilder/)
- [SectionBuilder](/docs/reference/js/zaun-bot/classes/sectionbuilder/)
- [SeparatorBuilder](/docs/reference/js/zaun-bot/classes/separatorbuilder/)
- [SlashCommandBuilder](/docs/reference/js/zaun-bot/classes/slashcommandbuilder/)
- [SlashCommandSubcommandBuilder](/docs/reference/js/zaun-bot/classes/slashcommandsubcommandbuilder/)
- [SlashCommandSubcommandGroupBuilder](/docs/reference/js/zaun-bot/classes/slashcommandsubcommandgroupbuilder/)
- [StringSelectMenuBuilder](/docs/reference/js/zaun-bot/classes/stringselectmenubuilder/)
- [StringSelectMenuOptionBuilder](/docs/reference/js/zaun-bot/classes/stringselectmenuoptionbuilder/)
- [TextDisplayBuilder](/docs/reference/js/zaun-bot/classes/textdisplaybuilder/)
- [TextInputBuilder](/docs/reference/js/zaun-bot/classes/textinputbuilder/)
- [ThumbnailBuilder](/docs/reference/js/zaun-bot/classes/thumbnailbuilder/)
- [UserContextMenuCommandInteraction](/docs/reference/js/zaun-bot/classes/usercontextmenucommandinteraction/)
- [UserSelectMenuBuilder](/docs/reference/js/zaun-bot/classes/userselectmenubuilder/)
- [ZaunError](/docs/reference/js/zaun-bot/classes/zaunerror/)
- [ZaunValidationError](/docs/reference/js/zaun-bot/classes/zaunvalidationerror/)
## Interfaces
- [AudioStreamOptions](/docs/reference/js/zaun-bot/interfaces/audiostreamoptions/)
- [AutocompleteChoice](/docs/reference/js/zaun-bot/interfaces/autocompletechoice/)
- [BotEvents](/docs/reference/js/zaun-bot/interfaces/botevents/)
- [Command](/docs/reference/js/zaun-bot/interfaces/command/)
- [CommandLike](/docs/reference/js/zaun-bot/interfaces/commandlike/)
- [EmbedData](/docs/reference/js/zaun-bot/interfaces/embeddata/)
- [HttpResponse](/docs/reference/js/zaun-bot/interfaces/httpresponse/)
- [Me](/docs/reference/js/zaun-bot/interfaces/me/)
- [MediaGalleryItem](/docs/reference/js/zaun-bot/interfaces/mediagalleryitem/)
- [MessageOptions](/docs/reference/js/zaun-bot/interfaces/messageoptions/)
## Type Aliases
- [ApplicationCommandOptionType](/docs/reference/js/zaun-bot/type-aliases/applicationcommandoptiontype/)
- [ApplicationCommandType](/docs/reference/js/zaun-bot/type-aliases/applicationcommandtype/)
- [AudioFormat](/docs/reference/js/zaun-bot/type-aliases/audioformat/)
- [ButtonInteraction](/docs/reference/js/zaun-bot/type-aliases/buttoninteraction/)
- [ButtonStyle](/docs/reference/js/zaun-bot/type-aliases/buttonstyle/)
- [ChannelSelectMenuInteraction](/docs/reference/js/zaun-bot/type-aliases/channelselectmenuinteraction/)
- [ContainerComponent](/docs/reference/js/zaun-bot/type-aliases/containercomponent/)
- [EventMessage](/docs/reference/js/zaun-bot/type-aliases/eventmessage/)
- [Interaction](/docs/reference/js/zaun-bot/type-aliases/interaction/)
- [LabelComponent](/docs/reference/js/zaun-bot/type-aliases/labelcomponent/)
- [LoopMode](/docs/reference/js/zaun-bot/type-aliases/loopmode/)
- [MentionableSelectMenuInteraction](/docs/reference/js/zaun-bot/type-aliases/mentionableselectmenuinteraction/)
- [MessagePayload](/docs/reference/js/zaun-bot/type-aliases/messagepayload/)
- [PresenceStatus](/docs/reference/js/zaun-bot/type-aliases/presencestatus/)
- [RoleSelectMenuInteraction](/docs/reference/js/zaun-bot/type-aliases/roleselectmenuinteraction/)
- [RowComponent](/docs/reference/js/zaun-bot/type-aliases/rowcomponent/)
- [SeparatorSpacingSize](/docs/reference/js/zaun-bot/type-aliases/separatorspacingsize/)
- [StringSelectMenuInteraction](/docs/reference/js/zaun-bot/type-aliases/stringselectmenuinteraction/)
- [TextInputStyle](/docs/reference/js/zaun-bot/type-aliases/textinputstyle/)
- [TopLevelComponent](/docs/reference/js/zaun-bot/type-aliases/toplevelcomponent/)
- [TrackOptions](/docs/reference/js/zaun-bot/type-aliases/trackoptions/)
- [UserSelectMenuInteraction](/docs/reference/js/zaun-bot/type-aliases/userselectmenuinteraction/)
- [VoiceState](/docs/reference/js/zaun-bot/type-aliases/voicestate/)
## Variables
- [ApplicationCommandOptionType](/docs/reference/js/zaun-bot/variables/applicationcommandoptiontype/)
- [ApplicationCommandType](/docs/reference/js/zaun-bot/variables/applicationcommandtype/)
- [audio](/docs/reference/js/zaun-bot/variables/audio/)
- [ButtonStyle](/docs/reference/js/zaun-bot/variables/buttonstyle/)
- [community](/docs/reference/js/zaun-bot/variables/community/)
- [ComponentType](/docs/reference/js/zaun-bot/variables/componenttype/)
- [dms](/docs/reference/js/zaun-bot/variables/dms/)
- [everyoneMention](/docs/reference/js/zaun-bot/variables/everyonemention/)
- [http](/docs/reference/js/zaun-bot/variables/http/)
- [Limits](/docs/reference/js/zaun-bot/variables/limits/)
- [log](/docs/reference/js/zaun-bot/variables/log/)
- [memberMention](/docs/reference/js/zaun-bot/variables/membermention/)
- [MentionLimits](/docs/reference/js/zaun-bot/variables/mentionlimits/)
- [messages](/docs/reference/js/zaun-bot/variables/messages/)
- [PermissionFlagsBits](/docs/reference/js/zaun-bot/variables/permissionflagsbits/)
- [presence](/docs/reference/js/zaun-bot/variables/presence/)
- [SeparatorSpacingSize](/docs/reference/js/zaun-bot/variables/separatorspacingsize/)
- [storage](/docs/reference/js/zaun-bot/variables/storage/)
- [TextInputStyle](/docs/reference/js/zaun-bot/variables/textinputstyle/)
- [timers](/docs/reference/js/zaun-bot/variables/timers/)
- [voice](/docs/reference/js/zaun-bot/variables/voice/)
## Functions
- [hasPermission](/docs/reference/js/zaun-bot/functions/haspermission/)
- [interactionFromWit](/docs/reference/js/zaun-bot/functions/interactionfromwit/)
- [isId](/docs/reference/js/zaun-bot/functions/isid/)
- [parseMentions](/docs/reference/js/zaun-bot/functions/parsementions/)
- [roleMention](/docs/reference/js/zaun-bot/functions/rolemention/)
- [setCommands](/docs/reference/js/zaun-bot/functions/setcommands/)
- [toBody](/docs/reference/js/zaun-bot/functions/tobody/)
- [userMention](/docs/reference/js/zaun-bot/functions/usermention/)
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/classes/actionrowbuilder/
---
# ActionRowBuilder
Defined in: [sdk/js/src/builders/row.ts:24](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/row.ts#L24)
Type 1: up to five buttons, or one select.
## Type Parameters
### T
`T` *extends* [`RowComponent`](/docs/reference/js/zaun-bot/type-aliases/rowcomponent/) = [`RowComponent`](/docs/reference/js/zaun-bot/type-aliases/rowcomponent/)
## Constructors
### Constructor
> **new ActionRowBuilder**\<`T`\>(`components?`): `ActionRowBuilder`\<`T`\>
Defined in: [sdk/js/src/builders/row.ts:27](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/row.ts#L27)
#### Parameters
##### components?
`T`[] = `[]`
#### Returns
`ActionRowBuilder`\<`T`\>
## Properties
### components
> `readonly` **components**: `T`[] = `[]`
Defined in: [sdk/js/src/builders/row.ts:25](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/row.ts#L25)
## Methods
### addComponents()
> **addComponents**(...`components`): `this`
Defined in: [sdk/js/src/builders/row.ts:31](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/row.ts#L31)
#### Parameters
##### components
...`T`[]
#### Returns
`this`
***
### setComponents()
> **setComponents**(...`components`): `this`
Defined in: [sdk/js/src/builders/row.ts:35](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/row.ts#L35)
#### Parameters
##### components
...`T`[]
#### Returns
`this`
***
### toWit()
> **toWit**(): `ActionRow`
Defined in: [sdk/js/src/builders/row.ts:40](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/row.ts#L40)
#### Returns
`ActionRow`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/classes/activity/
---
# Activity
Defined in: [sdk/js/src/presence.ts:24](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/presence.ts#L24)
What the bot is doing. Build one with `Activity.playing(…)`, `Activity.listening(…)`, …
## Properties
### data
> `readonly` **data**: `Activity`
Defined in: [sdk/js/src/presence.ts:25](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/presence.ts#L25)
## Methods
### setDetails()
> **setDetails**(`details`): `Activity`
Defined in: [sdk/js/src/presence.ts:62](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/presence.ts#L62)
A second line, e.g. the track (≤ 128 characters).
#### Parameters
##### details
`string`
#### Returns
`Activity`
***
### setEmoji()
> **setEmoji**(`emoji`): `Activity`
Defined in: [sdk/js/src/presence.ts:77](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/presence.ts#L77)
A Unicode emoji, for `Activity.custom` only.
#### Parameters
##### emoji
`string`
#### Returns
`Activity`
***
### setStartedAt()
> **setStartedAt**(`ms`): `Activity`
Defined in: [sdk/js/src/presence.ts:72](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/presence.ts#L72)
When it started, ms since the epoch (clients show the elapsed time).
#### Parameters
##### ms
`number` \| `bigint`
#### Returns
`Activity`
***
### setState()
> **setState**(`state`): `Activity`
Defined in: [sdk/js/src/presence.ts:67](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/presence.ts#L67)
A third line, e.g. the artist (≤ 128 characters).
#### Parameters
##### state
`string`
#### Returns
`Activity`
***
### competing()
> `static` **competing**(`name`): `Activity`
Defined in: [sdk/js/src/presence.ts:52](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/presence.ts#L52)
"Competing in {name}".
#### Parameters
##### name
`string`
#### Returns
`Activity`
***
### custom()
> `static` **custom**(`text`): `Activity`
Defined in: [sdk/js/src/presence.ts:57](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/presence.ts#L57)
Free text, with an optional emoji (`setEmoji`).
#### Parameters
##### text
`string`
#### Returns
`Activity`
***
### listening()
> `static` **listening**(`name`): `Activity`
Defined in: [sdk/js/src/presence.ts:42](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/presence.ts#L42)
"Listening to {name}".
#### Parameters
##### name
`string`
#### Returns
`Activity`
***
### playing()
> `static` **playing**(`name`): `Activity`
Defined in: [sdk/js/src/presence.ts:32](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/presence.ts#L32)
"Playing {name}".
#### Parameters
##### name
`string`
#### Returns
`Activity`
***
### streaming()
> `static` **streaming**(`name`, `url`): `Activity`
Defined in: [sdk/js/src/presence.ts:37](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/presence.ts#L37)
"Streaming {name}", with an `https://` link members may open (after confirming).
#### Parameters
##### name
`string`
##### url
`string`
#### Returns
`Activity`
***
### watching()
> `static` **watching**(`name`): `Activity`
Defined in: [sdk/js/src/presence.ts:47](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/presence.ts#L47)
"Watching {name}".
#### Parameters
##### name
`string`
#### Returns
`Activity`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/classes/autocompleteinteraction/
---
# AutocompleteInteraction
Defined in: [sdk/js/src/interactions/command.ts:76](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/command.ts#L76)
Typing in an autocomplete option. Call [respond](/docs/reference/js/zaun-bot/classes/autocompleteinteraction/#respond) before the handler returns.
## Extends
- [`BaseInteraction`](/docs/reference/js/zaun-bot/classes/baseinteraction/)
## Constructors
### Constructor
> **new AutocompleteInteraction**(`raw`, `data`): `AutocompleteInteraction`
Defined in: [sdk/js/src/interactions/command.ts:84](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/command.ts#L84)
#### Parameters
##### raw
`Interaction`
##### data
`CommandData`
#### Returns
`AutocompleteInteraction`
#### Overrides
[`BaseInteraction`](/docs/reference/js/zaun-bot/classes/baseinteraction/).[`constructor`](/docs/reference/js/zaun-bot/classes/baseinteraction/#constructor)
## Properties
### appPermissions
> `readonly` **appPermissions**: `bigint`
Defined in: [sdk/js/src/interactions/base.ts:20](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L20)
The bot's effective permissions in the channel.
#### Inherited from
[`BaseInteraction`](/docs/reference/js/zaun-bot/classes/baseinteraction/).[`appPermissions`](/docs/reference/js/zaun-bot/classes/baseinteraction/#apppermissions)
***
### botId
> `readonly` **botId**: `string`
Defined in: [sdk/js/src/interactions/base.ts:15](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L15)
The bot's id in this community.
#### Inherited from
[`BaseInteraction`](/docs/reference/js/zaun-bot/classes/baseinteraction/).[`botId`](/docs/reference/js/zaun-bot/classes/baseinteraction/#botid)
***
### channelId
> `readonly` **channelId**: `string`
Defined in: [sdk/js/src/interactions/base.ts:16](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L16)
#### Inherited from
[`BaseInteraction`](/docs/reference/js/zaun-bot/classes/baseinteraction/).[`channelId`](/docs/reference/js/zaun-bot/classes/baseinteraction/#channelid)
***
### choices
> **choices**: `Choice`[] = `[]`
Defined in: [sdk/js/src/interactions/command.ts:81](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/command.ts#L81)
The choices given to [respond](/docs/reference/js/zaun-bot/classes/autocompleteinteraction/#respond); the SDK returns them to the host.
***
### commandId
> `readonly` **commandId**: `string`
Defined in: [sdk/js/src/interactions/command.ts:77](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/command.ts#L77)
***
### commandName
> `readonly` **commandName**: `string`
Defined in: [sdk/js/src/interactions/command.ts:78](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/command.ts#L78)
***
### createdTimestamp
> `readonly` **createdTimestamp**: `number`
Defined in: [sdk/js/src/interactions/base.ts:24](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L24)
When the host received it, ms.
#### Inherited from
[`BaseInteraction`](/docs/reference/js/zaun-bot/classes/baseinteraction/).[`createdTimestamp`](/docs/reference/js/zaun-bot/classes/baseinteraction/#createdtimestamp)
***
### deferred
> **deferred**: `boolean` = `false`
Defined in: [sdk/js/src/interactions/base.ts:30](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L30)
Whether the response was deferred.
#### Inherited from
[`BaseInteraction`](/docs/reference/js/zaun-bot/classes/baseinteraction/).[`deferred`](/docs/reference/js/zaun-bot/classes/baseinteraction/#deferred)
***
### id
> `readonly` **id**: `string`
Defined in: [sdk/js/src/interactions/base.ts:13](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L13)
The interaction id.
#### Inherited from
[`BaseInteraction`](/docs/reference/js/zaun-bot/classes/baseinteraction/).[`id`](/docs/reference/js/zaun-bot/classes/baseinteraction/#id)
***
### locale
> `readonly` **locale**: `string`
Defined in: [sdk/js/src/interactions/base.ts:22](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L22)
The invoker's locale (BCP 47), if their client sent one.
#### Inherited from
[`BaseInteraction`](/docs/reference/js/zaun-bot/classes/baseinteraction/).[`locale`](/docs/reference/js/zaun-bot/classes/baseinteraction/#locale)
***
### member
> `readonly` **member**: [`Member`](/docs/reference/js/zaun-bot/classes/member/)
Defined in: [sdk/js/src/interactions/base.ts:18](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L18)
Who triggered it: `interaction.member.send(...)` sends them a DM.
#### Inherited from
[`BaseInteraction`](/docs/reference/js/zaun-bot/classes/baseinteraction/).[`member`](/docs/reference/js/zaun-bot/classes/baseinteraction/#member)
***
### options
> `readonly` **options**: [`CommandInteractionOptionResolver`](/docs/reference/js/zaun-bot/classes/commandinteractionoptionresolver/)
Defined in: [sdk/js/src/interactions/command.ts:79](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/command.ts#L79)
***
### raw
> `readonly` **raw**: `Interaction`
Defined in: [sdk/js/src/interactions/base.ts:26](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L26)
The WIT interaction, for anything the classes do not expose.
#### Inherited from
[`BaseInteraction`](/docs/reference/js/zaun-bot/classes/baseinteraction/).[`raw`](/docs/reference/js/zaun-bot/classes/baseinteraction/#raw)
***
### replied
> **replied**: `boolean` = `false`
Defined in: [sdk/js/src/interactions/base.ts:28](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L28)
Whether an initial response was sent.
#### Inherited from
[`BaseInteraction`](/docs/reference/js/zaun-bot/classes/baseinteraction/).[`replied`](/docs/reference/js/zaun-bot/classes/baseinteraction/#replied)
## Accessors
### userId
#### Get Signature
> **get** **userId**(): `string`
Defined in: [sdk/js/src/interactions/base.ts:44](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L44)
The invoker's member id.
##### Returns
`string`
#### Inherited from
[`BaseInteraction`](/docs/reference/js/zaun-bot/classes/baseinteraction/).[`userId`](/docs/reference/js/zaun-bot/classes/baseinteraction/#userid)
## Methods
### isAnySelectMenu()
> **isAnySelectMenu**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:67](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L67)
#### Returns
`boolean`
#### Inherited from
[`BaseInteraction`](/docs/reference/js/zaun-bot/classes/baseinteraction/).[`isAnySelectMenu`](/docs/reference/js/zaun-bot/classes/baseinteraction/#isanyselectmenu)
***
### isAutocomplete()
> **isAutocomplete**(): `this is AutocompleteInteraction`
Defined in: [sdk/js/src/interactions/command.ts:92](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/command.ts#L92)
#### Returns
`this is AutocompleteInteraction`
#### Overrides
[`BaseInteraction`](/docs/reference/js/zaun-bot/classes/baseinteraction/).[`isAutocomplete`](/docs/reference/js/zaun-bot/classes/baseinteraction/#isautocomplete)
***
### isButton()
> **isButton**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:61](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L61)
#### Returns
`boolean`
#### Inherited from
[`BaseInteraction`](/docs/reference/js/zaun-bot/classes/baseinteraction/).[`isButton`](/docs/reference/js/zaun-bot/classes/baseinteraction/#isbutton)
***
### isChannelSelectMenu()
> **isChannelSelectMenu**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:66](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L66)
#### Returns
`boolean`
#### Inherited from
[`BaseInteraction`](/docs/reference/js/zaun-bot/classes/baseinteraction/).[`isChannelSelectMenu`](/docs/reference/js/zaun-bot/classes/baseinteraction/#ischannelselectmenu)
***
### isChatInputCommand()
> **isChatInputCommand**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:55](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L55)
#### Returns
`boolean`
#### Inherited from
[`BaseInteraction`](/docs/reference/js/zaun-bot/classes/baseinteraction/).[`isChatInputCommand`](/docs/reference/js/zaun-bot/classes/baseinteraction/#ischatinputcommand)
***
### isCommand()
> **isCommand**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:59](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L59)
#### Returns
`boolean`
#### Inherited from
[`BaseInteraction`](/docs/reference/js/zaun-bot/classes/baseinteraction/).[`isCommand`](/docs/reference/js/zaun-bot/classes/baseinteraction/#iscommand)
***
### isContextMenuCommand()
> **isContextMenuCommand**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:56](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L56)
#### Returns
`boolean`
#### Inherited from
[`BaseInteraction`](/docs/reference/js/zaun-bot/classes/baseinteraction/).[`isContextMenuCommand`](/docs/reference/js/zaun-bot/classes/baseinteraction/#iscontextmenucommand)
***
### isMentionableSelectMenu()
> **isMentionableSelectMenu**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:65](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L65)
#### Returns
`boolean`
#### Inherited from
[`BaseInteraction`](/docs/reference/js/zaun-bot/classes/baseinteraction/).[`isMentionableSelectMenu`](/docs/reference/js/zaun-bot/classes/baseinteraction/#ismentionableselectmenu)
***
### isMessageComponent()
> **isMessageComponent**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:60](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L60)
#### Returns
`boolean`
#### Inherited from
[`BaseInteraction`](/docs/reference/js/zaun-bot/classes/baseinteraction/).[`isMessageComponent`](/docs/reference/js/zaun-bot/classes/baseinteraction/#ismessagecomponent)
***
### isMessageContextMenuCommand()
> **isMessageContextMenuCommand**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:58](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L58)
#### Returns
`boolean`
#### Inherited from
[`BaseInteraction`](/docs/reference/js/zaun-bot/classes/baseinteraction/).[`isMessageContextMenuCommand`](/docs/reference/js/zaun-bot/classes/baseinteraction/#ismessagecontextmenucommand)
***
### isModalSubmit()
> **isModalSubmit**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:68](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L68)
#### Returns
`boolean`
#### Inherited from
[`BaseInteraction`](/docs/reference/js/zaun-bot/classes/baseinteraction/).[`isModalSubmit`](/docs/reference/js/zaun-bot/classes/baseinteraction/#ismodalsubmit)
***
### isRepliable()
> **isRepliable**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:70](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L70)
#### Returns
`boolean`
#### Inherited from
[`BaseInteraction`](/docs/reference/js/zaun-bot/classes/baseinteraction/).[`isRepliable`](/docs/reference/js/zaun-bot/classes/baseinteraction/#isrepliable)
***
### isRoleSelectMenu()
> **isRoleSelectMenu**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:64](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L64)
#### Returns
`boolean`
#### Inherited from
[`BaseInteraction`](/docs/reference/js/zaun-bot/classes/baseinteraction/).[`isRoleSelectMenu`](/docs/reference/js/zaun-bot/classes/baseinteraction/#isroleselectmenu)
***
### isStringSelectMenu()
> **isStringSelectMenu**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:62](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L62)
#### Returns
`boolean`
#### Inherited from
[`BaseInteraction`](/docs/reference/js/zaun-bot/classes/baseinteraction/).[`isStringSelectMenu`](/docs/reference/js/zaun-bot/classes/baseinteraction/#isstringselectmenu)
***
### isUserContextMenuCommand()
> **isUserContextMenuCommand**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:57](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L57)
#### Returns
`boolean`
#### Inherited from
[`BaseInteraction`](/docs/reference/js/zaun-bot/classes/baseinteraction/).[`isUserContextMenuCommand`](/docs/reference/js/zaun-bot/classes/baseinteraction/#isusercontextmenucommand)
***
### isUserSelectMenu()
> **isUserSelectMenu**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:63](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L63)
#### Returns
`boolean`
#### Inherited from
[`BaseInteraction`](/docs/reference/js/zaun-bot/classes/baseinteraction/).[`isUserSelectMenu`](/docs/reference/js/zaun-bot/classes/baseinteraction/#isuserselectmenu)
***
### respond()
> **respond**(`choices`): `void`
Defined in: [sdk/js/src/interactions/command.ts:95](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/command.ts#L95)
Up to 25 suggestions.
#### Parameters
##### choices
[`AutocompleteChoice`](/docs/reference/js/zaun-bot/interfaces/autocompletechoice/)[]
#### Returns
`void`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/classes/baseinteraction/
---
# BaseInteraction
Defined in: [sdk/js/src/interactions/base.ts:11](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L11)
Everything an interaction has, whatever its type.
## Extended by
- [`RepliableInteraction`](/docs/reference/js/zaun-bot/classes/repliableinteraction/)
- [`AutocompleteInteraction`](/docs/reference/js/zaun-bot/classes/autocompleteinteraction/)
## Constructors
### Constructor
> **new BaseInteraction**(`raw`): `BaseInteraction`
Defined in: [sdk/js/src/interactions/base.ts:32](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L32)
#### Parameters
##### raw
`Interaction`
#### Returns
`BaseInteraction`
## Properties
### appPermissions
> `readonly` **appPermissions**: `bigint`
Defined in: [sdk/js/src/interactions/base.ts:20](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L20)
The bot's effective permissions in the channel.
***
### botId
> `readonly` **botId**: `string`
Defined in: [sdk/js/src/interactions/base.ts:15](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L15)
The bot's id in this community.
***
### channelId
> `readonly` **channelId**: `string`
Defined in: [sdk/js/src/interactions/base.ts:16](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L16)
***
### createdTimestamp
> `readonly` **createdTimestamp**: `number`
Defined in: [sdk/js/src/interactions/base.ts:24](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L24)
When the host received it, ms.
***
### deferred
> **deferred**: `boolean` = `false`
Defined in: [sdk/js/src/interactions/base.ts:30](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L30)
Whether the response was deferred.
***
### id
> `readonly` **id**: `string`
Defined in: [sdk/js/src/interactions/base.ts:13](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L13)
The interaction id.
***
### locale
> `readonly` **locale**: `string`
Defined in: [sdk/js/src/interactions/base.ts:22](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L22)
The invoker's locale (BCP 47), if their client sent one.
***
### member
> `readonly` **member**: [`Member`](/docs/reference/js/zaun-bot/classes/member/)
Defined in: [sdk/js/src/interactions/base.ts:18](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L18)
Who triggered it: `interaction.member.send(...)` sends them a DM.
***
### raw
> `readonly` **raw**: `Interaction`
Defined in: [sdk/js/src/interactions/base.ts:26](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L26)
The WIT interaction, for anything the classes do not expose.
***
### replied
> **replied**: `boolean` = `false`
Defined in: [sdk/js/src/interactions/base.ts:28](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L28)
Whether an initial response was sent.
## Accessors
### userId
#### Get Signature
> **get** **userId**(): `string`
Defined in: [sdk/js/src/interactions/base.ts:44](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L44)
The invoker's member id.
##### Returns
`string`
## Methods
### isAnySelectMenu()
> **isAnySelectMenu**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:67](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L67)
#### Returns
`boolean`
***
### isAutocomplete()
> **isAutocomplete**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:69](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L69)
#### Returns
`boolean`
***
### isButton()
> **isButton**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:61](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L61)
#### Returns
`boolean`
***
### isChannelSelectMenu()
> **isChannelSelectMenu**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:66](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L66)
#### Returns
`boolean`
***
### isChatInputCommand()
> **isChatInputCommand**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:55](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L55)
#### Returns
`boolean`
***
### isCommand()
> **isCommand**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:59](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L59)
#### Returns
`boolean`
***
### isContextMenuCommand()
> **isContextMenuCommand**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:56](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L56)
#### Returns
`boolean`
***
### isMentionableSelectMenu()
> **isMentionableSelectMenu**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:65](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L65)
#### Returns
`boolean`
***
### isMessageComponent()
> **isMessageComponent**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:60](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L60)
#### Returns
`boolean`
***
### isMessageContextMenuCommand()
> **isMessageContextMenuCommand**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:58](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L58)
#### Returns
`boolean`
***
### isModalSubmit()
> **isModalSubmit**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:68](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L68)
#### Returns
`boolean`
***
### isRepliable()
> **isRepliable**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:70](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L70)
#### Returns
`boolean`
***
### isRoleSelectMenu()
> **isRoleSelectMenu**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:64](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L64)
#### Returns
`boolean`
***
### isStringSelectMenu()
> **isStringSelectMenu**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:62](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L62)
#### Returns
`boolean`
***
### isUserContextMenuCommand()
> **isUserContextMenuCommand**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:57](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L57)
#### Returns
`boolean`
***
### isUserSelectMenu()
> **isUserSelectMenu**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:63](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L63)
#### Returns
`boolean`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/classes/bot/
---
# Bot
Defined in: [sdk/js/src/bot.ts:45](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/bot.ts#L45)
One Zaun bot.
## Constructors
### Constructor
> **new Bot**(): `Bot`
#### Returns
`Bot`
## Properties
### audio
> `readonly` **audio**: `object`
Defined in: [sdk/js/src/bot.ts:58](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/bot.ts#L58)
Low-level audio output in the bot's voice channel: write Opus or PCM yourself.
#### bufferedMs()
> **bufferedMs**(): `number`
The audio written and not yet played, in ms (0 without a stream).
##### Returns
`number`
#### clear()
> **clear**(): `void`
Drops everything buffered at once; the stream stays open.
##### Returns
`void`
#### close()
> **close**(`drain?`): `void`
Closes the stream, after the buffer has played (`drain`, the default) or at once.
##### Parameters
###### drain?
`boolean` = `true`
##### Returns
`void`
#### open()
> **open**(`options`): `void`
Opens the stream, 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 (PCM without an encoder).
##### Parameters
###### options
[`AudioStreamOptions`](/docs/reference/js/zaun-bot/interfaces/audiostreamoptions/)
##### Returns
`void`
#### writeOpus()
> **writeOpus**(`packets`): `number`
Opus packets (2.5–120 ms each, ≤ 1000 bytes); returns the ms buffered (`BUSY` past 3 s).
##### Parameters
###### packets
`Uint8Array`\<`ArrayBufferLike`\>[]
##### Returns
`number`
#### writePcm()
> **writePcm**(`samples`): `number`
Interleaved samples, any count; returns the ms buffered (`BUSY` past 3 s).
##### Parameters
###### samples
`Int16Array`
##### Returns
`number`
***
### commands
> `readonly` **commands**: `Map`\<`string`, [`Command`](/docs/reference/js/zaun-bot/interfaces/command/)\>
Defined in: [sdk/js/src/bot.ts:64](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/bot.ts#L64)
Commands by name.
***
### community
> `readonly` **community**: `object` = `api.community`
Defined in: [sdk/js/src/bot.ts:52](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/bot.ts#L52)
#### addRole
> **addRole**: (`memberId`, `roleId`) => `void`
##### Parameters
###### memberId
`string`
###### roleId
`string`
##### Returns
`void`
#### getChannel
> **getChannel**: (`id`) => `Channel`
##### Parameters
###### id
`string`
##### Returns
`Channel`
#### getMember
> **getMember**: (`id`) => [`Member`](/docs/reference/js/zaun-bot/classes/member/)
##### Parameters
###### id
`string`
##### Returns
[`Member`](/docs/reference/js/zaun-bot/classes/member/)
#### getRole
> **getRole**: (`id`) => `Role`
##### Parameters
###### id
`string`
##### Returns
`Role`
#### kick
> **kick**: (`memberId`, `reason?`) => `void`
##### Parameters
###### memberId
`string`
###### reason?
`string`
##### Returns
`void`
#### listChannels
> **listChannels**: () => `Channel`[]
##### Returns
`Channel`[]
#### listMembers
> **listMembers**: (`options`) => [`Member`](/docs/reference/js/zaun-bot/classes/member/)[]
##### Parameters
###### options?
###### after?
`string`
###### limit?
`number`
##### Returns
[`Member`](/docs/reference/js/zaun-bot/classes/member/)[]
#### listRoles
> **listRoles**: () => `Role`[]
##### Returns
`Role`[]
#### removeRole
> **removeRole**: (`memberId`, `roleId`) => `void`
##### Parameters
###### memberId
`string`
###### roleId
`string`
##### Returns
`void`
#### timeout
> **timeout**: (`memberId`, `until`, `reason?`) => `void`
Times a member out until `until` (ms); `null` clears it.
##### Parameters
###### memberId
`string`
###### until
`number`
###### reason?
`string`
##### Returns
`void`
***
### config
> **config**: `ReadonlyMap`\<`string`, `string`\>
Defined in: [sdk/js/src/bot.ts:69](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/bot.ts#L69)
The bot's configuration: the keys its manifest declares in `[config]`, with the owner's
values or the defaults. Set at `init`, replaced on every change (`config` event).
***
### dms
> `readonly` **dms**: `object`
Defined in: [sdk/js/src/bot.ts:54](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/bot.ts#L54)
Direct messages (capability `dms`).
#### close()
> **close**(`channelId`): `void`
Hides a DM from the bot's list.
##### Parameters
###### channelId
`string`
##### Returns
`void`
#### listOpen()
> **listOpen**(): `Channel`[]
The DMs the bot has open.
##### Returns
`Channel`[]
#### open()
> **open**(`memberId`): `Channel`
The DM with `memberId`, opened when there is none.
##### Parameters
###### memberId
`string`
##### Returns
`Channel`
***
### http
> `readonly` **http**: `object` = `api.http`
Defined in: [sdk/js/src/bot.ts:50](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/bot.ts#L50)
#### fetch()
> **fetch**(`url`, `init?`): [`HttpResponse`](/docs/reference/js/zaun-bot/interfaces/httpresponse/)
##### Parameters
###### url
`string`
###### init?
###### body?
`string` \| `Uint8Array`\<`ArrayBufferLike`\>
###### headers?
`Record`\<`string`, `string`\>
###### method?
`string`
###### timeoutMs?
`number`
##### Returns
[`HttpResponse`](/docs/reference/js/zaun-bot/interfaces/httpresponse/)
***
### log
> `readonly` **log**: `Record`\<`"trace"` \| `"debug"` \| `"info"` \| `"warn"` \| `"error"`, (...`args`) => `void`\> = `api.log`
Defined in: [sdk/js/src/bot.ts:51](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/bot.ts#L51)
***
### me
> **me**: [`Me`](/docs/reference/js/zaun-bot/interfaces/me/)
Defined in: [sdk/js/src/bot.ts:62](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/bot.ts#L62)
Who the bot is, once the host's `ready` event arrived.
***
### messages
> `readonly` **messages**: `object` = `api.messages`
Defined in: [sdk/js/src/bot.ts:47](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/bot.ts#L47)
Host APIs (also importable on their own).
#### delete()
> **delete**(`channelId`, `messageId`): `void`
##### Parameters
###### channelId
`string`
###### messageId
`string`
##### Returns
`void`
#### dm()
> **dm**(`memberId`, `payload`): `object`
A direct message to `memberId` (capability `dms`): opens the DM when needed. Returns the
DM's channel id and the message id.
##### Parameters
###### memberId
`string`
###### payload
[`MessagePayload`](/docs/reference/js/zaun-bot/type-aliases/messagepayload/)
##### Returns
`object`
###### channelId
> **channelId**: `string`
###### messageId
> **messageId**: `string`
#### edit()
> **edit**(`channelId`, `messageId`, `payload`): `void`
Edits one of the bot's messages.
##### Parameters
###### channelId
`string`
###### messageId
`string`
###### payload
[`MessagePayload`](/docs/reference/js/zaun-bot/type-aliases/messagepayload/)
##### Returns
`void`
#### history()
> **history**(`channelId`, `options?`): [`Message`](/docs/reference/js/zaun-bot/classes/message/)[]
Up to `limit` (1–100) messages before the sequence `before`.
##### Parameters
###### channelId
`string`
###### options?
###### before?
`number`
###### limit?
`number`
##### Returns
[`Message`](/docs/reference/js/zaun-bot/classes/message/)[]
#### react()
> **react**(`channelId`, `messageId`, `emoji`): `void`
##### Parameters
###### channelId
`string`
###### messageId
`string`
###### emoji
`string`
##### Returns
`void`
#### send()
> **send**(`channelId`, `payload`, `options?`): `string`
Posts a message; returns its id.
##### Parameters
###### channelId
`string`
###### payload
[`MessagePayload`](/docs/reference/js/zaun-bot/type-aliases/messagepayload/)
###### options?
###### replyTo?
`string`
##### Returns
`string`
#### unreact()
> **unreact**(`channelId`, `messageId`, `emoji`): `void`
##### Parameters
###### channelId
`string`
###### messageId
`string`
###### emoji
`string`
##### Returns
`void`
#### upload()
> **upload**(`channelId`, `name`, `mime`, `bytes`): `string`
Uploads a file for the bot's next message (capability `attachments`); returns its id.
##### Parameters
###### channelId
`string`
###### name
`string`
###### mime
`string`
###### bytes
`Uint8Array`
##### Returns
`string`
***
### presence
> `readonly` **presence**: `object`
Defined in: [sdk/js/src/bot.ts:60](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/bot.ts#L60)
The bot's status, activity and custom status text.
#### clearStatus()
> **clearStatus**(): `void`
Clears the custom status text and emoji.
##### Returns
`void`
#### set()
> **set**(`status`, `activity?`): `void`
Sets the status and activity (none: no activity).
##### Parameters
###### status
[`PresenceStatus`](/docs/reference/js/zaun-bot/type-aliases/presencestatus/)
###### activity?
[`Activity`](/docs/reference/js/zaun-bot/classes/activity/)
##### Returns
`void`
#### setStatus()
> **setStatus**(`text?`, `emoji?`, `expiresAt?`): `void`
Sets the custom status text and emoji, cleared by the host at `expiresAt` (ms) if given.
##### Parameters
###### text?
`string`
###### emoji?
`string`
###### expiresAt?
`number` \| `bigint`
##### Returns
`void`
#### setStatusText()
> **setStatusText**(`text`): `void`
Sets the custom status text, kept until changed.
##### Parameters
###### text
`string`
##### Returns
`void`
***
### storage
> `readonly` **storage**: `object` = `api.storage`
Defined in: [sdk/js/src/bot.ts:48](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/bot.ts#L48)
#### delete()
> **delete**(`key`): `void`
##### Parameters
###### key
`string`
##### Returns
`void`
#### get()
> **get**(`key`): `Uint8Array`\<`ArrayBufferLike`\>
##### Parameters
###### key
`string`
##### Returns
`Uint8Array`\<`ArrayBufferLike`\>
#### getJSON()
> **getJSON**\<`T`\>(`key`): `T`
A JSON value (bigints are not supported by JSON).
##### Type Parameters
###### T
`T` = `unknown`
##### Parameters
###### key
`string`
##### Returns
`T`
#### getString()
> **getString**(`key`): `string`
##### Parameters
###### key
`string`
##### Returns
`string`
#### keys()
> **keys**(`prefix?`, `options?`): `string`[]
Keys starting with `prefix`, in order.
##### Parameters
###### prefix?
`string` = `''`
###### options?
###### after?
`string`
###### limit?
`number`
##### Returns
`string`[]
#### set()
> **set**(`key`, `value`): `void`
##### Parameters
###### key
`string`
###### value
`Uint8Array`
##### Returns
`void`
#### setJSON()
> **setJSON**(`key`, `value`): `void`
##### Parameters
###### key
`string`
###### value
`unknown`
##### Returns
`void`
#### setString()
> **setString**(`key`, `value`): `void`
##### Parameters
###### key
`string`
###### value
`string`
##### Returns
`void`
***
### timers
> `readonly` **timers**: `object` = `api.timers`
Defined in: [sdk/js/src/bot.ts:49](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/bot.ts#L49)
#### after()
> **after**(`ms`, `tag`): `number`
Once after `ms`; returns the timer id.
##### Parameters
###### ms
`number`
###### tag
`string`
##### Returns
`number`
#### cancel()
> **cancel**(`id`): `void`
##### Parameters
###### id
`number`
##### Returns
`void`
#### every()
> **every**(`ms`, `tag`): `number`
Every `ms` (≥ 1000).
##### Parameters
###### ms
`number`
###### tag
`string`
##### Returns
`number`
***
### voice
> `readonly` **voice**: `object`
Defined in: [sdk/js/src/bot.ts:56](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/bot.ts#L56)
Voice channels and music (capability `voice`).
#### clearQueue()
> **clearQueue**(): `void`
Empties the queue; unlike `stop`, the current track keeps playing.
##### Returns
`void`
#### endStream()
> **endStream**(): `void`
The `pushed` track ends once its buffer has played.
##### Returns
`void`
#### enqueue()
> **enqueue**(`t`): `number`
Adds to the queue (≤ 100); returns its length.
##### Parameters
###### t
`string` \| [`TrackOptions`](/docs/reference/js/zaun-bot/type-aliases/trackoptions/)
##### Returns
`number`
#### join()
> **join**(`channelId`): `void`
Joins a voice channel (leaving another first); returns once audio can flow.
##### Parameters
###### channelId
`string`
##### Returns
`void`
#### leave()
> **leave**(): `void`
Leaves; playback stops and the queue clears.
##### Returns
`void`
#### moveTrack()
> **moveTrack**(`from`, `to`): `void`
Moves the queued track at `from` to `to` (both 0-based); the tracks between shift.
##### Parameters
###### from
`number`
###### to
`number`
##### Returns
`void`
#### pause()
> **pause**(): `void`
##### Returns
`void`
#### play()
> **play**(`t`): `void`
Plays now, replacing the current track (a string is a URL).
##### Parameters
###### t
`string` \| [`TrackOptions`](/docs/reference/js/zaun-bot/type-aliases/trackoptions/)
##### Returns
`void`
#### push()
> **push**(`packets`): `number`
Opus packets for the current `pushed` track; returns ms buffered (`BUSY` past 3 s).
##### Parameters
###### packets
`Uint8Array`\<`ArrayBufferLike`\>[]
##### Returns
`number`
#### remove()
> **remove**(`index`): `string`
Removes the queued track at `index` (0 plays next); returns its title. Throws `NOT_FOUND`
past the end. Like every queue call, `UNSUPPORTED` on hosts without queue control.
##### Parameters
###### index
`number`
##### Returns
`string`
#### resume()
> **resume**(): `void`
##### Returns
`void`
#### seek()
> **seek**(`ms`): `void`
Jumps to `ms` into the current track; past the end, the track ends. Throws `UNSUPPORTED` for
live streams and pushed audio, and on hosts that cannot seek; `CONFLICT` when nothing plays.
##### Parameters
###### ms
`number`
##### Returns
`void`
#### setLoop()
> **setLoop**(`mode`): `void`
Sets what happens when a track ends.
##### Parameters
###### mode
`LoopMode`
##### Returns
`void`
#### setVolume()
> **setVolume**(`percent`): `void`
Sets the playback volume, 0–200 % (100 when the bot joins). Throws `ZaunError` `BAD_REQUEST`
(detail `percent`) outside 0–200, checked before the call, and `UNSUPPORTED` on hosts without
an Opus encoder, which is most of them for now: tell the member and go on.
##### Parameters
###### percent
`number`
##### Returns
`void`
#### shuffle()
> **shuffle**(): `void`
Puts the queue in a random order; the current track keeps playing.
##### Returns
`void`
#### skip()
> **skip**(): `void`
##### Returns
`void`
#### state()
> **state**(): [`VoiceState`](/docs/reference/js/zaun-bot/type-aliases/voicestate/)
##### Returns
[`VoiceState`](/docs/reference/js/zaun-bot/type-aliases/voicestate/)
#### stop()
> **stop**(): `void`
Ends the current track and clears the queue.
##### Returns
`void`
## Methods
### command()
#### Call Signature
> **command**(`data`, `execute?`, `autocomplete?`): `this`
Defined in: [sdk/js/src/bot.ts:76](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/bot.ts#L76)
Registers a command; `execute` answers it (or handle it in `interactionCreate`).
##### Parameters
###### data
[`CommandLike`](/docs/reference/js/zaun-bot/interfaces/commandlike/)
###### execute?
(`i`) => `unknown`
###### autocomplete?
(`i`) => `unknown`
##### Returns
`this`
#### Call Signature
> **command**(`command`): `this`
Defined in: [sdk/js/src/bot.ts:77](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/bot.ts#L77)
Registers a command; `execute` answers it (or handle it in `interactionCreate`).
##### Parameters
###### command
[`Command`](/docs/reference/js/zaun-bot/interfaces/command/)
##### Returns
`this`
***
### component()
> **component**(`match`, `handler`): `this`
Defined in: [sdk/js/src/bot.ts:85](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/bot.ts#L85)
Handles clicks and choices whose custom id matches.
#### Parameters
##### match
`Match`
##### handler
(`i`) => `unknown`
#### Returns
`this`
***
### emit()
> **emit**\<`K`\>(`event`, ...`args`): `void`
Defined in: [sdk/js/src/bot.ts:110](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/bot.ts#L110)
Calls every listener of `event`; errors go to `error` listeners and the log.
#### Type Parameters
##### K
`K` *extends* keyof [`BotEvents`](/docs/reference/js/zaun-bot/interfaces/botevents/)
#### Parameters
##### event
`K`
##### args
...`Parameters`\<[`BotEvents`](/docs/reference/js/zaun-bot/interfaces/botevents/)\[`K`\]\>
#### Returns
`void`
***
### exports()
> **exports**(): `object`
Defined in: [sdk/js/src/bot.ts:160](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/bot.ts#L160)
The `zaun:bot/bot` world's exports; export them from your entry module.
#### Returns
`object`
##### init
> **init**: (`config`) => `Registration`
###### Parameters
###### config
\[`string`, `string`\][]
###### Returns
`Registration`
##### onAutocomplete
> **onAutocomplete**: (`interaction`) => `Choice`[]
###### Parameters
###### interaction
`Interaction`
###### Returns
`Choice`[]
##### onConfigChange
> **onConfigChange**: (`config`) => `void`
###### Parameters
###### config
\[`string`, `string`\][]
###### Returns
`void`
##### onEvent
> **onEvent**: (`event`) => `void`
###### Parameters
###### event
`Event`
###### Returns
`void`
##### onInteraction
> **onInteraction**: (`interaction`) => `void`
###### Parameters
###### interaction
`Interaction`
###### Returns
`void`
##### onTimer
> **onTimer**: (`id`, `tag`) => `void`
###### Parameters
###### id
`bigint`
###### tag
`string`
###### Returns
`void`
##### onVoiceEvent
> **onVoiceEvent**: (`event`) => `void`
###### Parameters
###### event
`VoiceEvent`
###### Returns
`void`
***
### modal()
> **modal**(`match`, `handler`): `this`
Defined in: [sdk/js/src/bot.ts:91](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/bot.ts#L91)
Handles submitted modals whose custom id matches.
#### Parameters
##### match
`Match`
##### handler
(`i`) => `unknown`
#### Returns
`this`
***
### off()
> **off**\<`K`\>(`event`, `listener`): `this`
Defined in: [sdk/js/src/bot.ts:103](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/bot.ts#L103)
#### Type Parameters
##### K
`K` *extends* keyof [`BotEvents`](/docs/reference/js/zaun-bot/interfaces/botevents/)
#### Parameters
##### event
`K`
##### listener
[`BotEvents`](/docs/reference/js/zaun-bot/interfaces/botevents/)\[`K`\]
#### Returns
`this`
***
### on()
> **on**\<`K`\>(`event`, `listener`): `this`
Defined in: [sdk/js/src/bot.ts:96](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/bot.ts#L96)
#### Type Parameters
##### K
`K` *extends* keyof [`BotEvents`](/docs/reference/js/zaun-bot/interfaces/botevents/)
#### Parameters
##### event
`K`
##### listener
[`BotEvents`](/docs/reference/js/zaun-bot/interfaces/botevents/)\[`K`\]
#### Returns
`this`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/classes/buttonbuilder/
---
# ButtonBuilder
Defined in: [sdk/js/src/builders/button.ts:17](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/button.ts#L17)
Type 2.
## Constructors
### Constructor
> **new ButtonBuilder**(): `ButtonBuilder`
#### Returns
`ButtonBuilder`
## Accessors
### customId
#### Get Signature
> **get** **customId**(): `string`
Defined in: [sdk/js/src/builders/button.ts:52](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/button.ts#L52)
The custom id, if any.
##### Returns
`string`
## Methods
### setCustomId()
> **setCustomId**(`id`): `this`
Defined in: [sdk/js/src/builders/button.ts:37](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/button.ts#L37)
#### Parameters
##### id
`string`
#### Returns
`this`
***
### setDisabled()
> **setDisabled**(`disabled?`): `this`
Defined in: [sdk/js/src/builders/button.ts:47](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/button.ts#L47)
#### Parameters
##### disabled?
`boolean` = `true`
#### Returns
`this`
***
### setEmoji()
> **setEmoji**(`value`): `this`
Defined in: [sdk/js/src/builders/button.ts:33](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/button.ts#L33)
#### Parameters
##### value
`string`
#### Returns
`this`
***
### setLabel()
> **setLabel**(`label`): `this`
Defined in: [sdk/js/src/builders/button.ts:29](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/button.ts#L29)
#### Parameters
##### label
`string`
#### Returns
`this`
***
### setStyle()
> **setStyle**(`style`): `this`
Defined in: [sdk/js/src/builders/button.ts:25](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/button.ts#L25)
#### Parameters
##### style
[`ButtonStyle`](/docs/reference/js/zaun-bot/type-aliases/buttonstyle/)
#### Returns
`this`
***
### setURL()
> **setURL**(`url`): `this`
Defined in: [sdk/js/src/builders/button.ts:42](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/button.ts#L42)
A link button (`https://` only; opened after the reader confirms). Sets the style.
#### Parameters
##### url
`string`
#### Returns
`this`
***
### toWit()
> **toWit**(): `Button`
Defined in: [sdk/js/src/builders/button.ts:56](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/button.ts#L56)
#### Returns
`Button`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/classes/channelselectmenubuilder/
---
# ChannelSelectMenuBuilder
Defined in: [sdk/js/src/builders/select.ts:166](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/select.ts#L166)
Type 8: channels.
## Extends
- `EntitySelectBuilder`
## Constructors
### Constructor
> **new ChannelSelectMenuBuilder**(): `ChannelSelectMenuBuilder`
#### Returns
`ChannelSelectMenuBuilder`
#### Inherited from
`EntitySelectBuilder.constructor`
## Accessors
### customId
#### Get Signature
> **get** **customId**(): `string`
Defined in: [sdk/js/src/builders/select.ts:78](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/select.ts#L78)
##### Returns
`string`
#### Inherited from
`EntitySelectBuilder.customId`
## Methods
### setChannelTypes()
> **setChannelTypes**(...`kinds`): `this`
Defined in: [sdk/js/src/builders/select.ts:169](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/select.ts#L169)
Channel kinds offered (`text`, `voice`, `announcement`, …).
#### Parameters
##### kinds
...`string`[]
#### Returns
`this`
***
### setCustomId()
> **setCustomId**(`id`): `this`
Defined in: [sdk/js/src/builders/select.ts:53](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/select.ts#L53)
#### Parameters
##### id
`string`
#### Returns
`this`
#### Inherited from
`EntitySelectBuilder.setCustomId`
***
### setDefaultChannels()
> **setDefaultChannels**(...`ids`): `this`
Defined in: [sdk/js/src/builders/select.ts:173](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/select.ts#L173)
#### Parameters
##### ids
...`string`[]
#### Returns
`this`
***
### setDisabled()
> **setDisabled**(`disabled?`): `this`
Defined in: [sdk/js/src/builders/select.ts:74](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/select.ts#L74)
#### Parameters
##### disabled?
`boolean` = `true`
#### Returns
`this`
#### Inherited from
`EntitySelectBuilder.setDisabled`
***
### setMaxValues()
> **setMaxValues**(`n`): `this`
Defined in: [sdk/js/src/builders/select.ts:65](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/select.ts#L65)
#### Parameters
##### n
`number`
#### Returns
`this`
#### Inherited from
`EntitySelectBuilder.setMaxValues`
***
### setMinValues()
> **setMinValues**(`n`): `this`
Defined in: [sdk/js/src/builders/select.ts:61](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/select.ts#L61)
#### Parameters
##### n
`number`
#### Returns
`this`
#### Inherited from
`EntitySelectBuilder.setMinValues`
***
### setPlaceholder()
> **setPlaceholder**(`placeholder`): `this`
Defined in: [sdk/js/src/builders/select.ts:57](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/select.ts#L57)
#### Parameters
##### placeholder
`string`
#### Returns
`this`
#### Inherited from
`EntitySelectBuilder.setPlaceholder`
***
### setRequired()
> **setRequired**(`required?`): `this`
Defined in: [sdk/js/src/builders/select.ts:70](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/select.ts#L70)
In a modal: whether an answer is needed (default true).
#### Parameters
##### required?
`boolean` = `true`
#### Returns
`this`
#### Inherited from
`EntitySelectBuilder.setRequired`
***
### toWit()
> **toWit**(): `EntitySelect`
Defined in: [sdk/js/src/builders/select.ts:124](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/select.ts#L124)
#### Returns
`EntitySelect`
#### Inherited from
`EntitySelectBuilder.toWit`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/classes/chatinputcommandinteraction/
---
# ChatInputCommandInteraction
Defined in: [sdk/js/src/interactions/command.ts:36](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/command.ts#L36)
`/command`.
## Extends
- `CommandInteraction`
## Constructors
### Constructor
> **new ChatInputCommandInteraction**(`raw`, `data`): `ChatInputCommandInteraction`
Defined in: [sdk/js/src/interactions/command.ts:26](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/command.ts#L26)
#### Parameters
##### raw
`Interaction`
##### data
`CommandData`
#### Returns
`ChatInputCommandInteraction`
#### Inherited from
`CommandInteraction.constructor`
## Properties
### appPermissions
> `readonly` **appPermissions**: `bigint`
Defined in: [sdk/js/src/interactions/base.ts:20](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L20)
The bot's effective permissions in the channel.
#### Inherited from
`CommandInteraction.appPermissions`
***
### botId
> `readonly` **botId**: `string`
Defined in: [sdk/js/src/interactions/base.ts:15](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L15)
The bot's id in this community.
#### Inherited from
`CommandInteraction.botId`
***
### channelId
> `readonly` **channelId**: `string`
Defined in: [sdk/js/src/interactions/base.ts:16](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L16)
#### Inherited from
`CommandInteraction.channelId`
***
### command
> `readonly` **command**: `CommandData`
Defined in: [sdk/js/src/interactions/command.ts:24](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/command.ts#L24)
The WIT command data.
#### Inherited from
`CommandInteraction.command`
***
### commandId
> `readonly` **commandId**: `string`
Defined in: [sdk/js/src/interactions/command.ts:20](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/command.ts#L20)
#### Inherited from
`CommandInteraction.commandId`
***
### commandName
> `readonly` **commandName**: `string`
Defined in: [sdk/js/src/interactions/command.ts:21](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/command.ts#L21)
#### Inherited from
`CommandInteraction.commandName`
***
### createdTimestamp
> `readonly` **createdTimestamp**: `number`
Defined in: [sdk/js/src/interactions/base.ts:24](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L24)
When the host received it, ms.
#### Inherited from
`CommandInteraction.createdTimestamp`
***
### deferred
> **deferred**: `boolean` = `false`
Defined in: [sdk/js/src/interactions/base.ts:30](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L30)
Whether the response was deferred.
#### Inherited from
`CommandInteraction.deferred`
***
### id
> `readonly` **id**: `string`
Defined in: [sdk/js/src/interactions/base.ts:13](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L13)
The interaction id.
#### Inherited from
`CommandInteraction.id`
***
### locale
> `readonly` **locale**: `string`
Defined in: [sdk/js/src/interactions/base.ts:22](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L22)
The invoker's locale (BCP 47), if their client sent one.
#### Inherited from
`CommandInteraction.locale`
***
### member
> `readonly` **member**: [`Member`](/docs/reference/js/zaun-bot/classes/member/)
Defined in: [sdk/js/src/interactions/base.ts:18](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L18)
Who triggered it: `interaction.member.send(...)` sends them a DM.
#### Inherited from
`CommandInteraction.member`
***
### options
> `readonly` **options**: [`CommandInteractionOptionResolver`](/docs/reference/js/zaun-bot/classes/commandinteractionoptionresolver/)
Defined in: [sdk/js/src/interactions/command.ts:22](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/command.ts#L22)
#### Inherited from
`CommandInteraction.options`
***
### raw
> `readonly` **raw**: `Interaction`
Defined in: [sdk/js/src/interactions/base.ts:26](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L26)
The WIT interaction, for anything the classes do not expose.
#### Inherited from
`CommandInteraction.raw`
***
### replied
> **replied**: `boolean` = `false`
Defined in: [sdk/js/src/interactions/base.ts:28](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L28)
Whether an initial response was sent.
#### Inherited from
`CommandInteraction.replied`
## Accessors
### userId
#### Get Signature
> **get** **userId**(): `string`
Defined in: [sdk/js/src/interactions/base.ts:44](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L44)
The invoker's member id.
##### Returns
`string`
#### Inherited from
`CommandInteraction.userId`
## Methods
### deferReply()
> **deferReply**(`options?`): `void`
Defined in: [sdk/js/src/interactions/base.ts:81](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L81)
Shows "thinking…" and buys 15 minutes; finish with [editReply](/docs/reference/js/zaun-bot/classes/repliableinteraction/#editreply).
#### Parameters
##### options?
###### ephemeral?
`boolean`
#### Returns
`void`
#### Inherited from
`CommandInteraction.deferReply`
***
### deleteReply()
> **deleteReply**(): `void`
Defined in: [sdk/js/src/interactions/base.ts:92](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L92)
Deletes the original response.
#### Returns
`void`
#### Inherited from
`CommandInteraction.deleteReply`
***
### editReply()
> **editReply**(`payload`): `void`
Defined in: [sdk/js/src/interactions/base.ts:87](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L87)
Replaces the original response (ends a deferred reply).
#### Parameters
##### payload
[`MessagePayload`](/docs/reference/js/zaun-bot/type-aliases/messagepayload/)
#### Returns
`void`
#### Inherited from
`CommandInteraction.editReply`
***
### followUp()
> **followUp**(`payload`): `string`
Defined in: [sdk/js/src/interactions/base.ts:97](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L97)
Another message, within 15 minutes (at most 10).
#### Parameters
##### payload
[`MessagePayload`](/docs/reference/js/zaun-bot/type-aliases/messagepayload/)
#### Returns
`string`
#### Inherited from
`CommandInteraction.followUp`
***
### isAnySelectMenu()
> **isAnySelectMenu**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:67](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L67)
#### Returns
`boolean`
#### Inherited from
`CommandInteraction.isAnySelectMenu`
***
### isAutocomplete()
> **isAutocomplete**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:69](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L69)
#### Returns
`boolean`
#### Inherited from
`CommandInteraction.isAutocomplete`
***
### isButton()
> **isButton**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:61](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L61)
#### Returns
`boolean`
#### Inherited from
`CommandInteraction.isButton`
***
### isChannelSelectMenu()
> **isChannelSelectMenu**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:66](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L66)
#### Returns
`boolean`
#### Inherited from
`CommandInteraction.isChannelSelectMenu`
***
### isChatInputCommand()
> **isChatInputCommand**(): `this is ChatInputCommandInteraction`
Defined in: [sdk/js/src/interactions/command.ts:37](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/command.ts#L37)
#### Returns
`this is ChatInputCommandInteraction`
#### Overrides
`CommandInteraction.isChatInputCommand`
***
### isCommand()
> **isCommand**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:59](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L59)
#### Returns
`boolean`
#### Inherited from
`CommandInteraction.isCommand`
***
### isContextMenuCommand()
> **isContextMenuCommand**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:56](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L56)
#### Returns
`boolean`
#### Inherited from
`CommandInteraction.isContextMenuCommand`
***
### isMentionableSelectMenu()
> **isMentionableSelectMenu**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:65](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L65)
#### Returns
`boolean`
#### Inherited from
`CommandInteraction.isMentionableSelectMenu`
***
### isMessageComponent()
> **isMessageComponent**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:60](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L60)
#### Returns
`boolean`
#### Inherited from
`CommandInteraction.isMessageComponent`
***
### isMessageContextMenuCommand()
> **isMessageContextMenuCommand**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:58](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L58)
#### Returns
`boolean`
#### Inherited from
`CommandInteraction.isMessageContextMenuCommand`
***
### isModalSubmit()
> **isModalSubmit**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:68](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L68)
#### Returns
`boolean`
#### Inherited from
`CommandInteraction.isModalSubmit`
***
### isRepliable()
> **isRepliable**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:70](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L70)
#### Returns
`boolean`
#### Inherited from
`CommandInteraction.isRepliable`
***
### isRoleSelectMenu()
> **isRoleSelectMenu**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:64](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L64)
#### Returns
`boolean`
#### Inherited from
`CommandInteraction.isRoleSelectMenu`
***
### isStringSelectMenu()
> **isStringSelectMenu**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:62](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L62)
#### Returns
`boolean`
#### Inherited from
`CommandInteraction.isStringSelectMenu`
***
### isUserContextMenuCommand()
> **isUserContextMenuCommand**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:57](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L57)
#### Returns
`boolean`
#### Inherited from
`CommandInteraction.isUserContextMenuCommand`
***
### isUserSelectMenu()
> **isUserSelectMenu**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:63](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L63)
#### Returns
`boolean`
#### Inherited from
`CommandInteraction.isUserSelectMenu`
***
### reply()
> **reply**(`payload`): `string`
Defined in: [sdk/js/src/interactions/base.ts:76](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L76)
Answers with a message in the channel (or only to the invoker with `ephemeral`).
#### Parameters
##### payload
[`MessagePayload`](/docs/reference/js/zaun-bot/type-aliases/messagepayload/)
#### Returns
`string`
#### Inherited from
`CommandInteraction.reply`
***
### showModal()
> **showModal**(`modal`): `void`
Defined in: [sdk/js/src/interactions/base.ts:105](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L105)
Opens a modal for the invoker.
#### Parameters
##### modal
[`ModalBuilder`](/docs/reference/js/zaun-bot/classes/modalbuilder/)
#### Returns
`void`
#### Inherited from
`CommandInteraction.showModal`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/classes/checkboxbuilder/
---
# CheckboxBuilder
Defined in: [sdk/js/src/builders/choices.ts:77](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/choices.ts#L77)
Type 23: one yes/no box (never required).
## Constructors
### Constructor
> **new CheckboxBuilder**(): `CheckboxBuilder`
#### Returns
`CheckboxBuilder`
## Methods
### setCustomId()
> **setCustomId**(`id`): `this`
Defined in: [sdk/js/src/builders/choices.ts:80](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/choices.ts#L80)
#### Parameters
##### id
`string`
#### Returns
`this`
***
### setDefault()
> **setDefault**(`checked?`): `this`
Defined in: [sdk/js/src/builders/choices.ts:84](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/choices.ts#L84)
#### Parameters
##### checked?
`boolean` = `true`
#### Returns
`this`
***
### toWit()
> **toWit**(): `Checkbox`
Defined in: [sdk/js/src/builders/choices.ts:88](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/choices.ts#L88)
#### Returns
`Checkbox`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/classes/checkboxgroupbuilder/
---
# CheckboxGroupBuilder
Defined in: [sdk/js/src/builders/choices.ts:41](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/choices.ts#L41)
Type 22: several choices of 1–10.
## Constructors
### Constructor
> **new CheckboxGroupBuilder**(): `CheckboxGroupBuilder`
#### Returns
`CheckboxGroupBuilder`
## Methods
### addOptions()
> **addOptions**(...`options`): `this`
Defined in: [sdk/js/src/builders/choices.ts:51](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/choices.ts#L51)
#### Parameters
##### options
...`ChoiceInput`[]
#### Returns
`this`
***
### setCustomId()
> **setCustomId**(`id`): `this`
Defined in: [sdk/js/src/builders/choices.ts:47](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/choices.ts#L47)
#### Parameters
##### id
`string`
#### Returns
`this`
***
### setMaxValues()
> **setMaxValues**(`n`): `this`
Defined in: [sdk/js/src/builders/choices.ts:59](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/choices.ts#L59)
#### Parameters
##### n
`number`
#### Returns
`this`
***
### setMinValues()
> **setMinValues**(`n`): `this`
Defined in: [sdk/js/src/builders/choices.ts:55](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/choices.ts#L55)
#### Parameters
##### n
`number`
#### Returns
`this`
***
### setRequired()
> **setRequired**(`required?`): `this`
Defined in: [sdk/js/src/builders/choices.ts:63](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/choices.ts#L63)
#### Parameters
##### required?
`boolean` = `true`
#### Returns
`this`
***
### toWit()
> **toWit**(): `CheckboxGroup`
Defined in: [sdk/js/src/builders/choices.ts:67](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/choices.ts#L67)
#### Returns
`CheckboxGroup`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/classes/commandinteractionoptionresolver/
---
# CommandInteractionOptionResolver
Defined in: [sdk/js/src/interactions/options.ts:12](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/options.ts#L12)
The options the invoker filled in, the sub-command path, and resolved objects.
## Constructors
### Constructor
> **new CommandInteractionOptionResolver**(`data`): `CommandInteractionOptionResolver`
Defined in: [sdk/js/src/interactions/options.ts:13](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/options.ts#L13)
#### Parameters
##### data
`CommandData`
#### Returns
`CommandInteractionOptionResolver`
## Accessors
### all
#### Get Signature
> **get** **all**(): readonly `ReceivedOption`[]
Defined in: [sdk/js/src/interactions/options.ts:16](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/options.ts#L16)
Every option as received (sub-command options are flattened).
##### Returns
readonly `ReceivedOption`[]
## Methods
### getAttachment()
> **getAttachment**(`name`, `required?`): `Attachment`
Defined in: [sdk/js/src/interactions/options.ts:85](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/options.ts#L85)
#### Parameters
##### name
`string`
##### required?
`boolean` = `false`
#### Returns
`Attachment`
***
### getBoolean()
#### Call Signature
> **getBoolean**(`name`, `required`): `boolean`
Defined in: [sdk/js/src/interactions/options.ts:53](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/options.ts#L53)
##### Parameters
###### name
`string`
###### required
`true`
##### Returns
`boolean`
#### Call Signature
> **getBoolean**(`name`, `required?`): `boolean`
Defined in: [sdk/js/src/interactions/options.ts:54](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/options.ts#L54)
##### Parameters
###### name
`string`
###### required?
`boolean`
##### Returns
`boolean`
***
### getChannel()
> **getChannel**(`name`, `required?`): `Channel`
Defined in: [sdk/js/src/interactions/options.ts:71](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/options.ts#L71)
#### Parameters
##### name
`string`
##### required?
`boolean` = `false`
#### Returns
`Channel`
***
### getFocused()
#### Call Signature
> **getFocused**(): `string`
Defined in: [sdk/js/src/interactions/options.ts:91](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/options.ts#L91)
The option being typed (autocomplete): its value, or `{ name, value }` with `full`.
##### Returns
`string`
#### Call Signature
> **getFocused**(`full`): `object`
Defined in: [sdk/js/src/interactions/options.ts:92](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/options.ts#L92)
The option being typed (autocomplete): its value, or `{ name, value }` with `full`.
##### Parameters
###### full
`true`
##### Returns
`object`
###### name
> **name**: `string`
###### value
> **value**: `string`
***
### getInteger()
#### Call Signature
> **getInteger**(`name`, `required`): `number`
Defined in: [sdk/js/src/interactions/options.ts:43](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/options.ts#L43)
##### Parameters
###### name
`string`
###### required
`true`
##### Returns
`number`
#### Call Signature
> **getInteger**(`name`, `required?`): `number`
Defined in: [sdk/js/src/interactions/options.ts:44](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/options.ts#L44)
##### Parameters
###### name
`string`
###### required?
`boolean`
##### Returns
`number`
***
### getMember()
> **getMember**(`name`, `required?`): [`Member`](/docs/reference/js/zaun-bot/classes/member/)
Defined in: [sdk/js/src/interactions/options.ts:68](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/options.ts#L68)
#### Parameters
##### name
`string`
##### required?
`boolean` = `false`
#### Returns
[`Member`](/docs/reference/js/zaun-bot/classes/member/)
***
### getMentionable()
> **getMentionable**(`name`, `required?`): [`Member`](/docs/reference/js/zaun-bot/classes/member/) \| `Role`
Defined in: [sdk/js/src/interactions/options.ts:79](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/options.ts#L79)
#### Parameters
##### name
`string`
##### required?
`boolean` = `false`
#### Returns
[`Member`](/docs/reference/js/zaun-bot/classes/member/) \| `Role`
***
### getNumber()
#### Call Signature
> **getNumber**(`name`, `required`): `number`
Defined in: [sdk/js/src/interactions/options.ts:48](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/options.ts#L48)
##### Parameters
###### name
`string`
###### required
`true`
##### Returns
`number`
#### Call Signature
> **getNumber**(`name`, `required?`): `number`
Defined in: [sdk/js/src/interactions/options.ts:49](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/options.ts#L49)
##### Parameters
###### name
`string`
###### required?
`boolean`
##### Returns
`number`
***
### getRole()
> **getRole**(`name`, `required?`): `Role`
Defined in: [sdk/js/src/interactions/options.ts:75](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/options.ts#L75)
#### Parameters
##### name
`string`
##### required?
`boolean` = `false`
#### Returns
`Role`
***
### getString()
#### Call Signature
> **getString**(`name`, `required`): `string`
Defined in: [sdk/js/src/interactions/options.ts:38](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/options.ts#L38)
##### Parameters
###### name
`string`
###### required
`true`
##### Returns
`string`
#### Call Signature
> **getString**(`name`, `required?`): `string`
Defined in: [sdk/js/src/interactions/options.ts:39](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/options.ts#L39)
##### Parameters
###### name
`string`
###### required?
`boolean`
##### Returns
`string`
***
### getSubcommand()
> **getSubcommand**(`required?`): `string`
Defined in: [sdk/js/src/interactions/options.ts:31](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/options.ts#L31)
#### Parameters
##### required?
`boolean` = `true`
#### Returns
`string`
***
### getSubcommandGroup()
> **getSubcommandGroup**(`required?`): `string`
Defined in: [sdk/js/src/interactions/options.ts:34](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/options.ts#L34)
#### Parameters
##### required?
`boolean` = `false`
#### Returns
`string`
***
### getUser()
> **getUser**(`name`, `required?`): [`Member`](/docs/reference/js/zaun-bot/classes/member/)
Defined in: [sdk/js/src/interactions/options.ts:64](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/options.ts#L64)
A user option's member.
#### Parameters
##### name
`string`
##### required?
`boolean` = `false`
#### Returns
[`Member`](/docs/reference/js/zaun-bot/classes/member/)
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/classes/containerbuilder/
---
# ContainerBuilder
Defined in: [sdk/js/src/builders/layout.ts:150](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/layout.ts#L150)
Type 17: a box around other components, with an optional accent colour.
## Constructors
### Constructor
> **new ContainerBuilder**(): `ContainerBuilder`
#### Returns
`ContainerBuilder`
## Methods
### addActionRowComponents()
> **addActionRowComponents**(...`rows`): `this`
Defined in: [sdk/js/src/builders/layout.ts:165](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/layout.ts#L165)
#### Parameters
##### rows
...[`ActionRowBuilder`](/docs/reference/js/zaun-bot/classes/actionrowbuilder/)\<[`RowComponent`](/docs/reference/js/zaun-bot/type-aliases/rowcomponent/)\>[]
#### Returns
`this`
***
### addComponents()
> **addComponents**(...`children`): `this`
Defined in: [sdk/js/src/builders/layout.ts:155](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/layout.ts#L155)
#### Parameters
##### children
...[`ContainerComponent`](/docs/reference/js/zaun-bot/type-aliases/containercomponent/)[]
#### Returns
`this`
***
### addFileComponents()
> **addFileComponents**(...`files`): `this`
Defined in: [sdk/js/src/builders/layout.ts:174](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/layout.ts#L174)
#### Parameters
##### files
...[`FileBuilder`](/docs/reference/js/zaun-bot/classes/filebuilder/)[]
#### Returns
`this`
***
### addMediaGalleryComponents()
> **addMediaGalleryComponents**(...`galleries`): `this`
Defined in: [sdk/js/src/builders/layout.ts:171](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/layout.ts#L171)
#### Parameters
##### galleries
...[`MediaGalleryBuilder`](/docs/reference/js/zaun-bot/classes/mediagallerybuilder/)[]
#### Returns
`this`
***
### addSectionComponents()
> **addSectionComponents**(...`sections`): `this`
Defined in: [sdk/js/src/builders/layout.ts:162](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/layout.ts#L162)
#### Parameters
##### sections
...[`SectionBuilder`](/docs/reference/js/zaun-bot/classes/sectionbuilder/)[]
#### Returns
`this`
***
### addSeparatorComponents()
> **addSeparatorComponents**(...`separators`): `this`
Defined in: [sdk/js/src/builders/layout.ts:168](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/layout.ts#L168)
#### Parameters
##### separators
...[`SeparatorBuilder`](/docs/reference/js/zaun-bot/classes/separatorbuilder/)[]
#### Returns
`this`
***
### addTextDisplayComponents()
> **addTextDisplayComponents**(...`texts`): `this`
Defined in: [sdk/js/src/builders/layout.ts:159](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/layout.ts#L159)
#### Parameters
##### texts
...[`TextDisplayBuilder`](/docs/reference/js/zaun-bot/classes/textdisplaybuilder/)[]
#### Returns
`this`
***
### setAccentColor()
> **setAccentColor**(`value`): `this`
Defined in: [sdk/js/src/builders/layout.ts:177](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/layout.ts#L177)
#### Parameters
##### value
`number` \| `` `#${string}` ``
#### Returns
`this`
***
### setSpoiler()
> **setSpoiler**(`spoiler?`): `this`
Defined in: [sdk/js/src/builders/layout.ts:181](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/layout.ts#L181)
#### Parameters
##### spoiler?
`boolean` = `true`
#### Returns
`this`
***
### toWit()
> **toWit**(): `Container`
Defined in: [sdk/js/src/builders/layout.ts:185](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/layout.ts#L185)
#### Returns
`Container`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/classes/contextmenucommandbuilder/
---
# ContextMenuCommandBuilder
Defined in: [sdk/js/src/builders/command.ts:155](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/command.ts#L155)
A user or message context-menu command.
## Implements
- [`CommandLike`](/docs/reference/js/zaun-bot/interfaces/commandlike/)
## Constructors
### Constructor
> **new ContextMenuCommandBuilder**(): `ContextMenuCommandBuilder`
#### Returns
`ContextMenuCommandBuilder`
## Properties
### name
> **name**: `string` = `''`
Defined in: [sdk/js/src/builders/command.ts:156](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/command.ts#L156)
#### Implementation of
[`CommandLike`](/docs/reference/js/zaun-bot/interfaces/commandlike/).[`name`](/docs/reference/js/zaun-bot/interfaces/commandlike/#name)
## Methods
### setDefaultMemberPermissions()
> **setDefaultMemberPermissions**(`bits`): `this`
Defined in: [sdk/js/src/builders/command.ts:174](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/command.ts#L174)
#### Parameters
##### bits
`number` \| `bigint`
#### Returns
`this`
***
### setName()
> **setName**(`name`): `this`
Defined in: [sdk/js/src/builders/command.ts:162](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/command.ts#L162)
1–32 characters; spaces and capitals allowed.
#### Parameters
##### name
`string`
#### Returns
`this`
***
### setNameLocalizations()
> **setNameLocalizations**(`map`): `this`
Defined in: [sdk/js/src/builders/command.ts:170](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/command.ts#L170)
#### Parameters
##### map
`Record`\<`string`, `string`\>
#### Returns
`this`
***
### setType()
> **setType**(`type`): `this`
Defined in: [sdk/js/src/builders/command.ts:166](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/command.ts#L166)
#### Parameters
##### type
`2` \| `3`
#### Returns
`this`
***
### toWit()
> **toWit**(): `ApplicationCommand`
Defined in: [sdk/js/src/builders/command.ts:178](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/command.ts#L178)
#### Returns
`ApplicationCommand`
#### Implementation of
[`CommandLike`](/docs/reference/js/zaun-bot/interfaces/commandlike/).[`toWit`](/docs/reference/js/zaun-bot/interfaces/commandlike/#towit)
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/classes/embedbuilder/
---
# EmbedBuilder
Defined in: [sdk/js/src/builders/embed.ts:23](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/embed.ts#L23)
A rich embed.
## Constructors
### Constructor
> **new EmbedBuilder**(`data?`): `EmbedBuilder`
Defined in: [sdk/js/src/builders/embed.ts:26](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/embed.ts#L26)
#### Parameters
##### data?
[`EmbedData`](/docs/reference/js/zaun-bot/interfaces/embeddata/) = `{}`
#### Returns
`EmbedBuilder`
## Properties
### data
> `readonly` **data**: [`EmbedData`](/docs/reference/js/zaun-bot/interfaces/embeddata/)
Defined in: [sdk/js/src/builders/embed.ts:24](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/embed.ts#L24)
## Methods
### addFields()
> **addFields**(...`fields`): `this`
Defined in: [sdk/js/src/builders/embed.ts:72](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/embed.ts#L72)
#### Parameters
##### fields
...`object`[]
#### Returns
`this`
***
### length()
> **length**(): `number`
Defined in: [sdk/js/src/builders/embed.ts:105](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/embed.ts#L105)
Characters this embed counts towards the 6 000 per message.
#### Returns
`number`
***
### setAuthor()
> **setAuthor**(`author`): `this`
Defined in: [sdk/js/src/builders/embed.ts:52](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/embed.ts#L52)
`iconAttachment` is an attachment id of the same message.
#### Parameters
##### author
###### iconAttachment?
`string`
###### name
`string`
###### url?
`string`
#### Returns
`this`
***
### setColor()
> **setColor**(`value`): `this`
Defined in: [sdk/js/src/builders/embed.ts:43](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/embed.ts#L43)
#### Parameters
##### value
`number` \| `` `#${string}` ``
#### Returns
`this`
***
### setDescription()
> **setDescription**(`description`): `this`
Defined in: [sdk/js/src/builders/embed.ts:34](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/embed.ts#L34)
#### Parameters
##### description
`string`
#### Returns
`this`
***
### setFooter()
> **setFooter**(`footer`): `this`
Defined in: [sdk/js/src/builders/embed.ts:58](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/embed.ts#L58)
#### Parameters
##### footer
###### iconAttachment?
`string`
###### text
`string`
#### Returns
`this`
***
### setImage()
> **setImage**(`attachmentId`): `this`
Defined in: [sdk/js/src/builders/embed.ts:64](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/embed.ts#L64)
An image attachment of the same message (Zaun never loads remote pictures).
#### Parameters
##### attachmentId
`string`
#### Returns
`this`
***
### setThumbnail()
> **setThumbnail**(`attachmentId`): `this`
Defined in: [sdk/js/src/builders/embed.ts:68](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/embed.ts#L68)
#### Parameters
##### attachmentId
`string`
#### Returns
`this`
***
### setTimestamp()
> **setTimestamp**(`at?`): `this`
Defined in: [sdk/js/src/builders/embed.ts:47](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/embed.ts#L47)
#### Parameters
##### at?
`number` \| `Date` = `...`
#### Returns
`this`
***
### setTitle()
> **setTitle**(`title`): `this`
Defined in: [sdk/js/src/builders/embed.ts:30](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/embed.ts#L30)
#### Parameters
##### title
`string`
#### Returns
`this`
***
### setURL()
> **setURL**(`url`): `this`
Defined in: [sdk/js/src/builders/embed.ts:39](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/embed.ts#L39)
The title's link (`https://` only).
#### Parameters
##### url
`string`
#### Returns
`this`
***
### toWit()
> **toWit**(): `Embed`
Defined in: [sdk/js/src/builders/embed.ts:84](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/embed.ts#L84)
The WIT `embed`.
#### Returns
`Embed`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/classes/eventcontext/
---
# EventContext
Defined in: [sdk/js/src/context.ts:24](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/context.ts#L24)
Passed to every event listener.
## Constructors
### Constructor
> **new EventContext**(`me`): `EventContext`
Defined in: [sdk/js/src/context.ts:25](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/context.ts#L25)
#### Parameters
##### me
[`Me`](/docs/reference/js/zaun-bot/interfaces/me/)
#### Returns
`EventContext`
## Methods
### delete()
> **delete**(`message`): `void`
Defined in: [sdk/js/src/context.ts:43](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/context.ts#L43)
Deletes `message` (the bot's own, or any with `MANAGE_MESSAGES`).
#### Parameters
##### message
`Message`
#### Returns
`void`
***
### dm()
> **dm**(`memberId`, `payload`): `object`
Defined in: [sdk/js/src/context.ts:48](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/context.ts#L48)
Sends a direct message to `memberId` (capability `dms`), opening the DM when needed.
#### Parameters
##### memberId
`string`
##### payload
[`MessagePayload`](/docs/reference/js/zaun-bot/type-aliases/messagepayload/)
#### Returns
`object`
##### channelId
> **channelId**: `string`
##### messageId
> **messageId**: `string`
***
### isMe()
> **isMe**(`memberId`): `boolean`
Defined in: [sdk/js/src/context.ts:64](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/context.ts#L64)
Whether `memberId` is the bot itself (known once `ready` arrived).
#### Parameters
##### memberId
`string`
#### Returns
`boolean`
***
### mentionsMe()
> **mentionsMe**(`message`): `boolean`
Defined in: [sdk/js/src/context.ts:73](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/context.ts#L73)
Whether `message` mentions the bot: by its member id, by `@everyone`, or by one of its
roles. Only when the message names roles does it ask the host for the bot's own roles
(`community.getMember`); a refusal there counts as not mentioned.
#### Parameters
##### message
`Message`
#### Returns
`boolean`
***
### react()
> **react**(`message`, `emoji`): `void`
Defined in: [sdk/js/src/context.ts:38](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/context.ts#L38)
Adds a reaction to `message`.
#### Parameters
##### message
`Message`
##### emoji
`string`
#### Returns
`void`
***
### reply()
> **reply**(`message`, `payload`): `string`
Defined in: [sdk/js/src/context.ts:33](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/context.ts#L33)
Replies to `message` in its channel.
#### Parameters
##### message
`Message`
##### payload
[`MessagePayload`](/docs/reference/js/zaun-bot/type-aliases/messagepayload/)
#### Returns
`string`
***
### send()
> **send**(`channelId`, `payload`): `string`
Defined in: [sdk/js/src/context.ts:28](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/context.ts#L28)
Posts in `channelId`; returns the new message's id.
#### Parameters
##### channelId
`string`
##### payload
[`MessagePayload`](/docs/reference/js/zaun-bot/type-aliases/messagepayload/)
#### Returns
`string`
***
### setPresence()
> **setPresence**(`status`, `activity?`): `void`
Defined in: [sdk/js/src/context.ts:54](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/context.ts#L54)
Sets the bot's status and activity (none: no activity).
#### Parameters
##### status
[`PresenceStatus`](/docs/reference/js/zaun-bot/type-aliases/presencestatus/)
##### activity?
[`Activity`](/docs/reference/js/zaun-bot/classes/activity/)
#### Returns
`void`
***
### setStatusText()
> **setStatusText**(`text`): `void`
Defined in: [sdk/js/src/context.ts:59](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/context.ts#L59)
Sets the bot's custom status text, kept until changed.
#### Parameters
##### text
`string`
#### Returns
`void`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/classes/filebuilder/
---
# FileBuilder
Defined in: [sdk/js/src/builders/layout.ts:97](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/layout.ts#L97)
Type 13: one attached file.
## Constructors
### Constructor
> **new FileBuilder**(): `FileBuilder`
#### Returns
`FileBuilder`
## Methods
### setFile()
> **setFile**(`attachmentId`): `this`
Defined in: [sdk/js/src/builders/layout.ts:100](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/layout.ts#L100)
#### Parameters
##### attachmentId
`string`
#### Returns
`this`
***
### setSpoiler()
> **setSpoiler**(`spoiler?`): `this`
Defined in: [sdk/js/src/builders/layout.ts:104](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/layout.ts#L104)
#### Parameters
##### spoiler?
`boolean` = `true`
#### Returns
`this`
***
### toWit()
> **toWit**(): `File`
Defined in: [sdk/js/src/builders/layout.ts:108](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/layout.ts#L108)
#### Returns
`File`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/classes/fileuploadbuilder/
---
# FileUploadBuilder
Defined in: [sdk/js/src/builders/choices.ts:94](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/choices.ts#L94)
Type 19: files the invoker uploads.
## Constructors
### Constructor
> **new FileUploadBuilder**(): `FileUploadBuilder`
#### Returns
`FileUploadBuilder`
## Methods
### setCustomId()
> **setCustomId**(`id`): `this`
Defined in: [sdk/js/src/builders/choices.ts:99](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/choices.ts#L99)
#### Parameters
##### id
`string`
#### Returns
`this`
***
### setMaxValues()
> **setMaxValues**(`n`): `this`
Defined in: [sdk/js/src/builders/choices.ts:107](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/choices.ts#L107)
#### Parameters
##### n
`number`
#### Returns
`this`
***
### setMinValues()
> **setMinValues**(`n`): `this`
Defined in: [sdk/js/src/builders/choices.ts:103](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/choices.ts#L103)
#### Parameters
##### n
`number`
#### Returns
`this`
***
### setRequired()
> **setRequired**(`required?`): `this`
Defined in: [sdk/js/src/builders/choices.ts:111](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/choices.ts#L111)
#### Parameters
##### required?
`boolean` = `true`
#### Returns
`this`
***
### toWit()
> **toWit**(): `FileUpload`
Defined in: [sdk/js/src/builders/choices.ts:115](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/choices.ts#L115)
#### Returns
`FileUpload`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/classes/httperror/
---
# HttpError
Defined in: [sdk/js/src/api.ts:109](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/api.ts#L109)
Why `http.fetch` failed (`not-granted`, `refused-address`, `invalid-url`, `timeout`, …).
## Extends
- [`ZaunError`](/docs/reference/js/zaun-bot/classes/zaunerror/)
## Constructors
### Constructor
> **new HttpError**(`kind`, `detail?`): `HttpError`
Defined in: [sdk/js/src/api.ts:110](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/api.ts#L110)
#### Parameters
##### kind
`string`
##### detail?
`string`
#### Returns
`HttpError`
#### Overrides
[`ZaunError`](/docs/reference/js/zaun-bot/classes/zaunerror/).[`constructor`](/docs/reference/js/zaun-bot/classes/zaunerror/#constructor)
## Properties
### code
> `readonly` **code**: `string`
Defined in: [sdk/js/src/errors.ts:8](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/errors.ts#L8)
The protocol error code, or a runtime code such as `NOT_GRANTED`.
#### Inherited from
[`ZaunError`](/docs/reference/js/zaun-bot/classes/zaunerror/).[`code`](/docs/reference/js/zaun-bot/classes/zaunerror/#code)
***
### detail
> `readonly` **detail**: `string`
Defined in: [sdk/js/src/errors.ts:10](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/errors.ts#L10)
The `reason` or `field` the host gave.
#### Inherited from
[`ZaunError`](/docs/reference/js/zaun-bot/classes/zaunerror/).[`detail`](/docs/reference/js/zaun-bot/classes/zaunerror/#detail)
***
### kind
> `readonly` **kind**: `string`
Defined in: [sdk/js/src/api.ts:110](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/api.ts#L110)
***
### retryAfterMs
> `readonly` **retryAfterMs**: `number`
Defined in: [sdk/js/src/errors.ts:12](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/errors.ts#L12)
For `RATE_LIMITED` and `BUSY`: when to try again, in ms.
#### Inherited from
[`ZaunError`](/docs/reference/js/zaun-bot/classes/zaunerror/).[`retryAfterMs`](/docs/reference/js/zaun-bot/classes/zaunerror/#retryafterms)
## Methods
### isUnsupported()
> **isUnsupported**(): `boolean`
Defined in: [sdk/js/src/errors.ts:27](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/errors.ts#L27)
Whether the host does not implement this call (or this case of it) yet: an older host, or a
feature it lacks, such as volume without an Opus encoder. Fall back to what the bot did
before; trying again will not help.
#### Returns
`boolean`
#### Inherited from
[`ZaunError`](/docs/reference/js/zaun-bot/classes/zaunerror/).[`isUnsupported`](/docs/reference/js/zaun-bot/classes/zaunerror/#isunsupported)
***
### from()
> `static` **from**(`e`): [`ZaunError`](/docs/reference/js/zaun-bot/classes/zaunerror/)
Defined in: [sdk/js/src/errors.ts:32](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/errors.ts#L32)
From the WIT `host-error`.
#### Parameters
##### e
`HostError`
#### Returns
[`ZaunError`](/docs/reference/js/zaun-bot/classes/zaunerror/)
#### Inherited from
[`ZaunError`](/docs/reference/js/zaun-bot/classes/zaunerror/).[`from`](/docs/reference/js/zaun-bot/classes/zaunerror/#from)
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/classes/labelbuilder/
---
# LabelBuilder
Defined in: [sdk/js/src/builders/modal.ts:21](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/modal.ts#L21)
Type 18: a modal field's label around one input.
## Constructors
### Constructor
> **new LabelBuilder**(): `LabelBuilder`
#### Returns
`LabelBuilder`
## Methods
### setComponent()
> **setComponent**(`component`): `this`
Defined in: [sdk/js/src/builders/modal.ts:33](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/modal.ts#L33)
#### Parameters
##### component
[`LabelComponent`](/docs/reference/js/zaun-bot/type-aliases/labelcomponent/)
#### Returns
`this`
***
### setDescription()
> **setDescription**(`description`): `this`
Defined in: [sdk/js/src/builders/modal.ts:29](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/modal.ts#L29)
#### Parameters
##### description
`string`
#### Returns
`this`
***
### setLabel()
> **setLabel**(`label`): `this`
Defined in: [sdk/js/src/builders/modal.ts:25](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/modal.ts#L25)
#### Parameters
##### label
`string`
#### Returns
`this`
***
### setStringSelectMenuComponent()
> **setStringSelectMenuComponent**(`c`): `this`
Defined in: [sdk/js/src/builders/modal.ts:41](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/modal.ts#L41)
#### Parameters
##### c
[`StringSelectMenuBuilder`](/docs/reference/js/zaun-bot/classes/stringselectmenubuilder/)
#### Returns
`this`
***
### setTextInputComponent()
> **setTextInputComponent**(`c`): `this`
Defined in: [sdk/js/src/builders/modal.ts:38](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/modal.ts#L38)
Aliases.
#### Parameters
##### c
[`TextInputBuilder`](/docs/reference/js/zaun-bot/classes/textinputbuilder/)
#### Returns
`this`
***
### toWit()
> **toWit**(): `Label`
Defined in: [sdk/js/src/builders/modal.ts:44](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/modal.ts#L44)
#### Returns
`Label`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/classes/mediagallerybuilder/
---
# MediaGalleryBuilder
Defined in: [sdk/js/src/builders/layout.ts:80](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/layout.ts#L80)
Type 12: up to ten pictures.
## Constructors
### Constructor
> **new MediaGalleryBuilder**(): `MediaGalleryBuilder`
#### Returns
`MediaGalleryBuilder`
## Methods
### addItems()
> **addItems**(...`items`): `this`
Defined in: [sdk/js/src/builders/layout.ts:82](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/layout.ts#L82)
#### Parameters
##### items
...[`MediaGalleryItem`](/docs/reference/js/zaun-bot/interfaces/mediagalleryitem/)[]
#### Returns
`this`
***
### toWit()
> **toWit**(): `MediaGallery`
Defined in: [sdk/js/src/builders/layout.ts:87](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/layout.ts#L87)
#### Returns
`MediaGallery`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/classes/member/
---
# Member
Defined in: [sdk/js/src/member.ts:38](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/member.ts#L38)
A community member.
## Implements
- `Member`
## Constructors
### Constructor
> **new Member**(`raw`): `Member`
Defined in: [sdk/js/src/member.ts:50](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/member.ts#L50)
#### Parameters
##### raw
`Member`
#### Returns
`Member`
## Properties
### botId
> `readonly` **botId**: `string`
Defined in: [sdk/js/src/member.ts:44](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/member.ts#L44)
Set only for bots.
#### Implementation of
`wit.Member.botId`
***
### displayName
> `readonly` **displayName**: `string`
Defined in: [sdk/js/src/member.ts:40](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/member.ts#L40)
#### Implementation of
`wit.Member.displayName`
***
### joinedAt
> `readonly` **joinedAt**: `bigint`
Defined in: [sdk/js/src/member.ts:42](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/member.ts#L42)
#### Implementation of
`wit.Member.joinedAt`
***
### memberId
> `readonly` **memberId**: `string`
Defined in: [sdk/js/src/member.ts:39](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/member.ts#L39)
#### Implementation of
`wit.Member.memberId`
***
### roleIds
> `readonly` **roleIds**: `string`[]
Defined in: [sdk/js/src/member.ts:41](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/member.ts#L41)
#### Implementation of
`wit.Member.roleIds`
***
### roles
> `readonly` **roles**: [`MemberRoles`](/docs/reference/js/zaun-bot/classes/memberroles/)
Defined in: [sdk/js/src/member.ts:48](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/member.ts#L48)
Role ids and `add` / `remove` / `has`.
***
### voiceChannel
> `readonly` **voiceChannel**: `string`
Defined in: [sdk/js/src/member.ts:46](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/member.ts#L46)
The voice channel the member is in, if any (and if the bot can see it).
#### Implementation of
`wit.Member.voiceChannel`
## Accessors
### bot
#### Get Signature
> **get** **bot**(): `boolean`
Defined in: [sdk/js/src/member.ts:85](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/member.ts#L85)
Whether the member is a bot.
##### Returns
`boolean`
***
### id
#### Get Signature
> **get** **id**(): `string`
Defined in: [sdk/js/src/member.ts:61](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/member.ts#L61)
The member id.
##### Returns
`string`
***
### joinedTimestamp
#### Get Signature
> **get** **joinedTimestamp**(): `number`
Defined in: [sdk/js/src/member.ts:90](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/member.ts#L90)
When the member joined, ms since the epoch.
##### Returns
`number`
***
### voiceChannelId
#### Get Signature
> **get** **voiceChannelId**(): `string`
Defined in: [sdk/js/src/member.ts:69](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/member.ts#L69)
The voice channel the member is in, if any and if the
bot can see it. Always filled for an interaction's invoker, so `/play` can join them.
##### Returns
`string`
## Methods
### kick()
> **kick**(`reason?`): `void`
Defined in: [sdk/js/src/member.ts:104](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/member.ts#L104)
Removes the member from the community (`KICK_MEMBERS`).
#### Parameters
##### reason?
`string`
#### Returns
`void`
***
### mention()
> **mention**(): `string`
Defined in: [sdk/js/src/member.ts:75](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/member.ts#L75)
The text that shows a mention of the member, `<@id>` (it notifies only if the message's
`mentions` names the member too).
#### Returns
`string`
***
### send()
> **send**(`payload`): `object`
Defined in: [sdk/js/src/member.ts:98](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/member.ts#L98)
Sends the member a direct message (capability `dms`), opening the DM when needed. Throws
`ZaunError` `FORBIDDEN` with detail `dms_closed` when they do not take DMs from bots.
#### Parameters
##### payload
[`MessagePayload`](/docs/reference/js/zaun-bot/type-aliases/messagepayload/)
#### Returns
`object`
##### channelId
> **channelId**: `string`
##### messageId
> **messageId**: `string`
***
### timeout()
> **timeout**(`until`, `reason?`): `void`
Defined in: [sdk/js/src/member.ts:109](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/member.ts#L109)
Times the member out until `until` (ms since the epoch); `null` clears it (`TIMEOUT_MEMBERS`).
#### Parameters
##### until
`number`
##### reason?
`string`
#### Returns
`void`
***
### toString()
> **toString**(): `string`
Defined in: [sdk/js/src/member.ts:80](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/member.ts#L80)
`<@id>`.
#### Returns
`string`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/classes/memberroles/
---
# MemberRoles
Defined in: [sdk/js/src/member.ts:14](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/member.ts#L14)
A member's roles and the calls that change them (the bot needs `MANAGE_ROLES`).
## Constructors
### Constructor
> **new MemberRoles**(`member`): `MemberRoles`
Defined in: [sdk/js/src/member.ts:15](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/member.ts#L15)
#### Parameters
##### member
[`Member`](/docs/reference/js/zaun-bot/classes/member/)
#### Returns
`MemberRoles`
## Accessors
### ids
#### Get Signature
> **get** **ids**(): readonly `string`[]
Defined in: [sdk/js/src/member.ts:18](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/member.ts#L18)
The member's role ids, as the bot last saw them.
##### Returns
readonly `string`[]
## Methods
### add()
> **add**(`roleId`): `void`
Defined in: [sdk/js/src/member.ts:27](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/member.ts#L27)
Gives the member a role below the bot's own.
#### Parameters
##### roleId
`string`
#### Returns
`void`
***
### has()
> **has**(`roleId`): `boolean`
Defined in: [sdk/js/src/member.ts:22](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/member.ts#L22)
#### Parameters
##### roleId
`string`
#### Returns
`boolean`
***
### remove()
> **remove**(`roleId`): `void`
Defined in: [sdk/js/src/member.ts:32](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/member.ts#L32)
Takes a role away.
#### Parameters
##### roleId
`string`
#### Returns
`void`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/classes/mentionableselectmenubuilder/
---
# MentionableSelectMenuBuilder
Defined in: [sdk/js/src/builders/select.ts:153](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/select.ts#L153)
Type 7: members and roles.
## Extends
- `EntitySelectBuilder`
## Constructors
### Constructor
> **new MentionableSelectMenuBuilder**(): `MentionableSelectMenuBuilder`
#### Returns
`MentionableSelectMenuBuilder`
#### Inherited from
`EntitySelectBuilder.constructor`
## Accessors
### customId
#### Get Signature
> **get** **customId**(): `string`
Defined in: [sdk/js/src/builders/select.ts:78](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/select.ts#L78)
##### Returns
`string`
#### Inherited from
`EntitySelectBuilder.customId`
## Methods
### addDefaultRoles()
> **addDefaultRoles**(...`ids`): `this`
Defined in: [sdk/js/src/builders/select.ts:159](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/select.ts#L159)
#### Parameters
##### ids
...`string`[]
#### Returns
`this`
***
### addDefaultUsers()
> **addDefaultUsers**(...`ids`): `this`
Defined in: [sdk/js/src/builders/select.ts:155](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/select.ts#L155)
#### Parameters
##### ids
...`string`[]
#### Returns
`this`
***
### setCustomId()
> **setCustomId**(`id`): `this`
Defined in: [sdk/js/src/builders/select.ts:53](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/select.ts#L53)
#### Parameters
##### id
`string`
#### Returns
`this`
#### Inherited from
`EntitySelectBuilder.setCustomId`
***
### setDisabled()
> **setDisabled**(`disabled?`): `this`
Defined in: [sdk/js/src/builders/select.ts:74](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/select.ts#L74)
#### Parameters
##### disabled?
`boolean` = `true`
#### Returns
`this`
#### Inherited from
`EntitySelectBuilder.setDisabled`
***
### setMaxValues()
> **setMaxValues**(`n`): `this`
Defined in: [sdk/js/src/builders/select.ts:65](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/select.ts#L65)
#### Parameters
##### n
`number`
#### Returns
`this`
#### Inherited from
`EntitySelectBuilder.setMaxValues`
***
### setMinValues()
> **setMinValues**(`n`): `this`
Defined in: [sdk/js/src/builders/select.ts:61](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/select.ts#L61)
#### Parameters
##### n
`number`
#### Returns
`this`
#### Inherited from
`EntitySelectBuilder.setMinValues`
***
### setPlaceholder()
> **setPlaceholder**(`placeholder`): `this`
Defined in: [sdk/js/src/builders/select.ts:57](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/select.ts#L57)
#### Parameters
##### placeholder
`string`
#### Returns
`this`
#### Inherited from
`EntitySelectBuilder.setPlaceholder`
***
### setRequired()
> **setRequired**(`required?`): `this`
Defined in: [sdk/js/src/builders/select.ts:70](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/select.ts#L70)
In a modal: whether an answer is needed (default true).
#### Parameters
##### required?
`boolean` = `true`
#### Returns
`this`
#### Inherited from
`EntitySelectBuilder.setRequired`
***
### toWit()
> **toWit**(): `EntitySelect`
Defined in: [sdk/js/src/builders/select.ts:124](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/select.ts#L124)
#### Returns
`EntitySelect`
#### Inherited from
`EntitySelectBuilder.toWit`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/classes/message/
---
# Message
Defined in: [sdk/js/src/message-object.ts:13](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/message-object.ts#L13)
A channel message.
## Implements
- `Message`
## Constructors
### Constructor
> **new Message**(`raw`): `Message`
Defined in: [sdk/js/src/message-object.ts:32](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/message-object.ts#L32)
#### Parameters
##### raw
`Message`
#### Returns
`Message`
## Properties
### attachments
> `readonly` **attachments**: `Attachment`[]
Defined in: [sdk/js/src/message-object.ts:29](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/message-object.ts#L29)
#### Implementation of
`wit.Message.attachments`
***
### authorId
> `readonly` **authorId**: `string`
Defined in: [sdk/js/src/message-object.ts:17](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/message-object.ts#L17)
#### Implementation of
`wit.Message.authorId`
***
### channelId
> `readonly` **channelId**: `string`
Defined in: [sdk/js/src/message-object.ts:15](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/message-object.ts#L15)
#### Implementation of
`wit.Message.channelId`
***
### components
> `readonly` **components**: `Component`[]
Defined in: [sdk/js/src/message-object.ts:23](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/message-object.ts#L23)
#### Implementation of
`wit.Message.components`
***
### content
> `readonly` **content**: `string`
Defined in: [sdk/js/src/message-object.ts:21](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/message-object.ts#L21)
Empty when the bot lacks `message_content` (unless it is mentioned).
#### Implementation of
`wit.Message.content`
***
### createdAt
> `readonly` **createdAt**: `bigint`
Defined in: [sdk/js/src/message-object.ts:18](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/message-object.ts#L18)
#### Implementation of
`wit.Message.createdAt`
***
### editedAt
> `readonly` **editedAt**: `bigint`
Defined in: [sdk/js/src/message-object.ts:19](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/message-object.ts#L19)
#### Implementation of
`wit.Message.editedAt`
***
### embeds
> `readonly` **embeds**: `Embed`[]
Defined in: [sdk/js/src/message-object.ts:22](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/message-object.ts#L22)
#### Implementation of
`wit.Message.embeds`
***
### flags
> `readonly` **flags**: `number`
Defined in: [sdk/js/src/message-object.ts:24](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/message-object.ts#L24)
Raw flag bits.
#### Implementation of
`wit.Message.flags`
***
### interaction
> `readonly` **interaction**: `InteractionMetadata`
Defined in: [sdk/js/src/message-object.ts:30](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/message-object.ts#L30)
#### Implementation of
`wit.Message.interaction`
***
### mentions
> `readonly` **mentions**: [`MessageMentions`](/docs/reference/js/zaun-bot/classes/messagementions/)
Defined in: [sdk/js/src/message-object.ts:28](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/message-object.ts#L28)
Who it mentions, as the host honoured them (on an edit event: the new mentions, or none
when the edit left them unchanged).
#### Implementation of
`wit.Message.mentions`
***
### messageId
> `readonly` **messageId**: `string`
Defined in: [sdk/js/src/message-object.ts:14](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/message-object.ts#L14)
#### Implementation of
`wit.Message.messageId`
***
### replyTo
> `readonly` **replyTo**: `string`
Defined in: [sdk/js/src/message-object.ts:25](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/message-object.ts#L25)
#### Implementation of
`wit.Message.replyTo`
***
### sequence
> `readonly` **sequence**: `bigint`
Defined in: [sdk/js/src/message-object.ts:16](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/message-object.ts#L16)
#### Implementation of
`wit.Message.sequence`
## Accessors
### createdTimestamp
#### Get Signature
> **get** **createdTimestamp**(): `number`
Defined in: [sdk/js/src/message-object.ts:55](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/message-object.ts#L55)
When it was posted, ms since the epoch.
##### Returns
`number`
***
### id
#### Get Signature
> **get** **id**(): `string`
Defined in: [sdk/js/src/message-object.ts:50](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/message-object.ts#L50)
The message id.
##### Returns
`string`
## Methods
### delete()
> **delete**(): `void`
Defined in: [sdk/js/src/message-object.ts:70](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/message-object.ts#L70)
Deletes it (the bot's own, or any with `MANAGE_MESSAGES`).
#### Returns
`void`
***
### edit()
> **edit**(`payload`): `void`
Defined in: [sdk/js/src/message-object.ts:65](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/message-object.ts#L65)
Edits it (the bot's own messages only).
#### Parameters
##### payload
[`MessagePayload`](/docs/reference/js/zaun-bot/type-aliases/messagepayload/)
#### Returns
`void`
***
### react()
> **react**(`emoji`): `void`
Defined in: [sdk/js/src/message-object.ts:75](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/message-object.ts#L75)
Adds a reaction.
#### Parameters
##### emoji
`string`
#### Returns
`void`
***
### reply()
> **reply**(`payload`): `string`
Defined in: [sdk/js/src/message-object.ts:60](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/message-object.ts#L60)
Replies in the same channel; returns the reply's id.
#### Parameters
##### payload
[`MessagePayload`](/docs/reference/js/zaun-bot/type-aliases/messagepayload/)
#### Returns
`string`
***
### unreact()
> **unreact**(`emoji`): `void`
Defined in: [sdk/js/src/message-object.ts:80](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/message-object.ts#L80)
Removes the bot's own reaction.
#### Parameters
##### emoji
`string`
#### Returns
`void`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/classes/messagecomponentinteraction/
---
# MessageComponentInteraction
Defined in: [sdk/js/src/interactions/component.ts:17](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/component.ts#L17)
A click on a button or a choice in a select.
## Extends
- [`ModalCapableInteraction`](/docs/reference/js/zaun-bot/classes/modalcapableinteraction/)
## Constructors
### Constructor
> **new MessageComponentInteraction**(`raw`, `data`): `MessageComponentInteraction`
Defined in: [sdk/js/src/interactions/component.ts:25](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/component.ts#L25)
#### Parameters
##### raw
`Interaction`
##### data
`ComponentData`
#### Returns
`MessageComponentInteraction`
#### Overrides
[`ModalCapableInteraction`](/docs/reference/js/zaun-bot/classes/modalcapableinteraction/).[`constructor`](/docs/reference/js/zaun-bot/classes/modalcapableinteraction/#constructor)
## Properties
### appPermissions
> `readonly` **appPermissions**: `bigint`
Defined in: [sdk/js/src/interactions/base.ts:20](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L20)
The bot's effective permissions in the channel.
#### Inherited from
[`ModalCapableInteraction`](/docs/reference/js/zaun-bot/classes/modalcapableinteraction/).[`appPermissions`](/docs/reference/js/zaun-bot/classes/modalcapableinteraction/#apppermissions)
***
### botId
> `readonly` **botId**: `string`
Defined in: [sdk/js/src/interactions/base.ts:15](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L15)
The bot's id in this community.
#### Inherited from
[`ModalCapableInteraction`](/docs/reference/js/zaun-bot/classes/modalcapableinteraction/).[`botId`](/docs/reference/js/zaun-bot/classes/modalcapableinteraction/#botid)
***
### channelId
> `readonly` **channelId**: `string`
Defined in: [sdk/js/src/interactions/base.ts:16](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L16)
#### Inherited from
[`ModalCapableInteraction`](/docs/reference/js/zaun-bot/classes/modalcapableinteraction/).[`channelId`](/docs/reference/js/zaun-bot/classes/modalcapableinteraction/#channelid)
***
### component
> `readonly` **component**: `ComponentData`
Defined in: [sdk/js/src/interactions/component.ts:23](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/component.ts#L23)
The WIT component data.
***
### componentType
> `readonly` **componentType**: `number`
Defined in: [sdk/js/src/interactions/component.ts:19](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/component.ts#L19)
***
### createdTimestamp
> `readonly` **createdTimestamp**: `number`
Defined in: [sdk/js/src/interactions/base.ts:24](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L24)
When the host received it, ms.
#### Inherited from
[`ModalCapableInteraction`](/docs/reference/js/zaun-bot/classes/modalcapableinteraction/).[`createdTimestamp`](/docs/reference/js/zaun-bot/classes/modalcapableinteraction/#createdtimestamp)
***
### customId
> `readonly` **customId**: `string`
Defined in: [sdk/js/src/interactions/component.ts:18](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/component.ts#L18)
***
### deferred
> **deferred**: `boolean` = `false`
Defined in: [sdk/js/src/interactions/base.ts:30](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L30)
Whether the response was deferred.
#### Inherited from
[`ModalCapableInteraction`](/docs/reference/js/zaun-bot/classes/modalcapableinteraction/).[`deferred`](/docs/reference/js/zaun-bot/classes/modalcapableinteraction/#deferred)
***
### id
> `readonly` **id**: `string`
Defined in: [sdk/js/src/interactions/base.ts:13](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L13)
The interaction id.
#### Inherited from
[`ModalCapableInteraction`](/docs/reference/js/zaun-bot/classes/modalcapableinteraction/).[`id`](/docs/reference/js/zaun-bot/classes/modalcapableinteraction/#id)
***
### locale
> `readonly` **locale**: `string`
Defined in: [sdk/js/src/interactions/base.ts:22](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L22)
The invoker's locale (BCP 47), if their client sent one.
#### Inherited from
[`ModalCapableInteraction`](/docs/reference/js/zaun-bot/classes/modalcapableinteraction/).[`locale`](/docs/reference/js/zaun-bot/classes/modalcapableinteraction/#locale)
***
### member
> `readonly` **member**: [`Member`](/docs/reference/js/zaun-bot/classes/member/)
Defined in: [sdk/js/src/interactions/base.ts:18](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L18)
Who triggered it: `interaction.member.send(...)` sends them a DM.
#### Inherited from
[`ModalCapableInteraction`](/docs/reference/js/zaun-bot/classes/modalcapableinteraction/).[`member`](/docs/reference/js/zaun-bot/classes/modalcapableinteraction/#member)
***
### message
> `readonly` **message**: [`Message`](/docs/reference/js/zaun-bot/classes/message/)
Defined in: [sdk/js/src/interactions/component.ts:21](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/component.ts#L21)
The message holding the component.
***
### raw
> `readonly` **raw**: `Interaction`
Defined in: [sdk/js/src/interactions/base.ts:26](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L26)
The WIT interaction, for anything the classes do not expose.
#### Inherited from
[`ModalCapableInteraction`](/docs/reference/js/zaun-bot/classes/modalcapableinteraction/).[`raw`](/docs/reference/js/zaun-bot/classes/modalcapableinteraction/#raw)
***
### replied
> **replied**: `boolean` = `false`
Defined in: [sdk/js/src/interactions/base.ts:28](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L28)
Whether an initial response was sent.
#### Inherited from
[`ModalCapableInteraction`](/docs/reference/js/zaun-bot/classes/modalcapableinteraction/).[`replied`](/docs/reference/js/zaun-bot/classes/modalcapableinteraction/#replied)
## Accessors
### userId
#### Get Signature
> **get** **userId**(): `string`
Defined in: [sdk/js/src/interactions/base.ts:44](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L44)
The invoker's member id.
##### Returns
`string`
#### Inherited from
[`ModalCapableInteraction`](/docs/reference/js/zaun-bot/classes/modalcapableinteraction/).[`userId`](/docs/reference/js/zaun-bot/classes/modalcapableinteraction/#userid)
***
### values
#### Get Signature
> **get** **values**(): `string`[]
Defined in: [sdk/js/src/interactions/component.ts:46](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/component.ts#L46)
Chosen values of a select (option values or ids).
##### Returns
`string`[]
## Methods
### deferReply()
> **deferReply**(`options?`): `void`
Defined in: [sdk/js/src/interactions/base.ts:81](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L81)
Shows "thinking…" and buys 15 minutes; finish with [editReply](/docs/reference/js/zaun-bot/classes/repliableinteraction/#editreply).
#### Parameters
##### options?
###### ephemeral?
`boolean`
#### Returns
`void`
#### Inherited from
[`ModalCapableInteraction`](/docs/reference/js/zaun-bot/classes/modalcapableinteraction/).[`deferReply`](/docs/reference/js/zaun-bot/classes/modalcapableinteraction/#deferreply)
***
### deferUpdate()
> **deferUpdate**(): `void`
Defined in: [sdk/js/src/interactions/component.ts:56](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/component.ts#L56)
Acknowledges the click without changing anything yet; finish with `editReply`.
#### Returns
`void`
***
### deleteReply()
> **deleteReply**(): `void`
Defined in: [sdk/js/src/interactions/base.ts:92](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L92)
Deletes the original response.
#### Returns
`void`
#### Inherited from
[`ModalCapableInteraction`](/docs/reference/js/zaun-bot/classes/modalcapableinteraction/).[`deleteReply`](/docs/reference/js/zaun-bot/classes/modalcapableinteraction/#deletereply)
***
### editReply()
> **editReply**(`payload`): `void`
Defined in: [sdk/js/src/interactions/base.ts:87](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L87)
Replaces the original response (ends a deferred reply).
#### Parameters
##### payload
[`MessagePayload`](/docs/reference/js/zaun-bot/type-aliases/messagepayload/)
#### Returns
`void`
#### Inherited from
[`ModalCapableInteraction`](/docs/reference/js/zaun-bot/classes/modalcapableinteraction/).[`editReply`](/docs/reference/js/zaun-bot/classes/modalcapableinteraction/#editreply)
***
### followUp()
> **followUp**(`payload`): `string`
Defined in: [sdk/js/src/interactions/base.ts:97](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L97)
Another message, within 15 minutes (at most 10).
#### Parameters
##### payload
[`MessagePayload`](/docs/reference/js/zaun-bot/type-aliases/messagepayload/)
#### Returns
`string`
#### Inherited from
[`ModalCapableInteraction`](/docs/reference/js/zaun-bot/classes/modalcapableinteraction/).[`followUp`](/docs/reference/js/zaun-bot/classes/modalcapableinteraction/#followup)
***
### isAnySelectMenu()
> **isAnySelectMenu**(): `boolean`
Defined in: [sdk/js/src/interactions/component.ts:40](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/component.ts#L40)
#### Returns
`boolean`
#### Overrides
[`ModalCapableInteraction`](/docs/reference/js/zaun-bot/classes/modalcapableinteraction/).[`isAnySelectMenu`](/docs/reference/js/zaun-bot/classes/modalcapableinteraction/#isanyselectmenu)
***
### isAutocomplete()
> **isAutocomplete**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:69](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L69)
#### Returns
`boolean`
#### Inherited from
[`ModalCapableInteraction`](/docs/reference/js/zaun-bot/classes/modalcapableinteraction/).[`isAutocomplete`](/docs/reference/js/zaun-bot/classes/modalcapableinteraction/#isautocomplete)
***
### isButton()
> **isButton**(): `boolean`
Defined in: [sdk/js/src/interactions/component.ts:34](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/component.ts#L34)
#### Returns
`boolean`
#### Overrides
[`ModalCapableInteraction`](/docs/reference/js/zaun-bot/classes/modalcapableinteraction/).[`isButton`](/docs/reference/js/zaun-bot/classes/modalcapableinteraction/#isbutton)
***
### isChannelSelectMenu()
> **isChannelSelectMenu**(): `boolean`
Defined in: [sdk/js/src/interactions/component.ts:39](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/component.ts#L39)
#### Returns
`boolean`
#### Overrides
[`ModalCapableInteraction`](/docs/reference/js/zaun-bot/classes/modalcapableinteraction/).[`isChannelSelectMenu`](/docs/reference/js/zaun-bot/classes/modalcapableinteraction/#ischannelselectmenu)
***
### isChatInputCommand()
> **isChatInputCommand**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:55](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L55)
#### Returns
`boolean`
#### Inherited from
[`ModalCapableInteraction`](/docs/reference/js/zaun-bot/classes/modalcapableinteraction/).[`isChatInputCommand`](/docs/reference/js/zaun-bot/classes/modalcapableinteraction/#ischatinputcommand)
***
### isCommand()
> **isCommand**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:59](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L59)
#### Returns
`boolean`
#### Inherited from
[`ModalCapableInteraction`](/docs/reference/js/zaun-bot/classes/modalcapableinteraction/).[`isCommand`](/docs/reference/js/zaun-bot/classes/modalcapableinteraction/#iscommand)
***
### isContextMenuCommand()
> **isContextMenuCommand**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:56](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L56)
#### Returns
`boolean`
#### Inherited from
[`ModalCapableInteraction`](/docs/reference/js/zaun-bot/classes/modalcapableinteraction/).[`isContextMenuCommand`](/docs/reference/js/zaun-bot/classes/modalcapableinteraction/#iscontextmenucommand)
***
### isMentionableSelectMenu()
> **isMentionableSelectMenu**(): `boolean`
Defined in: [sdk/js/src/interactions/component.ts:38](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/component.ts#L38)
#### Returns
`boolean`
#### Overrides
[`ModalCapableInteraction`](/docs/reference/js/zaun-bot/classes/modalcapableinteraction/).[`isMentionableSelectMenu`](/docs/reference/js/zaun-bot/classes/modalcapableinteraction/#ismentionableselectmenu)
***
### isMessageComponent()
> **isMessageComponent**(): `this is MessageComponentInteraction`
Defined in: [sdk/js/src/interactions/component.ts:33](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/component.ts#L33)
#### Returns
`this is MessageComponentInteraction`
#### Overrides
[`ModalCapableInteraction`](/docs/reference/js/zaun-bot/classes/modalcapableinteraction/).[`isMessageComponent`](/docs/reference/js/zaun-bot/classes/modalcapableinteraction/#ismessagecomponent)
***
### isMessageContextMenuCommand()
> **isMessageContextMenuCommand**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:58](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L58)
#### Returns
`boolean`
#### Inherited from
[`ModalCapableInteraction`](/docs/reference/js/zaun-bot/classes/modalcapableinteraction/).[`isMessageContextMenuCommand`](/docs/reference/js/zaun-bot/classes/modalcapableinteraction/#ismessagecontextmenucommand)
***
### isModalSubmit()
> **isModalSubmit**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:68](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L68)
#### Returns
`boolean`
#### Inherited from
[`ModalCapableInteraction`](/docs/reference/js/zaun-bot/classes/modalcapableinteraction/).[`isModalSubmit`](/docs/reference/js/zaun-bot/classes/modalcapableinteraction/#ismodalsubmit)
***
### isRepliable()
> **isRepliable**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:70](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L70)
#### Returns
`boolean`
#### Inherited from
[`ModalCapableInteraction`](/docs/reference/js/zaun-bot/classes/modalcapableinteraction/).[`isRepliable`](/docs/reference/js/zaun-bot/classes/modalcapableinteraction/#isrepliable)
***
### isRoleSelectMenu()
> **isRoleSelectMenu**(): `boolean`
Defined in: [sdk/js/src/interactions/component.ts:37](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/component.ts#L37)
#### Returns
`boolean`
#### Overrides
[`ModalCapableInteraction`](/docs/reference/js/zaun-bot/classes/modalcapableinteraction/).[`isRoleSelectMenu`](/docs/reference/js/zaun-bot/classes/modalcapableinteraction/#isroleselectmenu)
***
### isStringSelectMenu()
> **isStringSelectMenu**(): `boolean`
Defined in: [sdk/js/src/interactions/component.ts:35](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/component.ts#L35)
#### Returns
`boolean`
#### Overrides
[`ModalCapableInteraction`](/docs/reference/js/zaun-bot/classes/modalcapableinteraction/).[`isStringSelectMenu`](/docs/reference/js/zaun-bot/classes/modalcapableinteraction/#isstringselectmenu)
***
### isUserContextMenuCommand()
> **isUserContextMenuCommand**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:57](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L57)
#### Returns
`boolean`
#### Inherited from
[`ModalCapableInteraction`](/docs/reference/js/zaun-bot/classes/modalcapableinteraction/).[`isUserContextMenuCommand`](/docs/reference/js/zaun-bot/classes/modalcapableinteraction/#isusercontextmenucommand)
***
### isUserSelectMenu()
> **isUserSelectMenu**(): `boolean`
Defined in: [sdk/js/src/interactions/component.ts:36](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/component.ts#L36)
#### Returns
`boolean`
#### Overrides
[`ModalCapableInteraction`](/docs/reference/js/zaun-bot/classes/modalcapableinteraction/).[`isUserSelectMenu`](/docs/reference/js/zaun-bot/classes/modalcapableinteraction/#isuserselectmenu)
***
### reply()
> **reply**(`payload`): `string`
Defined in: [sdk/js/src/interactions/base.ts:76](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L76)
Answers with a message in the channel (or only to the invoker with `ephemeral`).
#### Parameters
##### payload
[`MessagePayload`](/docs/reference/js/zaun-bot/type-aliases/messagepayload/)
#### Returns
`string`
#### Inherited from
[`ModalCapableInteraction`](/docs/reference/js/zaun-bot/classes/modalcapableinteraction/).[`reply`](/docs/reference/js/zaun-bot/classes/modalcapableinteraction/#reply)
***
### showModal()
> **showModal**(`modal`): `void`
Defined in: [sdk/js/src/interactions/base.ts:105](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L105)
Opens a modal for the invoker.
#### Parameters
##### modal
[`ModalBuilder`](/docs/reference/js/zaun-bot/classes/modalbuilder/)
#### Returns
`void`
#### Inherited from
[`ModalCapableInteraction`](/docs/reference/js/zaun-bot/classes/modalcapableinteraction/).[`showModal`](/docs/reference/js/zaun-bot/classes/modalcapableinteraction/#showmodal)
***
### update()
> **update**(`payload`): `void`
Defined in: [sdk/js/src/interactions/component.ts:51](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/component.ts#L51)
Replaces the message holding the component (it must be the bot's).
#### Parameters
##### payload
[`MessagePayload`](/docs/reference/js/zaun-bot/type-aliases/messagepayload/)
#### Returns
`void`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/classes/messagecontextmenucommandinteraction/
---
# MessageContextMenuCommandInteraction
Defined in: [sdk/js/src/interactions/command.ts:54](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/command.ts#L54)
A message context-menu command.
## Extends
- `CommandInteraction`
## Constructors
### Constructor
> **new MessageContextMenuCommandInteraction**(`raw`, `data`): `MessageContextMenuCommandInteraction`
Defined in: [sdk/js/src/interactions/command.ts:26](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/command.ts#L26)
#### Parameters
##### raw
`Interaction`
##### data
`CommandData`
#### Returns
`MessageContextMenuCommandInteraction`
#### Inherited from
`CommandInteraction.constructor`
## Properties
### appPermissions
> `readonly` **appPermissions**: `bigint`
Defined in: [sdk/js/src/interactions/base.ts:20](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L20)
The bot's effective permissions in the channel.
#### Inherited from
`CommandInteraction.appPermissions`
***
### botId
> `readonly` **botId**: `string`
Defined in: [sdk/js/src/interactions/base.ts:15](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L15)
The bot's id in this community.
#### Inherited from
`CommandInteraction.botId`
***
### channelId
> `readonly` **channelId**: `string`
Defined in: [sdk/js/src/interactions/base.ts:16](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L16)
#### Inherited from
`CommandInteraction.channelId`
***
### command
> `readonly` **command**: `CommandData`
Defined in: [sdk/js/src/interactions/command.ts:24](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/command.ts#L24)
The WIT command data.
#### Inherited from
`CommandInteraction.command`
***
### commandId
> `readonly` **commandId**: `string`
Defined in: [sdk/js/src/interactions/command.ts:20](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/command.ts#L20)
#### Inherited from
`CommandInteraction.commandId`
***
### commandName
> `readonly` **commandName**: `string`
Defined in: [sdk/js/src/interactions/command.ts:21](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/command.ts#L21)
#### Inherited from
`CommandInteraction.commandName`
***
### createdTimestamp
> `readonly` **createdTimestamp**: `number`
Defined in: [sdk/js/src/interactions/base.ts:24](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L24)
When the host received it, ms.
#### Inherited from
`CommandInteraction.createdTimestamp`
***
### deferred
> **deferred**: `boolean` = `false`
Defined in: [sdk/js/src/interactions/base.ts:30](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L30)
Whether the response was deferred.
#### Inherited from
`CommandInteraction.deferred`
***
### id
> `readonly` **id**: `string`
Defined in: [sdk/js/src/interactions/base.ts:13](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L13)
The interaction id.
#### Inherited from
`CommandInteraction.id`
***
### locale
> `readonly` **locale**: `string`
Defined in: [sdk/js/src/interactions/base.ts:22](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L22)
The invoker's locale (BCP 47), if their client sent one.
#### Inherited from
`CommandInteraction.locale`
***
### member
> `readonly` **member**: [`Member`](/docs/reference/js/zaun-bot/classes/member/)
Defined in: [sdk/js/src/interactions/base.ts:18](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L18)
Who triggered it: `interaction.member.send(...)` sends them a DM.
#### Inherited from
`CommandInteraction.member`
***
### options
> `readonly` **options**: [`CommandInteractionOptionResolver`](/docs/reference/js/zaun-bot/classes/commandinteractionoptionresolver/)
Defined in: [sdk/js/src/interactions/command.ts:22](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/command.ts#L22)
#### Inherited from
`CommandInteraction.options`
***
### raw
> `readonly` **raw**: `Interaction`
Defined in: [sdk/js/src/interactions/base.ts:26](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L26)
The WIT interaction, for anything the classes do not expose.
#### Inherited from
`CommandInteraction.raw`
***
### replied
> **replied**: `boolean` = `false`
Defined in: [sdk/js/src/interactions/base.ts:28](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L28)
Whether an initial response was sent.
#### Inherited from
`CommandInteraction.replied`
## Accessors
### targetId
#### Get Signature
> **get** **targetId**(): `string`
Defined in: [sdk/js/src/interactions/command.ts:58](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/command.ts#L58)
The message acted on.
##### Returns
`string`
***
### targetMessage
#### Get Signature
> **get** **targetMessage**(): [`Message`](/docs/reference/js/zaun-bot/classes/message/)
Defined in: [sdk/js/src/interactions/command.ts:61](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/command.ts#L61)
##### Returns
[`Message`](/docs/reference/js/zaun-bot/classes/message/)
***
### userId
#### Get Signature
> **get** **userId**(): `string`
Defined in: [sdk/js/src/interactions/base.ts:44](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L44)
The invoker's member id.
##### Returns
`string`
#### Inherited from
`CommandInteraction.userId`
## Methods
### deferReply()
> **deferReply**(`options?`): `void`
Defined in: [sdk/js/src/interactions/base.ts:81](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L81)
Shows "thinking…" and buys 15 minutes; finish with [editReply](/docs/reference/js/zaun-bot/classes/repliableinteraction/#editreply).
#### Parameters
##### options?
###### ephemeral?
`boolean`
#### Returns
`void`
#### Inherited from
`CommandInteraction.deferReply`
***
### deleteReply()
> **deleteReply**(): `void`
Defined in: [sdk/js/src/interactions/base.ts:92](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L92)
Deletes the original response.
#### Returns
`void`
#### Inherited from
`CommandInteraction.deleteReply`
***
### editReply()
> **editReply**(`payload`): `void`
Defined in: [sdk/js/src/interactions/base.ts:87](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L87)
Replaces the original response (ends a deferred reply).
#### Parameters
##### payload
[`MessagePayload`](/docs/reference/js/zaun-bot/type-aliases/messagepayload/)
#### Returns
`void`
#### Inherited from
`CommandInteraction.editReply`
***
### followUp()
> **followUp**(`payload`): `string`
Defined in: [sdk/js/src/interactions/base.ts:97](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L97)
Another message, within 15 minutes (at most 10).
#### Parameters
##### payload
[`MessagePayload`](/docs/reference/js/zaun-bot/type-aliases/messagepayload/)
#### Returns
`string`
#### Inherited from
`CommandInteraction.followUp`
***
### isAnySelectMenu()
> **isAnySelectMenu**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:67](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L67)
#### Returns
`boolean`
#### Inherited from
`CommandInteraction.isAnySelectMenu`
***
### isAutocomplete()
> **isAutocomplete**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:69](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L69)
#### Returns
`boolean`
#### Inherited from
`CommandInteraction.isAutocomplete`
***
### isButton()
> **isButton**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:61](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L61)
#### Returns
`boolean`
#### Inherited from
`CommandInteraction.isButton`
***
### isChannelSelectMenu()
> **isChannelSelectMenu**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:66](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L66)
#### Returns
`boolean`
#### Inherited from
`CommandInteraction.isChannelSelectMenu`
***
### isChatInputCommand()
> **isChatInputCommand**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:55](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L55)
#### Returns
`boolean`
#### Inherited from
`CommandInteraction.isChatInputCommand`
***
### isCommand()
> **isCommand**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:59](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L59)
#### Returns
`boolean`
#### Inherited from
`CommandInteraction.isCommand`
***
### isContextMenuCommand()
> **isContextMenuCommand**(): `boolean`
Defined in: [sdk/js/src/interactions/command.ts:55](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/command.ts#L55)
#### Returns
`boolean`
#### Overrides
`CommandInteraction.isContextMenuCommand`
***
### isMentionableSelectMenu()
> **isMentionableSelectMenu**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:65](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L65)
#### Returns
`boolean`
#### Inherited from
`CommandInteraction.isMentionableSelectMenu`
***
### isMessageComponent()
> **isMessageComponent**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:60](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L60)
#### Returns
`boolean`
#### Inherited from
`CommandInteraction.isMessageComponent`
***
### isMessageContextMenuCommand()
> **isMessageContextMenuCommand**(): `this is MessageContextMenuCommandInteraction`
Defined in: [sdk/js/src/interactions/command.ts:56](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/command.ts#L56)
#### Returns
`this is MessageContextMenuCommandInteraction`
#### Overrides
`CommandInteraction.isMessageContextMenuCommand`
***
### isModalSubmit()
> **isModalSubmit**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:68](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L68)
#### Returns
`boolean`
#### Inherited from
`CommandInteraction.isModalSubmit`
***
### isRepliable()
> **isRepliable**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:70](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L70)
#### Returns
`boolean`
#### Inherited from
`CommandInteraction.isRepliable`
***
### isRoleSelectMenu()
> **isRoleSelectMenu**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:64](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L64)
#### Returns
`boolean`
#### Inherited from
`CommandInteraction.isRoleSelectMenu`
***
### isStringSelectMenu()
> **isStringSelectMenu**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:62](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L62)
#### Returns
`boolean`
#### Inherited from
`CommandInteraction.isStringSelectMenu`
***
### isUserContextMenuCommand()
> **isUserContextMenuCommand**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:57](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L57)
#### Returns
`boolean`
#### Inherited from
`CommandInteraction.isUserContextMenuCommand`
***
### isUserSelectMenu()
> **isUserSelectMenu**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:63](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L63)
#### Returns
`boolean`
#### Inherited from
`CommandInteraction.isUserSelectMenu`
***
### reply()
> **reply**(`payload`): `string`
Defined in: [sdk/js/src/interactions/base.ts:76](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L76)
Answers with a message in the channel (or only to the invoker with `ephemeral`).
#### Parameters
##### payload
[`MessagePayload`](/docs/reference/js/zaun-bot/type-aliases/messagepayload/)
#### Returns
`string`
#### Inherited from
`CommandInteraction.reply`
***
### showModal()
> **showModal**(`modal`): `void`
Defined in: [sdk/js/src/interactions/base.ts:105](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L105)
Opens a modal for the invoker.
#### Parameters
##### modal
[`ModalBuilder`](/docs/reference/js/zaun-bot/classes/modalbuilder/)
#### Returns
`void`
#### Inherited from
`CommandInteraction.showModal`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/classes/messagementions/
---
# MessageMentions
Defined in: [sdk/js/src/mention.ts:64](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/mention.ts#L64)
Who a message mentions, as the host honoured them.
## Implements
- `Mentions`
## Constructors
### Constructor
> **new MessageMentions**(`raw`): `MessageMentions`
Defined in: [sdk/js/src/mention.ts:69](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/mention.ts#L69)
#### Parameters
##### raw
`Mentions`
#### Returns
`MessageMentions`
## Properties
### everyone
> `readonly` **everyone**: `boolean`
Defined in: [sdk/js/src/mention.ts:65](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/mention.ts#L65)
#### Implementation of
`wit.Mentions.everyone`
***
### members
> `readonly` **members**: `string`[]
Defined in: [sdk/js/src/mention.ts:66](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/mention.ts#L66)
#### Implementation of
`wit.Mentions.members`
***
### roles
> `readonly` **roles**: `string`[]
Defined in: [sdk/js/src/mention.ts:67](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/mention.ts#L67)
#### Implementation of
`wit.Mentions.roles`
## Methods
### hasMember()
> **hasMember**(`id`): `boolean`
Defined in: [sdk/js/src/mention.ts:76](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/mention.ts#L76)
Whether member `id` is named.
#### Parameters
##### id
`string`
#### Returns
`boolean`
***
### hasRole()
> **hasRole**(`id`): `boolean`
Defined in: [sdk/js/src/mention.ts:81](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/mention.ts#L81)
Whether role `id` is named.
#### Parameters
##### id
`string`
#### Returns
`boolean`
***
### includes()
> **includes**(`memberId`, `roleIds?`): `boolean`
Defined in: [sdk/js/src/mention.ts:89](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/mention.ts#L89)
Whether a member with `memberId` and `roleIds` is mentioned: by id, by one of its roles, or
by `@everyone``).
#### Parameters
##### memberId
`string`
##### roleIds?
readonly `string`[] = `[]`
#### Returns
`boolean`
***
### isEmpty()
> **isEmpty**(): `boolean`
Defined in: [sdk/js/src/mention.ts:94](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/mention.ts#L94)
Whether nobody is mentioned.
#### Returns
`boolean`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/classes/modalbuilder/
---
# ModalBuilder
Defined in: [sdk/js/src/builders/modal.ts:61](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/modal.ts#L61)
A modal (callback type 9): 1–5 labels or text displays.
## Constructors
### Constructor
> **new ModalBuilder**(): `ModalBuilder`
#### Returns
`ModalBuilder`
## Methods
### addComponents()
> **addComponents**(...`rows`): `this`
Defined in: [sdk/js/src/builders/modal.ts:90](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/modal.ts#L90)
Rows each holding one text input become labelled inputs (the label is
the input's custom id unless `setLabel` was called on a [LabelBuilder](/docs/reference/js/zaun-bot/classes/labelbuilder/)).
#### Parameters
##### rows
([`TextDisplayBuilder`](/docs/reference/js/zaun-bot/classes/textdisplaybuilder/) \| [`LabelBuilder`](/docs/reference/js/zaun-bot/classes/labelbuilder/))[] \| [`ActionRowBuilder`](/docs/reference/js/zaun-bot/classes/actionrowbuilder/)\<`never`\>[]
#### Returns
`this`
***
### addLabelComponents()
> **addLabelComponents**(...`labels`): `this`
Defined in: [sdk/js/src/builders/modal.ts:74](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/modal.ts#L74)
#### Parameters
##### labels
...[`LabelBuilder`](/docs/reference/js/zaun-bot/classes/labelbuilder/)[]
#### Returns
`this`
***
### addTextDisplayComponents()
> **addTextDisplayComponents**(...`texts`): `this`
Defined in: [sdk/js/src/builders/modal.ts:78](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/modal.ts#L78)
#### Parameters
##### texts
...[`TextDisplayBuilder`](/docs/reference/js/zaun-bot/classes/textdisplaybuilder/)[]
#### Returns
`this`
***
### addTextInput()
> **addTextInput**(`label`, `input`): `this`
Defined in: [sdk/js/src/builders/modal.ts:83](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/modal.ts#L83)
Shortcut: a labelled text input.
#### Parameters
##### label
`string`
##### input
[`TextInputBuilder`](/docs/reference/js/zaun-bot/classes/textinputbuilder/)
#### Returns
`this`
***
### setCustomId()
> **setCustomId**(`id`): `this`
Defined in: [sdk/js/src/builders/modal.ts:66](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/modal.ts#L66)
#### Parameters
##### id
`string`
#### Returns
`this`
***
### setTitle()
> **setTitle**(`title`): `this`
Defined in: [sdk/js/src/builders/modal.ts:70](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/modal.ts#L70)
#### Parameters
##### title
`string`
#### Returns
`this`
***
### toWit()
> **toWit**(): `Modal`
Defined in: [sdk/js/src/builders/modal.ts:97](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/modal.ts#L97)
#### Returns
`Modal`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/classes/modalcapableinteraction/
---
# ModalCapableInteraction
Defined in: [sdk/js/src/interactions/base.ts:103](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L103)
Interactions that may open a modal (commands and components, not modal submits).
## Extends
- [`RepliableInteraction`](/docs/reference/js/zaun-bot/classes/repliableinteraction/)
## Extended by
- [`MessageComponentInteraction`](/docs/reference/js/zaun-bot/classes/messagecomponentinteraction/)
## Constructors
### Constructor
> **new ModalCapableInteraction**(`raw`): `ModalCapableInteraction`
Defined in: [sdk/js/src/interactions/base.ts:32](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L32)
#### Parameters
##### raw
`Interaction`
#### Returns
`ModalCapableInteraction`
#### Inherited from
[`RepliableInteraction`](/docs/reference/js/zaun-bot/classes/repliableinteraction/).[`constructor`](/docs/reference/js/zaun-bot/classes/repliableinteraction/#constructor)
## Properties
### appPermissions
> `readonly` **appPermissions**: `bigint`
Defined in: [sdk/js/src/interactions/base.ts:20](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L20)
The bot's effective permissions in the channel.
#### Inherited from
[`RepliableInteraction`](/docs/reference/js/zaun-bot/classes/repliableinteraction/).[`appPermissions`](/docs/reference/js/zaun-bot/classes/repliableinteraction/#apppermissions)
***
### botId
> `readonly` **botId**: `string`
Defined in: [sdk/js/src/interactions/base.ts:15](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L15)
The bot's id in this community.
#### Inherited from
[`RepliableInteraction`](/docs/reference/js/zaun-bot/classes/repliableinteraction/).[`botId`](/docs/reference/js/zaun-bot/classes/repliableinteraction/#botid)
***
### channelId
> `readonly` **channelId**: `string`
Defined in: [sdk/js/src/interactions/base.ts:16](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L16)
#### Inherited from
[`RepliableInteraction`](/docs/reference/js/zaun-bot/classes/repliableinteraction/).[`channelId`](/docs/reference/js/zaun-bot/classes/repliableinteraction/#channelid)
***
### createdTimestamp
> `readonly` **createdTimestamp**: `number`
Defined in: [sdk/js/src/interactions/base.ts:24](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L24)
When the host received it, ms.
#### Inherited from
[`RepliableInteraction`](/docs/reference/js/zaun-bot/classes/repliableinteraction/).[`createdTimestamp`](/docs/reference/js/zaun-bot/classes/repliableinteraction/#createdtimestamp)
***
### deferred
> **deferred**: `boolean` = `false`
Defined in: [sdk/js/src/interactions/base.ts:30](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L30)
Whether the response was deferred.
#### Inherited from
[`RepliableInteraction`](/docs/reference/js/zaun-bot/classes/repliableinteraction/).[`deferred`](/docs/reference/js/zaun-bot/classes/repliableinteraction/#deferred)
***
### id
> `readonly` **id**: `string`
Defined in: [sdk/js/src/interactions/base.ts:13](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L13)
The interaction id.
#### Inherited from
[`RepliableInteraction`](/docs/reference/js/zaun-bot/classes/repliableinteraction/).[`id`](/docs/reference/js/zaun-bot/classes/repliableinteraction/#id)
***
### locale
> `readonly` **locale**: `string`
Defined in: [sdk/js/src/interactions/base.ts:22](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L22)
The invoker's locale (BCP 47), if their client sent one.
#### Inherited from
[`RepliableInteraction`](/docs/reference/js/zaun-bot/classes/repliableinteraction/).[`locale`](/docs/reference/js/zaun-bot/classes/repliableinteraction/#locale)
***
### member
> `readonly` **member**: [`Member`](/docs/reference/js/zaun-bot/classes/member/)
Defined in: [sdk/js/src/interactions/base.ts:18](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L18)
Who triggered it: `interaction.member.send(...)` sends them a DM.
#### Inherited from
[`RepliableInteraction`](/docs/reference/js/zaun-bot/classes/repliableinteraction/).[`member`](/docs/reference/js/zaun-bot/classes/repliableinteraction/#member)
***
### raw
> `readonly` **raw**: `Interaction`
Defined in: [sdk/js/src/interactions/base.ts:26](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L26)
The WIT interaction, for anything the classes do not expose.
#### Inherited from
[`RepliableInteraction`](/docs/reference/js/zaun-bot/classes/repliableinteraction/).[`raw`](/docs/reference/js/zaun-bot/classes/repliableinteraction/#raw)
***
### replied
> **replied**: `boolean` = `false`
Defined in: [sdk/js/src/interactions/base.ts:28](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L28)
Whether an initial response was sent.
#### Inherited from
[`RepliableInteraction`](/docs/reference/js/zaun-bot/classes/repliableinteraction/).[`replied`](/docs/reference/js/zaun-bot/classes/repliableinteraction/#replied)
## Accessors
### userId
#### Get Signature
> **get** **userId**(): `string`
Defined in: [sdk/js/src/interactions/base.ts:44](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L44)
The invoker's member id.
##### Returns
`string`
#### Inherited from
[`RepliableInteraction`](/docs/reference/js/zaun-bot/classes/repliableinteraction/).[`userId`](/docs/reference/js/zaun-bot/classes/repliableinteraction/#userid)
## Methods
### deferReply()
> **deferReply**(`options?`): `void`
Defined in: [sdk/js/src/interactions/base.ts:81](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L81)
Shows "thinking…" and buys 15 minutes; finish with [editReply](/docs/reference/js/zaun-bot/classes/repliableinteraction/#editreply).
#### Parameters
##### options?
###### ephemeral?
`boolean`
#### Returns
`void`
#### Inherited from
[`RepliableInteraction`](/docs/reference/js/zaun-bot/classes/repliableinteraction/).[`deferReply`](/docs/reference/js/zaun-bot/classes/repliableinteraction/#deferreply)
***
### deleteReply()
> **deleteReply**(): `void`
Defined in: [sdk/js/src/interactions/base.ts:92](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L92)
Deletes the original response.
#### Returns
`void`
#### Inherited from
[`RepliableInteraction`](/docs/reference/js/zaun-bot/classes/repliableinteraction/).[`deleteReply`](/docs/reference/js/zaun-bot/classes/repliableinteraction/#deletereply)
***
### editReply()
> **editReply**(`payload`): `void`
Defined in: [sdk/js/src/interactions/base.ts:87](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L87)
Replaces the original response (ends a deferred reply).
#### Parameters
##### payload
[`MessagePayload`](/docs/reference/js/zaun-bot/type-aliases/messagepayload/)
#### Returns
`void`
#### Inherited from
[`RepliableInteraction`](/docs/reference/js/zaun-bot/classes/repliableinteraction/).[`editReply`](/docs/reference/js/zaun-bot/classes/repliableinteraction/#editreply)
***
### followUp()
> **followUp**(`payload`): `string`
Defined in: [sdk/js/src/interactions/base.ts:97](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L97)
Another message, within 15 minutes (at most 10).
#### Parameters
##### payload
[`MessagePayload`](/docs/reference/js/zaun-bot/type-aliases/messagepayload/)
#### Returns
`string`
#### Inherited from
[`RepliableInteraction`](/docs/reference/js/zaun-bot/classes/repliableinteraction/).[`followUp`](/docs/reference/js/zaun-bot/classes/repliableinteraction/#followup)
***
### isAnySelectMenu()
> **isAnySelectMenu**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:67](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L67)
#### Returns
`boolean`
#### Inherited from
[`RepliableInteraction`](/docs/reference/js/zaun-bot/classes/repliableinteraction/).[`isAnySelectMenu`](/docs/reference/js/zaun-bot/classes/repliableinteraction/#isanyselectmenu)
***
### isAutocomplete()
> **isAutocomplete**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:69](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L69)
#### Returns
`boolean`
#### Inherited from
[`RepliableInteraction`](/docs/reference/js/zaun-bot/classes/repliableinteraction/).[`isAutocomplete`](/docs/reference/js/zaun-bot/classes/repliableinteraction/#isautocomplete)
***
### isButton()
> **isButton**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:61](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L61)
#### Returns
`boolean`
#### Inherited from
[`RepliableInteraction`](/docs/reference/js/zaun-bot/classes/repliableinteraction/).[`isButton`](/docs/reference/js/zaun-bot/classes/repliableinteraction/#isbutton)
***
### isChannelSelectMenu()
> **isChannelSelectMenu**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:66](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L66)
#### Returns
`boolean`
#### Inherited from
[`RepliableInteraction`](/docs/reference/js/zaun-bot/classes/repliableinteraction/).[`isChannelSelectMenu`](/docs/reference/js/zaun-bot/classes/repliableinteraction/#ischannelselectmenu)
***
### isChatInputCommand()
> **isChatInputCommand**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:55](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L55)
#### Returns
`boolean`
#### Inherited from
[`RepliableInteraction`](/docs/reference/js/zaun-bot/classes/repliableinteraction/).[`isChatInputCommand`](/docs/reference/js/zaun-bot/classes/repliableinteraction/#ischatinputcommand)
***
### isCommand()
> **isCommand**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:59](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L59)
#### Returns
`boolean`
#### Inherited from
[`RepliableInteraction`](/docs/reference/js/zaun-bot/classes/repliableinteraction/).[`isCommand`](/docs/reference/js/zaun-bot/classes/repliableinteraction/#iscommand)
***
### isContextMenuCommand()
> **isContextMenuCommand**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:56](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L56)
#### Returns
`boolean`
#### Inherited from
[`RepliableInteraction`](/docs/reference/js/zaun-bot/classes/repliableinteraction/).[`isContextMenuCommand`](/docs/reference/js/zaun-bot/classes/repliableinteraction/#iscontextmenucommand)
***
### isMentionableSelectMenu()
> **isMentionableSelectMenu**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:65](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L65)
#### Returns
`boolean`
#### Inherited from
[`RepliableInteraction`](/docs/reference/js/zaun-bot/classes/repliableinteraction/).[`isMentionableSelectMenu`](/docs/reference/js/zaun-bot/classes/repliableinteraction/#ismentionableselectmenu)
***
### isMessageComponent()
> **isMessageComponent**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:60](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L60)
#### Returns
`boolean`
#### Inherited from
[`RepliableInteraction`](/docs/reference/js/zaun-bot/classes/repliableinteraction/).[`isMessageComponent`](/docs/reference/js/zaun-bot/classes/repliableinteraction/#ismessagecomponent)
***
### isMessageContextMenuCommand()
> **isMessageContextMenuCommand**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:58](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L58)
#### Returns
`boolean`
#### Inherited from
[`RepliableInteraction`](/docs/reference/js/zaun-bot/classes/repliableinteraction/).[`isMessageContextMenuCommand`](/docs/reference/js/zaun-bot/classes/repliableinteraction/#ismessagecontextmenucommand)
***
### isModalSubmit()
> **isModalSubmit**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:68](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L68)
#### Returns
`boolean`
#### Inherited from
[`RepliableInteraction`](/docs/reference/js/zaun-bot/classes/repliableinteraction/).[`isModalSubmit`](/docs/reference/js/zaun-bot/classes/repliableinteraction/#ismodalsubmit)
***
### isRepliable()
> **isRepliable**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:70](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L70)
#### Returns
`boolean`
#### Inherited from
[`RepliableInteraction`](/docs/reference/js/zaun-bot/classes/repliableinteraction/).[`isRepliable`](/docs/reference/js/zaun-bot/classes/repliableinteraction/#isrepliable)
***
### isRoleSelectMenu()
> **isRoleSelectMenu**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:64](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L64)
#### Returns
`boolean`
#### Inherited from
[`RepliableInteraction`](/docs/reference/js/zaun-bot/classes/repliableinteraction/).[`isRoleSelectMenu`](/docs/reference/js/zaun-bot/classes/repliableinteraction/#isroleselectmenu)
***
### isStringSelectMenu()
> **isStringSelectMenu**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:62](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L62)
#### Returns
`boolean`
#### Inherited from
[`RepliableInteraction`](/docs/reference/js/zaun-bot/classes/repliableinteraction/).[`isStringSelectMenu`](/docs/reference/js/zaun-bot/classes/repliableinteraction/#isstringselectmenu)
***
### isUserContextMenuCommand()
> **isUserContextMenuCommand**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:57](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L57)
#### Returns
`boolean`
#### Inherited from
[`RepliableInteraction`](/docs/reference/js/zaun-bot/classes/repliableinteraction/).[`isUserContextMenuCommand`](/docs/reference/js/zaun-bot/classes/repliableinteraction/#isusercontextmenucommand)
***
### isUserSelectMenu()
> **isUserSelectMenu**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:63](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L63)
#### Returns
`boolean`
#### Inherited from
[`RepliableInteraction`](/docs/reference/js/zaun-bot/classes/repliableinteraction/).[`isUserSelectMenu`](/docs/reference/js/zaun-bot/classes/repliableinteraction/#isuserselectmenu)
***
### reply()
> **reply**(`payload`): `string`
Defined in: [sdk/js/src/interactions/base.ts:76](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L76)
Answers with a message in the channel (or only to the invoker with `ephemeral`).
#### Parameters
##### payload
[`MessagePayload`](/docs/reference/js/zaun-bot/type-aliases/messagepayload/)
#### Returns
`string`
#### Inherited from
[`RepliableInteraction`](/docs/reference/js/zaun-bot/classes/repliableinteraction/).[`reply`](/docs/reference/js/zaun-bot/classes/repliableinteraction/#reply)
***
### showModal()
> **showModal**(`modal`): `void`
Defined in: [sdk/js/src/interactions/base.ts:105](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L105)
Opens a modal for the invoker.
#### Parameters
##### modal
[`ModalBuilder`](/docs/reference/js/zaun-bot/classes/modalbuilder/)
#### Returns
`void`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/classes/modalsubmitfields/
---
# ModalSubmitFields
Defined in: [sdk/js/src/interactions/modal.ts:11](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/modal.ts#L11)
The submitted values by `custom_id`.
## Constructors
### Constructor
> **new ModalSubmitFields**(`data`): `ModalSubmitFields`
Defined in: [sdk/js/src/interactions/modal.ts:12](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/modal.ts#L12)
#### Parameters
##### data
`ModalData`
#### Returns
`ModalSubmitFields`
## Accessors
### all
#### Get Signature
> **get** **all**(): readonly `ModalValue`[]
Defined in: [sdk/js/src/interactions/modal.ts:15](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/modal.ts#L15)
Every submitted value.
##### Returns
readonly `ModalValue`[]
## Methods
### getCheckbox()
> **getCheckbox**(`customId`): `boolean`
Defined in: [sdk/js/src/interactions/modal.ts:37](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/modal.ts#L37)
A checkbox.
#### Parameters
##### customId
`string`
#### Returns
`boolean`
***
### getField()
> **getField**(`customId`, `required?`): `ModalValue`
Defined in: [sdk/js/src/interactions/modal.ts:19](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/modal.ts#L19)
#### Parameters
##### customId
`string`
##### required?
`boolean` = `true`
#### Returns
`ModalValue`
***
### getRadioValue()
> **getRadioValue**(`customId`): `string`
Defined in: [sdk/js/src/interactions/modal.ts:33](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/modal.ts#L33)
A radio group's choice.
#### Parameters
##### customId
`string`
#### Returns
`string`
***
### getSelectedMembers()
> **getSelectedMembers**(`customId`): [`Member`](/docs/reference/js/zaun-bot/classes/member/)[]
Defined in: [sdk/js/src/interactions/modal.ts:41](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/modal.ts#L41)
Members chosen in a user select.
#### Parameters
##### customId
`string`
#### Returns
[`Member`](/docs/reference/js/zaun-bot/classes/member/)[]
***
### getStringSelectValues()
> **getStringSelectValues**(`customId`): `string`[]
Defined in: [sdk/js/src/interactions/modal.ts:29](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/modal.ts#L29)
Values of a select, radio group or checkbox group.
#### Parameters
##### customId
`string`
#### Returns
`string`[]
***
### getTextInputValue()
> **getTextInputValue**(`customId`): `string`
Defined in: [sdk/js/src/interactions/modal.ts:25](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/modal.ts#L25)
A text input's value (`''` when left empty and optional).
#### Parameters
##### customId
`string`
#### Returns
`string`
***
### getUploadedFiles()
> **getUploadedFiles**(`customId`): `Attachment`[]
Defined in: [sdk/js/src/interactions/modal.ts:46](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/modal.ts#L46)
Files uploaded in a file upload.
#### Parameters
##### customId
`string`
#### Returns
`Attachment`[]
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/classes/modalsubmitinteraction/
---
# ModalSubmitInteraction
Defined in: [sdk/js/src/interactions/modal.ts:53](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/modal.ts#L53)
A submitted modal.
## Extends
- [`RepliableInteraction`](/docs/reference/js/zaun-bot/classes/repliableinteraction/)
## Constructors
### Constructor
> **new ModalSubmitInteraction**(`raw`, `data`): `ModalSubmitInteraction`
Defined in: [sdk/js/src/interactions/modal.ts:59](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/modal.ts#L59)
#### Parameters
##### raw
`Interaction`
##### data
`ModalData`
#### Returns
`ModalSubmitInteraction`
#### Overrides
[`RepliableInteraction`](/docs/reference/js/zaun-bot/classes/repliableinteraction/).[`constructor`](/docs/reference/js/zaun-bot/classes/repliableinteraction/#constructor)
## Properties
### appPermissions
> `readonly` **appPermissions**: `bigint`
Defined in: [sdk/js/src/interactions/base.ts:20](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L20)
The bot's effective permissions in the channel.
#### Inherited from
[`RepliableInteraction`](/docs/reference/js/zaun-bot/classes/repliableinteraction/).[`appPermissions`](/docs/reference/js/zaun-bot/classes/repliableinteraction/#apppermissions)
***
### botId
> `readonly` **botId**: `string`
Defined in: [sdk/js/src/interactions/base.ts:15](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L15)
The bot's id in this community.
#### Inherited from
[`RepliableInteraction`](/docs/reference/js/zaun-bot/classes/repliableinteraction/).[`botId`](/docs/reference/js/zaun-bot/classes/repliableinteraction/#botid)
***
### channelId
> `readonly` **channelId**: `string`
Defined in: [sdk/js/src/interactions/base.ts:16](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L16)
#### Inherited from
[`RepliableInteraction`](/docs/reference/js/zaun-bot/classes/repliableinteraction/).[`channelId`](/docs/reference/js/zaun-bot/classes/repliableinteraction/#channelid)
***
### createdTimestamp
> `readonly` **createdTimestamp**: `number`
Defined in: [sdk/js/src/interactions/base.ts:24](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L24)
When the host received it, ms.
#### Inherited from
[`RepliableInteraction`](/docs/reference/js/zaun-bot/classes/repliableinteraction/).[`createdTimestamp`](/docs/reference/js/zaun-bot/classes/repliableinteraction/#createdtimestamp)
***
### customId
> `readonly` **customId**: `string`
Defined in: [sdk/js/src/interactions/modal.ts:54](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/modal.ts#L54)
***
### deferred
> **deferred**: `boolean` = `false`
Defined in: [sdk/js/src/interactions/base.ts:30](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L30)
Whether the response was deferred.
#### Inherited from
[`RepliableInteraction`](/docs/reference/js/zaun-bot/classes/repliableinteraction/).[`deferred`](/docs/reference/js/zaun-bot/classes/repliableinteraction/#deferred)
***
### fields
> `readonly` **fields**: [`ModalSubmitFields`](/docs/reference/js/zaun-bot/classes/modalsubmitfields/)
Defined in: [sdk/js/src/interactions/modal.ts:55](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/modal.ts#L55)
***
### id
> `readonly` **id**: `string`
Defined in: [sdk/js/src/interactions/base.ts:13](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L13)
The interaction id.
#### Inherited from
[`RepliableInteraction`](/docs/reference/js/zaun-bot/classes/repliableinteraction/).[`id`](/docs/reference/js/zaun-bot/classes/repliableinteraction/#id)
***
### locale
> `readonly` **locale**: `string`
Defined in: [sdk/js/src/interactions/base.ts:22](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L22)
The invoker's locale (BCP 47), if their client sent one.
#### Inherited from
[`RepliableInteraction`](/docs/reference/js/zaun-bot/classes/repliableinteraction/).[`locale`](/docs/reference/js/zaun-bot/classes/repliableinteraction/#locale)
***
### member
> `readonly` **member**: [`Member`](/docs/reference/js/zaun-bot/classes/member/)
Defined in: [sdk/js/src/interactions/base.ts:18](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L18)
Who triggered it: `interaction.member.send(...)` sends them a DM.
#### Inherited from
[`RepliableInteraction`](/docs/reference/js/zaun-bot/classes/repliableinteraction/).[`member`](/docs/reference/js/zaun-bot/classes/repliableinteraction/#member)
***
### message
> `readonly` **message**: [`Message`](/docs/reference/js/zaun-bot/classes/message/)
Defined in: [sdk/js/src/interactions/modal.ts:57](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/modal.ts#L57)
For a modal opened from a component: the message holding it.
***
### raw
> `readonly` **raw**: `Interaction`
Defined in: [sdk/js/src/interactions/base.ts:26](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L26)
The WIT interaction, for anything the classes do not expose.
#### Inherited from
[`RepliableInteraction`](/docs/reference/js/zaun-bot/classes/repliableinteraction/).[`raw`](/docs/reference/js/zaun-bot/classes/repliableinteraction/#raw)
***
### replied
> **replied**: `boolean` = `false`
Defined in: [sdk/js/src/interactions/base.ts:28](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L28)
Whether an initial response was sent.
#### Inherited from
[`RepliableInteraction`](/docs/reference/js/zaun-bot/classes/repliableinteraction/).[`replied`](/docs/reference/js/zaun-bot/classes/repliableinteraction/#replied)
## Accessors
### userId
#### Get Signature
> **get** **userId**(): `string`
Defined in: [sdk/js/src/interactions/base.ts:44](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L44)
The invoker's member id.
##### Returns
`string`
#### Inherited from
[`RepliableInteraction`](/docs/reference/js/zaun-bot/classes/repliableinteraction/).[`userId`](/docs/reference/js/zaun-bot/classes/repliableinteraction/#userid)
## Methods
### deferReply()
> **deferReply**(`options?`): `void`
Defined in: [sdk/js/src/interactions/base.ts:81](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L81)
Shows "thinking…" and buys 15 minutes; finish with [editReply](/docs/reference/js/zaun-bot/classes/repliableinteraction/#editreply).
#### Parameters
##### options?
###### ephemeral?
`boolean`
#### Returns
`void`
#### Inherited from
[`RepliableInteraction`](/docs/reference/js/zaun-bot/classes/repliableinteraction/).[`deferReply`](/docs/reference/js/zaun-bot/classes/repliableinteraction/#deferreply)
***
### deferUpdate()
> **deferUpdate**(): `void`
Defined in: [sdk/js/src/interactions/modal.ts:72](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/modal.ts#L72)
#### Returns
`void`
***
### deleteReply()
> **deleteReply**(): `void`
Defined in: [sdk/js/src/interactions/base.ts:92](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L92)
Deletes the original response.
#### Returns
`void`
#### Inherited from
[`RepliableInteraction`](/docs/reference/js/zaun-bot/classes/repliableinteraction/).[`deleteReply`](/docs/reference/js/zaun-bot/classes/repliableinteraction/#deletereply)
***
### editReply()
> **editReply**(`payload`): `void`
Defined in: [sdk/js/src/interactions/base.ts:87](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L87)
Replaces the original response (ends a deferred reply).
#### Parameters
##### payload
[`MessagePayload`](/docs/reference/js/zaun-bot/type-aliases/messagepayload/)
#### Returns
`void`
#### Inherited from
[`RepliableInteraction`](/docs/reference/js/zaun-bot/classes/repliableinteraction/).[`editReply`](/docs/reference/js/zaun-bot/classes/repliableinteraction/#editreply)
***
### followUp()
> **followUp**(`payload`): `string`
Defined in: [sdk/js/src/interactions/base.ts:97](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L97)
Another message, within 15 minutes (at most 10).
#### Parameters
##### payload
[`MessagePayload`](/docs/reference/js/zaun-bot/type-aliases/messagepayload/)
#### Returns
`string`
#### Inherited from
[`RepliableInteraction`](/docs/reference/js/zaun-bot/classes/repliableinteraction/).[`followUp`](/docs/reference/js/zaun-bot/classes/repliableinteraction/#followup)
***
### isAnySelectMenu()
> **isAnySelectMenu**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:67](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L67)
#### Returns
`boolean`
#### Inherited from
[`RepliableInteraction`](/docs/reference/js/zaun-bot/classes/repliableinteraction/).[`isAnySelectMenu`](/docs/reference/js/zaun-bot/classes/repliableinteraction/#isanyselectmenu)
***
### isAutocomplete()
> **isAutocomplete**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:69](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L69)
#### Returns
`boolean`
#### Inherited from
[`RepliableInteraction`](/docs/reference/js/zaun-bot/classes/repliableinteraction/).[`isAutocomplete`](/docs/reference/js/zaun-bot/classes/repliableinteraction/#isautocomplete)
***
### isButton()
> **isButton**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:61](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L61)
#### Returns
`boolean`
#### Inherited from
[`RepliableInteraction`](/docs/reference/js/zaun-bot/classes/repliableinteraction/).[`isButton`](/docs/reference/js/zaun-bot/classes/repliableinteraction/#isbutton)
***
### isChannelSelectMenu()
> **isChannelSelectMenu**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:66](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L66)
#### Returns
`boolean`
#### Inherited from
[`RepliableInteraction`](/docs/reference/js/zaun-bot/classes/repliableinteraction/).[`isChannelSelectMenu`](/docs/reference/js/zaun-bot/classes/repliableinteraction/#ischannelselectmenu)
***
### isChatInputCommand()
> **isChatInputCommand**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:55](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L55)
#### Returns
`boolean`
#### Inherited from
[`RepliableInteraction`](/docs/reference/js/zaun-bot/classes/repliableinteraction/).[`isChatInputCommand`](/docs/reference/js/zaun-bot/classes/repliableinteraction/#ischatinputcommand)
***
### isCommand()
> **isCommand**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:59](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L59)
#### Returns
`boolean`
#### Inherited from
[`RepliableInteraction`](/docs/reference/js/zaun-bot/classes/repliableinteraction/).[`isCommand`](/docs/reference/js/zaun-bot/classes/repliableinteraction/#iscommand)
***
### isContextMenuCommand()
> **isContextMenuCommand**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:56](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L56)
#### Returns
`boolean`
#### Inherited from
[`RepliableInteraction`](/docs/reference/js/zaun-bot/classes/repliableinteraction/).[`isContextMenuCommand`](/docs/reference/js/zaun-bot/classes/repliableinteraction/#iscontextmenucommand)
***
### isMentionableSelectMenu()
> **isMentionableSelectMenu**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:65](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L65)
#### Returns
`boolean`
#### Inherited from
[`RepliableInteraction`](/docs/reference/js/zaun-bot/classes/repliableinteraction/).[`isMentionableSelectMenu`](/docs/reference/js/zaun-bot/classes/repliableinteraction/#ismentionableselectmenu)
***
### isMessageComponent()
> **isMessageComponent**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:60](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L60)
#### Returns
`boolean`
#### Inherited from
[`RepliableInteraction`](/docs/reference/js/zaun-bot/classes/repliableinteraction/).[`isMessageComponent`](/docs/reference/js/zaun-bot/classes/repliableinteraction/#ismessagecomponent)
***
### isMessageContextMenuCommand()
> **isMessageContextMenuCommand**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:58](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L58)
#### Returns
`boolean`
#### Inherited from
[`RepliableInteraction`](/docs/reference/js/zaun-bot/classes/repliableinteraction/).[`isMessageContextMenuCommand`](/docs/reference/js/zaun-bot/classes/repliableinteraction/#ismessagecontextmenucommand)
***
### isModalSubmit()
> **isModalSubmit**(): `this is ModalSubmitInteraction`
Defined in: [sdk/js/src/interactions/modal.ts:66](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/modal.ts#L66)
#### Returns
`this is ModalSubmitInteraction`
#### Overrides
[`RepliableInteraction`](/docs/reference/js/zaun-bot/classes/repliableinteraction/).[`isModalSubmit`](/docs/reference/js/zaun-bot/classes/repliableinteraction/#ismodalsubmit)
***
### isRepliable()
> **isRepliable**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:70](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L70)
#### Returns
`boolean`
#### Inherited from
[`RepliableInteraction`](/docs/reference/js/zaun-bot/classes/repliableinteraction/).[`isRepliable`](/docs/reference/js/zaun-bot/classes/repliableinteraction/#isrepliable)
***
### isRoleSelectMenu()
> **isRoleSelectMenu**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:64](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L64)
#### Returns
`boolean`
#### Inherited from
[`RepliableInteraction`](/docs/reference/js/zaun-bot/classes/repliableinteraction/).[`isRoleSelectMenu`](/docs/reference/js/zaun-bot/classes/repliableinteraction/#isroleselectmenu)
***
### isStringSelectMenu()
> **isStringSelectMenu**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:62](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L62)
#### Returns
`boolean`
#### Inherited from
[`RepliableInteraction`](/docs/reference/js/zaun-bot/classes/repliableinteraction/).[`isStringSelectMenu`](/docs/reference/js/zaun-bot/classes/repliableinteraction/#isstringselectmenu)
***
### isUserContextMenuCommand()
> **isUserContextMenuCommand**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:57](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L57)
#### Returns
`boolean`
#### Inherited from
[`RepliableInteraction`](/docs/reference/js/zaun-bot/classes/repliableinteraction/).[`isUserContextMenuCommand`](/docs/reference/js/zaun-bot/classes/repliableinteraction/#isusercontextmenucommand)
***
### isUserSelectMenu()
> **isUserSelectMenu**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:63](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L63)
#### Returns
`boolean`
#### Inherited from
[`RepliableInteraction`](/docs/reference/js/zaun-bot/classes/repliableinteraction/).[`isUserSelectMenu`](/docs/reference/js/zaun-bot/classes/repliableinteraction/#isuserselectmenu)
***
### reply()
> **reply**(`payload`): `string`
Defined in: [sdk/js/src/interactions/base.ts:76](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L76)
Answers with a message in the channel (or only to the invoker with `ephemeral`).
#### Parameters
##### payload
[`MessagePayload`](/docs/reference/js/zaun-bot/type-aliases/messagepayload/)
#### Returns
`string`
#### Inherited from
[`RepliableInteraction`](/docs/reference/js/zaun-bot/classes/repliableinteraction/).[`reply`](/docs/reference/js/zaun-bot/classes/repliableinteraction/#reply)
***
### update()
> **update**(`payload`): `void`
Defined in: [sdk/js/src/interactions/modal.ts:69](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/modal.ts#L69)
For a modal opened from a component: replaces that message.
#### Parameters
##### payload
[`MessagePayload`](/docs/reference/js/zaun-bot/type-aliases/messagepayload/)
#### Returns
`void`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/classes/optionbuilder/
---
# OptionBuilder
Defined in: [sdk/js/src/builders/options.ts:27](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/options.ts#L27)
One value option (used through `addStringOption(o => …)` and friends).
## Constructors
### Constructor
> **new OptionBuilder**(`type`): `OptionBuilder`
Defined in: [sdk/js/src/builders/options.ts:41](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/options.ts#L41)
#### Parameters
##### type
[`ApplicationCommandOptionType`](/docs/reference/js/zaun-bot/type-aliases/applicationcommandoptiontype/)
#### Returns
`OptionBuilder`
## Properties
### description
> **description**: `string` = `''`
Defined in: [sdk/js/src/builders/options.ts:29](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/options.ts#L29)
***
### name
> **name**: `string` = `''`
Defined in: [sdk/js/src/builders/options.ts:28](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/options.ts#L28)
***
### required
> **required**: `boolean` = `false`
Defined in: [sdk/js/src/builders/options.ts:30](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/options.ts#L30)
***
### type
> `readonly` **type**: [`ApplicationCommandOptionType`](/docs/reference/js/zaun-bot/type-aliases/applicationcommandoptiontype/)
Defined in: [sdk/js/src/builders/options.ts:41](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/options.ts#L41)
## Methods
### addChannelTypes()
> **addChannelTypes**(...`kinds`): `this`
Defined in: [sdk/js/src/builders/options.ts:71](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/options.ts#L71)
Channel kinds offered (channel options).
#### Parameters
##### kinds
...`string`[]
#### Returns
`this`
***
### addChoices()
> **addChoices**(...`choices`): `this`
Defined in: [sdk/js/src/builders/options.ts:64](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/options.ts#L64)
Fixed choices (string, integer and number options).
#### Parameters
##### choices
...`object`[]
#### Returns
`this`
***
### setAutocomplete()
> **setAutocomplete**(`autocomplete?`): `this`
Defined in: [sdk/js/src/builders/options.ts:92](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/options.ts#L92)
Suggest values as the invoker types (`bot.on('autocomplete')`); not with choices.
#### Parameters
##### autocomplete?
`boolean` = `true`
#### Returns
`this`
***
### setDescription()
> **setDescription**(`description`): `this`
Defined in: [sdk/js/src/builders/options.ts:47](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/options.ts#L47)
#### Parameters
##### description
`string`
#### Returns
`this`
***
### setDescriptionLocalizations()
> **setDescriptionLocalizations**(`map`): `this`
Defined in: [sdk/js/src/builders/options.ts:59](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/options.ts#L59)
#### Parameters
##### map
`Record`\<`string`, `string`\>
#### Returns
`this`
***
### setMaxLength()
> **setMaxLength**(`n`): `this`
Defined in: [sdk/js/src/builders/options.ts:87](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/options.ts#L87)
#### Parameters
##### n
`number`
#### Returns
`this`
***
### setMaxValue()
> **setMaxValue**(`n`): `this`
Defined in: [sdk/js/src/builders/options.ts:79](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/options.ts#L79)
#### Parameters
##### n
`number`
#### Returns
`this`
***
### setMinLength()
> **setMinLength**(`n`): `this`
Defined in: [sdk/js/src/builders/options.ts:83](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/options.ts#L83)
#### Parameters
##### n
`number`
#### Returns
`this`
***
### setMinValue()
> **setMinValue**(`n`): `this`
Defined in: [sdk/js/src/builders/options.ts:75](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/options.ts#L75)
#### Parameters
##### n
`number`
#### Returns
`this`
***
### setName()
> **setName**(`name`): `this`
Defined in: [sdk/js/src/builders/options.ts:43](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/options.ts#L43)
#### Parameters
##### name
`string`
#### Returns
`this`
***
### setNameLocalizations()
> **setNameLocalizations**(`map`): `this`
Defined in: [sdk/js/src/builders/options.ts:55](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/options.ts#L55)
#### Parameters
##### map
`Record`\<`string`, `string`\>
#### Returns
`this`
***
### setRequired()
> **setRequired**(`required?`): `this`
Defined in: [sdk/js/src/builders/options.ts:51](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/options.ts#L51)
#### Parameters
##### required?
`boolean` = `true`
#### Returns
`this`
***
### toWit()
> **toWit**(): `CommandOption`
Defined in: [sdk/js/src/builders/options.ts:110](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/options.ts#L110)
#### Returns
`CommandOption`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/classes/radiogroupbuilder/
---
# RadioGroupBuilder
Defined in: [sdk/js/src/builders/choices.ts:19](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/choices.ts#L19)
Type 21: one choice of 2–10.
## Constructors
### Constructor
> **new RadioGroupBuilder**(): `RadioGroupBuilder`
#### Returns
`RadioGroupBuilder`
## Methods
### addOptions()
> **addOptions**(...`options`): `this`
Defined in: [sdk/js/src/builders/choices.ts:27](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/choices.ts#L27)
#### Parameters
##### options
...`ChoiceInput`[]
#### Returns
`this`
***
### setCustomId()
> **setCustomId**(`id`): `this`
Defined in: [sdk/js/src/builders/choices.ts:23](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/choices.ts#L23)
#### Parameters
##### id
`string`
#### Returns
`this`
***
### setRequired()
> **setRequired**(`required?`): `this`
Defined in: [sdk/js/src/builders/choices.ts:31](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/choices.ts#L31)
#### Parameters
##### required?
`boolean` = `true`
#### Returns
`this`
***
### toWit()
> **toWit**(): `RadioGroup`
Defined in: [sdk/js/src/builders/choices.ts:35](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/choices.ts#L35)
#### Returns
`RadioGroup`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/classes/repliableinteraction/
---
# RepliableInteraction
Defined in: [sdk/js/src/interactions/base.ts:74](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L74)
Interactions that can be answered with messages (all but autocomplete).
## Extends
- [`BaseInteraction`](/docs/reference/js/zaun-bot/classes/baseinteraction/)
## Extended by
- [`ModalCapableInteraction`](/docs/reference/js/zaun-bot/classes/modalcapableinteraction/)
- [`ModalSubmitInteraction`](/docs/reference/js/zaun-bot/classes/modalsubmitinteraction/)
## Constructors
### Constructor
> **new RepliableInteraction**(`raw`): `RepliableInteraction`
Defined in: [sdk/js/src/interactions/base.ts:32](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L32)
#### Parameters
##### raw
`Interaction`
#### Returns
`RepliableInteraction`
#### Inherited from
[`BaseInteraction`](/docs/reference/js/zaun-bot/classes/baseinteraction/).[`constructor`](/docs/reference/js/zaun-bot/classes/baseinteraction/#constructor)
## Properties
### appPermissions
> `readonly` **appPermissions**: `bigint`
Defined in: [sdk/js/src/interactions/base.ts:20](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L20)
The bot's effective permissions in the channel.
#### Inherited from
[`BaseInteraction`](/docs/reference/js/zaun-bot/classes/baseinteraction/).[`appPermissions`](/docs/reference/js/zaun-bot/classes/baseinteraction/#apppermissions)
***
### botId
> `readonly` **botId**: `string`
Defined in: [sdk/js/src/interactions/base.ts:15](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L15)
The bot's id in this community.
#### Inherited from
[`BaseInteraction`](/docs/reference/js/zaun-bot/classes/baseinteraction/).[`botId`](/docs/reference/js/zaun-bot/classes/baseinteraction/#botid)
***
### channelId
> `readonly` **channelId**: `string`
Defined in: [sdk/js/src/interactions/base.ts:16](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L16)
#### Inherited from
[`BaseInteraction`](/docs/reference/js/zaun-bot/classes/baseinteraction/).[`channelId`](/docs/reference/js/zaun-bot/classes/baseinteraction/#channelid)
***
### createdTimestamp
> `readonly` **createdTimestamp**: `number`
Defined in: [sdk/js/src/interactions/base.ts:24](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L24)
When the host received it, ms.
#### Inherited from
[`BaseInteraction`](/docs/reference/js/zaun-bot/classes/baseinteraction/).[`createdTimestamp`](/docs/reference/js/zaun-bot/classes/baseinteraction/#createdtimestamp)
***
### deferred
> **deferred**: `boolean` = `false`
Defined in: [sdk/js/src/interactions/base.ts:30](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L30)
Whether the response was deferred.
#### Inherited from
[`BaseInteraction`](/docs/reference/js/zaun-bot/classes/baseinteraction/).[`deferred`](/docs/reference/js/zaun-bot/classes/baseinteraction/#deferred)
***
### id
> `readonly` **id**: `string`
Defined in: [sdk/js/src/interactions/base.ts:13](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L13)
The interaction id.
#### Inherited from
[`BaseInteraction`](/docs/reference/js/zaun-bot/classes/baseinteraction/).[`id`](/docs/reference/js/zaun-bot/classes/baseinteraction/#id)
***
### locale
> `readonly` **locale**: `string`
Defined in: [sdk/js/src/interactions/base.ts:22](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L22)
The invoker's locale (BCP 47), if their client sent one.
#### Inherited from
[`BaseInteraction`](/docs/reference/js/zaun-bot/classes/baseinteraction/).[`locale`](/docs/reference/js/zaun-bot/classes/baseinteraction/#locale)
***
### member
> `readonly` **member**: [`Member`](/docs/reference/js/zaun-bot/classes/member/)
Defined in: [sdk/js/src/interactions/base.ts:18](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L18)
Who triggered it: `interaction.member.send(...)` sends them a DM.
#### Inherited from
[`BaseInteraction`](/docs/reference/js/zaun-bot/classes/baseinteraction/).[`member`](/docs/reference/js/zaun-bot/classes/baseinteraction/#member)
***
### raw
> `readonly` **raw**: `Interaction`
Defined in: [sdk/js/src/interactions/base.ts:26](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L26)
The WIT interaction, for anything the classes do not expose.
#### Inherited from
[`BaseInteraction`](/docs/reference/js/zaun-bot/classes/baseinteraction/).[`raw`](/docs/reference/js/zaun-bot/classes/baseinteraction/#raw)
***
### replied
> **replied**: `boolean` = `false`
Defined in: [sdk/js/src/interactions/base.ts:28](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L28)
Whether an initial response was sent.
#### Inherited from
[`BaseInteraction`](/docs/reference/js/zaun-bot/classes/baseinteraction/).[`replied`](/docs/reference/js/zaun-bot/classes/baseinteraction/#replied)
## Accessors
### userId
#### Get Signature
> **get** **userId**(): `string`
Defined in: [sdk/js/src/interactions/base.ts:44](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L44)
The invoker's member id.
##### Returns
`string`
#### Inherited from
[`BaseInteraction`](/docs/reference/js/zaun-bot/classes/baseinteraction/).[`userId`](/docs/reference/js/zaun-bot/classes/baseinteraction/#userid)
## Methods
### deferReply()
> **deferReply**(`options?`): `void`
Defined in: [sdk/js/src/interactions/base.ts:81](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L81)
Shows "thinking…" and buys 15 minutes; finish with [editReply](/docs/reference/js/zaun-bot/classes/repliableinteraction/#editreply).
#### Parameters
##### options?
###### ephemeral?
`boolean`
#### Returns
`void`
***
### deleteReply()
> **deleteReply**(): `void`
Defined in: [sdk/js/src/interactions/base.ts:92](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L92)
Deletes the original response.
#### Returns
`void`
***
### editReply()
> **editReply**(`payload`): `void`
Defined in: [sdk/js/src/interactions/base.ts:87](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L87)
Replaces the original response (ends a deferred reply).
#### Parameters
##### payload
[`MessagePayload`](/docs/reference/js/zaun-bot/type-aliases/messagepayload/)
#### Returns
`void`
***
### followUp()
> **followUp**(`payload`): `string`
Defined in: [sdk/js/src/interactions/base.ts:97](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L97)
Another message, within 15 minutes (at most 10).
#### Parameters
##### payload
[`MessagePayload`](/docs/reference/js/zaun-bot/type-aliases/messagepayload/)
#### Returns
`string`
***
### isAnySelectMenu()
> **isAnySelectMenu**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:67](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L67)
#### Returns
`boolean`
#### Inherited from
[`BaseInteraction`](/docs/reference/js/zaun-bot/classes/baseinteraction/).[`isAnySelectMenu`](/docs/reference/js/zaun-bot/classes/baseinteraction/#isanyselectmenu)
***
### isAutocomplete()
> **isAutocomplete**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:69](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L69)
#### Returns
`boolean`
#### Inherited from
[`BaseInteraction`](/docs/reference/js/zaun-bot/classes/baseinteraction/).[`isAutocomplete`](/docs/reference/js/zaun-bot/classes/baseinteraction/#isautocomplete)
***
### isButton()
> **isButton**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:61](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L61)
#### Returns
`boolean`
#### Inherited from
[`BaseInteraction`](/docs/reference/js/zaun-bot/classes/baseinteraction/).[`isButton`](/docs/reference/js/zaun-bot/classes/baseinteraction/#isbutton)
***
### isChannelSelectMenu()
> **isChannelSelectMenu**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:66](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L66)
#### Returns
`boolean`
#### Inherited from
[`BaseInteraction`](/docs/reference/js/zaun-bot/classes/baseinteraction/).[`isChannelSelectMenu`](/docs/reference/js/zaun-bot/classes/baseinteraction/#ischannelselectmenu)
***
### isChatInputCommand()
> **isChatInputCommand**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:55](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L55)
#### Returns
`boolean`
#### Inherited from
[`BaseInteraction`](/docs/reference/js/zaun-bot/classes/baseinteraction/).[`isChatInputCommand`](/docs/reference/js/zaun-bot/classes/baseinteraction/#ischatinputcommand)
***
### isCommand()
> **isCommand**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:59](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L59)
#### Returns
`boolean`
#### Inherited from
[`BaseInteraction`](/docs/reference/js/zaun-bot/classes/baseinteraction/).[`isCommand`](/docs/reference/js/zaun-bot/classes/baseinteraction/#iscommand)
***
### isContextMenuCommand()
> **isContextMenuCommand**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:56](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L56)
#### Returns
`boolean`
#### Inherited from
[`BaseInteraction`](/docs/reference/js/zaun-bot/classes/baseinteraction/).[`isContextMenuCommand`](/docs/reference/js/zaun-bot/classes/baseinteraction/#iscontextmenucommand)
***
### isMentionableSelectMenu()
> **isMentionableSelectMenu**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:65](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L65)
#### Returns
`boolean`
#### Inherited from
[`BaseInteraction`](/docs/reference/js/zaun-bot/classes/baseinteraction/).[`isMentionableSelectMenu`](/docs/reference/js/zaun-bot/classes/baseinteraction/#ismentionableselectmenu)
***
### isMessageComponent()
> **isMessageComponent**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:60](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L60)
#### Returns
`boolean`
#### Inherited from
[`BaseInteraction`](/docs/reference/js/zaun-bot/classes/baseinteraction/).[`isMessageComponent`](/docs/reference/js/zaun-bot/classes/baseinteraction/#ismessagecomponent)
***
### isMessageContextMenuCommand()
> **isMessageContextMenuCommand**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:58](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L58)
#### Returns
`boolean`
#### Inherited from
[`BaseInteraction`](/docs/reference/js/zaun-bot/classes/baseinteraction/).[`isMessageContextMenuCommand`](/docs/reference/js/zaun-bot/classes/baseinteraction/#ismessagecontextmenucommand)
***
### isModalSubmit()
> **isModalSubmit**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:68](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L68)
#### Returns
`boolean`
#### Inherited from
[`BaseInteraction`](/docs/reference/js/zaun-bot/classes/baseinteraction/).[`isModalSubmit`](/docs/reference/js/zaun-bot/classes/baseinteraction/#ismodalsubmit)
***
### isRepliable()
> **isRepliable**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:70](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L70)
#### Returns
`boolean`
#### Inherited from
[`BaseInteraction`](/docs/reference/js/zaun-bot/classes/baseinteraction/).[`isRepliable`](/docs/reference/js/zaun-bot/classes/baseinteraction/#isrepliable)
***
### isRoleSelectMenu()
> **isRoleSelectMenu**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:64](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L64)
#### Returns
`boolean`
#### Inherited from
[`BaseInteraction`](/docs/reference/js/zaun-bot/classes/baseinteraction/).[`isRoleSelectMenu`](/docs/reference/js/zaun-bot/classes/baseinteraction/#isroleselectmenu)
***
### isStringSelectMenu()
> **isStringSelectMenu**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:62](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L62)
#### Returns
`boolean`
#### Inherited from
[`BaseInteraction`](/docs/reference/js/zaun-bot/classes/baseinteraction/).[`isStringSelectMenu`](/docs/reference/js/zaun-bot/classes/baseinteraction/#isstringselectmenu)
***
### isUserContextMenuCommand()
> **isUserContextMenuCommand**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:57](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L57)
#### Returns
`boolean`
#### Inherited from
[`BaseInteraction`](/docs/reference/js/zaun-bot/classes/baseinteraction/).[`isUserContextMenuCommand`](/docs/reference/js/zaun-bot/classes/baseinteraction/#isusercontextmenucommand)
***
### isUserSelectMenu()
> **isUserSelectMenu**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:63](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L63)
#### Returns
`boolean`
#### Inherited from
[`BaseInteraction`](/docs/reference/js/zaun-bot/classes/baseinteraction/).[`isUserSelectMenu`](/docs/reference/js/zaun-bot/classes/baseinteraction/#isuserselectmenu)
***
### reply()
> **reply**(`payload`): `string`
Defined in: [sdk/js/src/interactions/base.ts:76](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L76)
Answers with a message in the channel (or only to the invoker with `ephemeral`).
#### Parameters
##### payload
[`MessagePayload`](/docs/reference/js/zaun-bot/type-aliases/messagepayload/)
#### Returns
`string`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/classes/roleselectmenubuilder/
---
# RoleSelectMenuBuilder
Defined in: [sdk/js/src/builders/select.ts:144](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/select.ts#L144)
Type 6: roles.
## Extends
- `EntitySelectBuilder`
## Constructors
### Constructor
> **new RoleSelectMenuBuilder**(): `RoleSelectMenuBuilder`
#### Returns
`RoleSelectMenuBuilder`
#### Inherited from
`EntitySelectBuilder.constructor`
## Accessors
### customId
#### Get Signature
> **get** **customId**(): `string`
Defined in: [sdk/js/src/builders/select.ts:78](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/select.ts#L78)
##### Returns
`string`
#### Inherited from
`EntitySelectBuilder.customId`
## Methods
### setCustomId()
> **setCustomId**(`id`): `this`
Defined in: [sdk/js/src/builders/select.ts:53](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/select.ts#L53)
#### Parameters
##### id
`string`
#### Returns
`this`
#### Inherited from
`EntitySelectBuilder.setCustomId`
***
### setDefaultRoles()
> **setDefaultRoles**(...`ids`): `this`
Defined in: [sdk/js/src/builders/select.ts:146](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/select.ts#L146)
#### Parameters
##### ids
...`string`[]
#### Returns
`this`
***
### setDisabled()
> **setDisabled**(`disabled?`): `this`
Defined in: [sdk/js/src/builders/select.ts:74](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/select.ts#L74)
#### Parameters
##### disabled?
`boolean` = `true`
#### Returns
`this`
#### Inherited from
`EntitySelectBuilder.setDisabled`
***
### setMaxValues()
> **setMaxValues**(`n`): `this`
Defined in: [sdk/js/src/builders/select.ts:65](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/select.ts#L65)
#### Parameters
##### n
`number`
#### Returns
`this`
#### Inherited from
`EntitySelectBuilder.setMaxValues`
***
### setMinValues()
> **setMinValues**(`n`): `this`
Defined in: [sdk/js/src/builders/select.ts:61](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/select.ts#L61)
#### Parameters
##### n
`number`
#### Returns
`this`
#### Inherited from
`EntitySelectBuilder.setMinValues`
***
### setPlaceholder()
> **setPlaceholder**(`placeholder`): `this`
Defined in: [sdk/js/src/builders/select.ts:57](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/select.ts#L57)
#### Parameters
##### placeholder
`string`
#### Returns
`this`
#### Inherited from
`EntitySelectBuilder.setPlaceholder`
***
### setRequired()
> **setRequired**(`required?`): `this`
Defined in: [sdk/js/src/builders/select.ts:70](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/select.ts#L70)
In a modal: whether an answer is needed (default true).
#### Parameters
##### required?
`boolean` = `true`
#### Returns
`this`
#### Inherited from
`EntitySelectBuilder.setRequired`
***
### toWit()
> **toWit**(): `EntitySelect`
Defined in: [sdk/js/src/builders/select.ts:124](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/select.ts#L124)
#### Returns
`EntitySelect`
#### Inherited from
`EntitySelectBuilder.toWit`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/classes/sectionbuilder/
---
# SectionBuilder
Defined in: [sdk/js/src/builders/layout.ts:46](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/layout.ts#L46)
Type 9: one to three texts with a button or thumbnail beside them.
## Constructors
### Constructor
> **new SectionBuilder**(): `SectionBuilder`
#### Returns
`SectionBuilder`
## Methods
### addTextDisplayComponents()
> **addTextDisplayComponents**(...`texts`): `this`
Defined in: [sdk/js/src/builders/layout.ts:50](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/layout.ts#L50)
#### Parameters
##### texts
...[`TextDisplayBuilder`](/docs/reference/js/zaun-bot/classes/textdisplaybuilder/)[]
#### Returns
`this`
***
### setButtonAccessory()
> **setButtonAccessory**(`button`): `this`
Defined in: [sdk/js/src/builders/layout.ts:54](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/layout.ts#L54)
#### Parameters
##### button
[`ButtonBuilder`](/docs/reference/js/zaun-bot/classes/buttonbuilder/)
#### Returns
`this`
***
### setThumbnailAccessory()
> **setThumbnailAccessory**(`thumbnail`): `this`
Defined in: [sdk/js/src/builders/layout.ts:58](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/layout.ts#L58)
#### Parameters
##### thumbnail
[`ThumbnailBuilder`](/docs/reference/js/zaun-bot/classes/thumbnailbuilder/)
#### Returns
`this`
***
### toWit()
> **toWit**(): `Section`
Defined in: [sdk/js/src/builders/layout.ts:62](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/layout.ts#L62)
#### Returns
`Section`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/classes/separatorbuilder/
---
# SeparatorBuilder
Defined in: [sdk/js/src/builders/layout.ts:119](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/layout.ts#L119)
Type 14.
## Constructors
### Constructor
> **new SeparatorBuilder**(): `SeparatorBuilder`
#### Returns
`SeparatorBuilder`
## Methods
### setDivider()
> **setDivider**(`divider?`): `this`
Defined in: [sdk/js/src/builders/layout.ts:122](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/layout.ts#L122)
#### Parameters
##### divider?
`boolean` = `true`
#### Returns
`this`
***
### setSpacing()
> **setSpacing**(`spacing`): `this`
Defined in: [sdk/js/src/builders/layout.ts:126](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/layout.ts#L126)
#### Parameters
##### spacing
[`SeparatorSpacingSize`](/docs/reference/js/zaun-bot/type-aliases/separatorspacingsize/)
#### Returns
`this`
***
### toWit()
> **toWit**(): `Separator`
Defined in: [sdk/js/src/builders/layout.ts:130](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/layout.ts#L130)
#### Returns
`Separator`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/classes/slashcommandbuilder/
---
# SlashCommandBuilder
Defined in: [sdk/js/src/builders/command.ts:117](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/command.ts#L117)
A slash command (`CHAT_INPUT`).
## Extends
- `WithOptions`
## Implements
- [`CommandLike`](/docs/reference/js/zaun-bot/interfaces/commandlike/)
## Constructors
### Constructor
> **new SlashCommandBuilder**(): `SlashCommandBuilder`
#### Returns
`SlashCommandBuilder`
#### Inherited from
`WithOptions.constructor`
## Properties
### description
> **description**: `string` = `''`
Defined in: [sdk/js/src/builders/command.ts:27](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/command.ts#L27)
#### Inherited from
[`SlashCommandSubcommandBuilder`](/docs/reference/js/zaun-bot/classes/slashcommandsubcommandbuilder/).[`description`](/docs/reference/js/zaun-bot/classes/slashcommandsubcommandbuilder/#description)
***
### descriptionLocalizations?
> `optional` **descriptionLocalizations?**: `Record`\<`string`, `string`\>
Defined in: [sdk/js/src/builders/command.ts:29](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/command.ts#L29)
#### Inherited from
`WithOptions.descriptionLocalizations`
***
### name
> **name**: `string` = `''`
Defined in: [sdk/js/src/builders/command.ts:26](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/command.ts#L26)
#### Implementation of
[`CommandLike`](/docs/reference/js/zaun-bot/interfaces/commandlike/).[`name`](/docs/reference/js/zaun-bot/interfaces/commandlike/#name)
#### Inherited from
[`SlashCommandSubcommandBuilder`](/docs/reference/js/zaun-bot/classes/slashcommandsubcommandbuilder/).[`name`](/docs/reference/js/zaun-bot/classes/slashcommandsubcommandbuilder/#name)
***
### nameLocalizations?
> `optional` **nameLocalizations?**: `Record`\<`string`, `string`\>
Defined in: [sdk/js/src/builders/command.ts:28](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/command.ts#L28)
#### Inherited from
`WithOptions.nameLocalizations`
***
### options
> `readonly` **options**: [`OptionBuilder`](/docs/reference/js/zaun-bot/classes/optionbuilder/)[] = `[]`
Defined in: [sdk/js/src/builders/command.ts:63](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/command.ts#L63)
#### Inherited from
`WithOptions.options`
## Methods
### addAttachmentOption()
> **addAttachmentOption**(`f`): `this`
Defined in: [sdk/js/src/builders/command.ts:78](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/command.ts#L78)
#### Parameters
##### f
`OptionFn`
#### Returns
`this`
#### Inherited from
`WithOptions.addAttachmentOption`
***
### addBooleanOption()
> **addBooleanOption**(`f`): `this`
Defined in: [sdk/js/src/builders/command.ts:72](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/command.ts#L72)
#### Parameters
##### f
`OptionFn`
#### Returns
`this`
#### Inherited from
`WithOptions.addBooleanOption`
***
### addChannelOption()
> **addChannelOption**(`f`): `this`
Defined in: [sdk/js/src/builders/command.ts:74](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/command.ts#L74)
#### Parameters
##### f
`OptionFn`
#### Returns
`this`
#### Inherited from
`WithOptions.addChannelOption`
***
### addIntegerOption()
> **addIntegerOption**(`f`): `this`
Defined in: [sdk/js/src/builders/command.ts:71](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/command.ts#L71)
#### Parameters
##### f
`OptionFn`
#### Returns
`this`
#### Inherited from
`WithOptions.addIntegerOption`
***
### addMentionableOption()
> **addMentionableOption**(`f`): `this`
Defined in: [sdk/js/src/builders/command.ts:76](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/command.ts#L76)
#### Parameters
##### f
`OptionFn`
#### Returns
`this`
#### Inherited from
`WithOptions.addMentionableOption`
***
### addNumberOption()
> **addNumberOption**(`f`): `this`
Defined in: [sdk/js/src/builders/command.ts:77](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/command.ts#L77)
#### Parameters
##### f
`OptionFn`
#### Returns
`this`
#### Inherited from
`WithOptions.addNumberOption`
***
### addRoleOption()
> **addRoleOption**(`f`): `this`
Defined in: [sdk/js/src/builders/command.ts:75](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/command.ts#L75)
#### Parameters
##### f
`OptionFn`
#### Returns
`this`
#### Inherited from
`WithOptions.addRoleOption`
***
### addStringOption()
> **addStringOption**(`f`): `this`
Defined in: [sdk/js/src/builders/command.ts:70](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/command.ts#L70)
#### Parameters
##### f
`OptionFn`
#### Returns
`this`
#### Inherited from
`WithOptions.addStringOption`
***
### addSubcommand()
> **addSubcommand**(`f`): `this`
Defined in: [sdk/js/src/builders/command.ts:121](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/command.ts#L121)
#### Parameters
##### f
(`s`) => [`SlashCommandSubcommandBuilder`](/docs/reference/js/zaun-bot/classes/slashcommandsubcommandbuilder/)
#### Returns
`this`
***
### addSubcommandGroup()
> **addSubcommandGroup**(`f`): `this`
Defined in: [sdk/js/src/builders/command.ts:125](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/command.ts#L125)
#### Parameters
##### f
(`g`) => [`SlashCommandSubcommandGroupBuilder`](/docs/reference/js/zaun-bot/classes/slashcommandsubcommandgroupbuilder/)
#### Returns
`this`
***
### addUserOption()
> **addUserOption**(`f`): `this`
Defined in: [sdk/js/src/builders/command.ts:73](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/command.ts#L73)
#### Parameters
##### f
`OptionFn`
#### Returns
`this`
#### Inherited from
`WithOptions.addUserOption`
***
### setDefaultMemberPermissions()
> **setDefaultMemberPermissions**(`bits`): `this`
Defined in: [sdk/js/src/builders/command.ts:130](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/command.ts#L130)
Bits the invoker needs (`0n` = owner only; `null` = everyone, the default).
#### Parameters
##### bits
`number` \| `bigint`
#### Returns
`this`
***
### setDescription()
> **setDescription**(`description`): `this`
Defined in: [sdk/js/src/builders/command.ts:35](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/command.ts#L35)
#### Parameters
##### description
`string`
#### Returns
`this`
#### Inherited from
`WithOptions.setDescription`
***
### setDescriptionLocalizations()
> **setDescriptionLocalizations**(`map`): `this`
Defined in: [sdk/js/src/builders/command.ts:43](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/command.ts#L43)
#### Parameters
##### map
`Record`\<`string`, `string`\>
#### Returns
`this`
#### Inherited from
`WithOptions.setDescriptionLocalizations`
***
### setName()
> **setName**(`name`): `this`
Defined in: [sdk/js/src/builders/command.ts:31](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/command.ts#L31)
#### Parameters
##### name
`string`
#### Returns
`this`
#### Inherited from
`WithOptions.setName`
***
### setNameLocalizations()
> **setNameLocalizations**(`map`): `this`
Defined in: [sdk/js/src/builders/command.ts:39](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/command.ts#L39)
#### Parameters
##### map
`Record`\<`string`, `string`\>
#### Returns
`this`
#### Inherited from
`WithOptions.setNameLocalizations`
***
### toJSON()
> **toJSON**(): `ApplicationCommand`
Defined in: [sdk/js/src/builders/command.ts:149](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/command.ts#L149)
the WIT form.
#### Returns
`ApplicationCommand`
***
### toWit()
> **toWit**(): `ApplicationCommand`
Defined in: [sdk/js/src/builders/command.ts:135](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/command.ts#L135)
#### Returns
`ApplicationCommand`
#### Implementation of
[`CommandLike`](/docs/reference/js/zaun-bot/interfaces/commandlike/).[`toWit`](/docs/reference/js/zaun-bot/interfaces/commandlike/#towit)
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/classes/slashcommandsubcommandbuilder/
---
# SlashCommandSubcommandBuilder
Defined in: [sdk/js/src/builders/command.ts:91](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/command.ts#L91)
Type 1 option: a sub-command.
## Extends
- `WithOptions`
## Constructors
### Constructor
> **new SlashCommandSubcommandBuilder**(): `SlashCommandSubcommandBuilder`
#### Returns
`SlashCommandSubcommandBuilder`
#### Inherited from
`WithOptions.constructor`
## Properties
### description
> **description**: `string` = `''`
Defined in: [sdk/js/src/builders/command.ts:27](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/command.ts#L27)
#### Inherited from
`WithOptions.description`
***
### descriptionLocalizations?
> `optional` **descriptionLocalizations?**: `Record`\<`string`, `string`\>
Defined in: [sdk/js/src/builders/command.ts:29](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/command.ts#L29)
#### Inherited from
`WithOptions.descriptionLocalizations`
***
### name
> **name**: `string` = `''`
Defined in: [sdk/js/src/builders/command.ts:26](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/command.ts#L26)
#### Inherited from
`WithOptions.name`
***
### nameLocalizations?
> `optional` **nameLocalizations?**: `Record`\<`string`, `string`\>
Defined in: [sdk/js/src/builders/command.ts:28](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/command.ts#L28)
#### Inherited from
`WithOptions.nameLocalizations`
***
### options
> `readonly` **options**: [`OptionBuilder`](/docs/reference/js/zaun-bot/classes/optionbuilder/)[] = `[]`
Defined in: [sdk/js/src/builders/command.ts:63](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/command.ts#L63)
#### Inherited from
`WithOptions.options`
## Methods
### addAttachmentOption()
> **addAttachmentOption**(`f`): `this`
Defined in: [sdk/js/src/builders/command.ts:78](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/command.ts#L78)
#### Parameters
##### f
`OptionFn`
#### Returns
`this`
#### Inherited from
`WithOptions.addAttachmentOption`
***
### addBooleanOption()
> **addBooleanOption**(`f`): `this`
Defined in: [sdk/js/src/builders/command.ts:72](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/command.ts#L72)
#### Parameters
##### f
`OptionFn`
#### Returns
`this`
#### Inherited from
`WithOptions.addBooleanOption`
***
### addChannelOption()
> **addChannelOption**(`f`): `this`
Defined in: [sdk/js/src/builders/command.ts:74](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/command.ts#L74)
#### Parameters
##### f
`OptionFn`
#### Returns
`this`
#### Inherited from
`WithOptions.addChannelOption`
***
### addIntegerOption()
> **addIntegerOption**(`f`): `this`
Defined in: [sdk/js/src/builders/command.ts:71](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/command.ts#L71)
#### Parameters
##### f
`OptionFn`
#### Returns
`this`
#### Inherited from
`WithOptions.addIntegerOption`
***
### addMentionableOption()
> **addMentionableOption**(`f`): `this`
Defined in: [sdk/js/src/builders/command.ts:76](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/command.ts#L76)
#### Parameters
##### f
`OptionFn`
#### Returns
`this`
#### Inherited from
`WithOptions.addMentionableOption`
***
### addNumberOption()
> **addNumberOption**(`f`): `this`
Defined in: [sdk/js/src/builders/command.ts:77](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/command.ts#L77)
#### Parameters
##### f
`OptionFn`
#### Returns
`this`
#### Inherited from
`WithOptions.addNumberOption`
***
### addRoleOption()
> **addRoleOption**(`f`): `this`
Defined in: [sdk/js/src/builders/command.ts:75](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/command.ts#L75)
#### Parameters
##### f
`OptionFn`
#### Returns
`this`
#### Inherited from
`WithOptions.addRoleOption`
***
### addStringOption()
> **addStringOption**(`f`): `this`
Defined in: [sdk/js/src/builders/command.ts:70](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/command.ts#L70)
#### Parameters
##### f
`OptionFn`
#### Returns
`this`
#### Inherited from
`WithOptions.addStringOption`
***
### addUserOption()
> **addUserOption**(`f`): `this`
Defined in: [sdk/js/src/builders/command.ts:73](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/command.ts#L73)
#### Parameters
##### f
`OptionFn`
#### Returns
`this`
#### Inherited from
`WithOptions.addUserOption`
***
### setDescription()
> **setDescription**(`description`): `this`
Defined in: [sdk/js/src/builders/command.ts:35](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/command.ts#L35)
#### Parameters
##### description
`string`
#### Returns
`this`
#### Inherited from
`WithOptions.setDescription`
***
### setDescriptionLocalizations()
> **setDescriptionLocalizations**(`map`): `this`
Defined in: [sdk/js/src/builders/command.ts:43](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/command.ts#L43)
#### Parameters
##### map
`Record`\<`string`, `string`\>
#### Returns
`this`
#### Inherited from
`WithOptions.setDescriptionLocalizations`
***
### setName()
> **setName**(`name`): `this`
Defined in: [sdk/js/src/builders/command.ts:31](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/command.ts#L31)
#### Parameters
##### name
`string`
#### Returns
`this`
#### Inherited from
`WithOptions.setName`
***
### setNameLocalizations()
> **setNameLocalizations**(`map`): `this`
Defined in: [sdk/js/src/builders/command.ts:39](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/command.ts#L39)
#### Parameters
##### map
`Record`\<`string`, `string`\>
#### Returns
`this`
#### Inherited from
`WithOptions.setNameLocalizations`
***
### toWit()
> **toWit**(): `SubCommand`
Defined in: [sdk/js/src/builders/command.ts:92](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/command.ts#L92)
#### Returns
`SubCommand`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/classes/slashcommandsubcommandgroupbuilder/
---
# SlashCommandSubcommandGroupBuilder
Defined in: [sdk/js/src/builders/command.ts:98](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/command.ts#L98)
Type 2 option: a group of sub-commands.
## Extends
- `Named`
## Constructors
### Constructor
> **new SlashCommandSubcommandGroupBuilder**(): `SlashCommandSubcommandGroupBuilder`
#### Returns
`SlashCommandSubcommandGroupBuilder`
#### Inherited from
`Named.constructor`
## Properties
### description
> **description**: `string` = `''`
Defined in: [sdk/js/src/builders/command.ts:27](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/command.ts#L27)
#### Inherited from
`Named.description`
***
### descriptionLocalizations?
> `optional` **descriptionLocalizations?**: `Record`\<`string`, `string`\>
Defined in: [sdk/js/src/builders/command.ts:29](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/command.ts#L29)
#### Inherited from
`Named.descriptionLocalizations`
***
### name
> **name**: `string` = `''`
Defined in: [sdk/js/src/builders/command.ts:26](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/command.ts#L26)
#### Inherited from
`Named.name`
***
### nameLocalizations?
> `optional` **nameLocalizations?**: `Record`\<`string`, `string`\>
Defined in: [sdk/js/src/builders/command.ts:28](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/command.ts#L28)
#### Inherited from
`Named.nameLocalizations`
***
### subcommands
> `readonly` **subcommands**: [`SlashCommandSubcommandBuilder`](/docs/reference/js/zaun-bot/classes/slashcommandsubcommandbuilder/)[] = `[]`
Defined in: [sdk/js/src/builders/command.ts:99](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/command.ts#L99)
## Methods
### addSubcommand()
> **addSubcommand**(`f`): `this`
Defined in: [sdk/js/src/builders/command.ts:100](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/command.ts#L100)
#### Parameters
##### f
(`s`) => [`SlashCommandSubcommandBuilder`](/docs/reference/js/zaun-bot/classes/slashcommandsubcommandbuilder/)
#### Returns
`this`
***
### setDescription()
> **setDescription**(`description`): `this`
Defined in: [sdk/js/src/builders/command.ts:35](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/command.ts#L35)
#### Parameters
##### description
`string`
#### Returns
`this`
#### Inherited from
`Named.setDescription`
***
### setDescriptionLocalizations()
> **setDescriptionLocalizations**(`map`): `this`
Defined in: [sdk/js/src/builders/command.ts:43](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/command.ts#L43)
#### Parameters
##### map
`Record`\<`string`, `string`\>
#### Returns
`this`
#### Inherited from
`Named.setDescriptionLocalizations`
***
### setName()
> **setName**(`name`): `this`
Defined in: [sdk/js/src/builders/command.ts:31](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/command.ts#L31)
#### Parameters
##### name
`string`
#### Returns
`this`
#### Inherited from
`Named.setName`
***
### setNameLocalizations()
> **setNameLocalizations**(`map`): `this`
Defined in: [sdk/js/src/builders/command.ts:39](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/command.ts#L39)
#### Parameters
##### map
`Record`\<`string`, `string`\>
#### Returns
`this`
#### Inherited from
`Named.setNameLocalizations`
***
### toWit()
> **toWit**(): `SubCommandGroup`
Defined in: [sdk/js/src/builders/command.ts:104](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/command.ts#L104)
#### Returns
`SubCommandGroup`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/classes/stringselectmenubuilder/
---
# StringSelectMenuBuilder
Defined in: [sdk/js/src/builders/select.ts:88](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/select.ts#L88)
Type 3.
## Extends
- `SelectBuilder`
## Constructors
### Constructor
> **new StringSelectMenuBuilder**(): `StringSelectMenuBuilder`
#### Returns
`StringSelectMenuBuilder`
#### Inherited from
`SelectBuilder.constructor`
## Accessors
### customId
#### Get Signature
> **get** **customId**(): `string`
Defined in: [sdk/js/src/builders/select.ts:78](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/select.ts#L78)
##### Returns
`string`
#### Inherited from
`SelectBuilder.customId`
## Methods
### addOptions()
> **addOptions**(...`options`): `this`
Defined in: [sdk/js/src/builders/select.ts:91](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/select.ts#L91)
#### Parameters
##### options
...`OptionInput`[]
#### Returns
`this`
***
### setCustomId()
> **setCustomId**(`id`): `this`
Defined in: [sdk/js/src/builders/select.ts:53](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/select.ts#L53)
#### Parameters
##### id
`string`
#### Returns
`this`
#### Inherited from
`SelectBuilder.setCustomId`
***
### setDisabled()
> **setDisabled**(`disabled?`): `this`
Defined in: [sdk/js/src/builders/select.ts:74](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/select.ts#L74)
#### Parameters
##### disabled?
`boolean` = `true`
#### Returns
`this`
#### Inherited from
`SelectBuilder.setDisabled`
***
### setMaxValues()
> **setMaxValues**(`n`): `this`
Defined in: [sdk/js/src/builders/select.ts:65](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/select.ts#L65)
#### Parameters
##### n
`number`
#### Returns
`this`
#### Inherited from
`SelectBuilder.setMaxValues`
***
### setMinValues()
> **setMinValues**(`n`): `this`
Defined in: [sdk/js/src/builders/select.ts:61](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/select.ts#L61)
#### Parameters
##### n
`number`
#### Returns
`this`
#### Inherited from
`SelectBuilder.setMinValues`
***
### setPlaceholder()
> **setPlaceholder**(`placeholder`): `this`
Defined in: [sdk/js/src/builders/select.ts:57](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/select.ts#L57)
#### Parameters
##### placeholder
`string`
#### Returns
`this`
#### Inherited from
`SelectBuilder.setPlaceholder`
***
### setRequired()
> **setRequired**(`required?`): `this`
Defined in: [sdk/js/src/builders/select.ts:70](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/select.ts#L70)
In a modal: whether an answer is needed (default true).
#### Parameters
##### required?
`boolean` = `true`
#### Returns
`this`
#### Inherited from
`SelectBuilder.setRequired`
***
### toWit()
> **toWit**(): `StringSelect`
Defined in: [sdk/js/src/builders/select.ts:106](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/select.ts#L106)
#### Returns
`StringSelect`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/classes/stringselectmenuoptionbuilder/
---
# StringSelectMenuOptionBuilder
Defined in: [sdk/js/src/builders/select.ts:9](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/select.ts#L9)
One option of a string select.
## Constructors
### Constructor
> **new StringSelectMenuOptionBuilder**(): `StringSelectMenuOptionBuilder`
#### Returns
`StringSelectMenuOptionBuilder`
## Properties
### description?
> `optional` **description?**: `string`
Defined in: [sdk/js/src/builders/select.ts:12](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/select.ts#L12)
***
### emoji?
> `optional` **emoji?**: `string`
Defined in: [sdk/js/src/builders/select.ts:13](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/select.ts#L13)
***
### isDefault
> **isDefault**: `boolean` = `false`
Defined in: [sdk/js/src/builders/select.ts:14](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/select.ts#L14)
***
### label
> **label**: `string` = `''`
Defined in: [sdk/js/src/builders/select.ts:10](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/select.ts#L10)
***
### value
> **value**: `string` = `''`
Defined in: [sdk/js/src/builders/select.ts:11](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/select.ts#L11)
## Methods
### setDefault()
> **setDefault**(`isDefault?`): `this`
Defined in: [sdk/js/src/builders/select.ts:32](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/select.ts#L32)
#### Parameters
##### isDefault?
`boolean` = `true`
#### Returns
`this`
***
### setDescription()
> **setDescription**(`description`): `this`
Defined in: [sdk/js/src/builders/select.ts:24](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/select.ts#L24)
#### Parameters
##### description
`string`
#### Returns
`this`
***
### setEmoji()
> **setEmoji**(`value`): `this`
Defined in: [sdk/js/src/builders/select.ts:28](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/select.ts#L28)
#### Parameters
##### value
`string`
#### Returns
`this`
***
### setLabel()
> **setLabel**(`label`): `this`
Defined in: [sdk/js/src/builders/select.ts:16](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/select.ts#L16)
#### Parameters
##### label
`string`
#### Returns
`this`
***
### setValue()
> **setValue**(`value`): `this`
Defined in: [sdk/js/src/builders/select.ts:20](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/select.ts#L20)
#### Parameters
##### value
`string`
#### Returns
`this`
***
### toWit()
> **toWit**(): `SelectOption`
Defined in: [sdk/js/src/builders/select.ts:36](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/select.ts#L36)
#### Returns
`SelectOption`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/classes/textdisplaybuilder/
---
# TextDisplayBuilder
Defined in: [sdk/js/src/builders/layout.ts:10](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/layout.ts#L10)
Type 10: Markdown text.
## Constructors
### Constructor
> **new TextDisplayBuilder**(): `TextDisplayBuilder`
#### Returns
`TextDisplayBuilder`
## Properties
### content
> **content**: `string` = `''`
Defined in: [sdk/js/src/builders/layout.ts:11](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/layout.ts#L11)
## Methods
### setContent()
> **setContent**(`content`): `this`
Defined in: [sdk/js/src/builders/layout.ts:12](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/layout.ts#L12)
#### Parameters
##### content
`string`
#### Returns
`this`
***
### toWit()
> **toWit**(): `TextDisplay`
Defined in: [sdk/js/src/builders/layout.ts:16](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/layout.ts#L16)
#### Returns
`TextDisplay`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/classes/textinputbuilder/
---
# TextInputBuilder
Defined in: [sdk/js/src/builders/text-input.ts:13](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/text-input.ts#L13)
Type 4. Put it in a [LabelBuilder](/docs/reference/js/zaun-bot/classes/labelbuilder/) (or pass it to `ModalBuilder.addTextInput`).
## Constructors
### Constructor
> **new TextInputBuilder**(): `TextInputBuilder`
#### Returns
`TextInputBuilder`
## Accessors
### customId
#### Get Signature
> **get** **customId**(): `string`
Defined in: [sdk/js/src/builders/text-input.ts:50](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/text-input.ts#L50)
##### Returns
`string`
## Methods
### setCustomId()
> **setCustomId**(`id`): `this`
Defined in: [sdk/js/src/builders/text-input.ts:22](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/text-input.ts#L22)
#### Parameters
##### id
`string`
#### Returns
`this`
***
### setMaxLength()
> **setMaxLength**(`n`): `this`
Defined in: [sdk/js/src/builders/text-input.ts:34](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/text-input.ts#L34)
#### Parameters
##### n
`number`
#### Returns
`this`
***
### setMinLength()
> **setMinLength**(`n`): `this`
Defined in: [sdk/js/src/builders/text-input.ts:30](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/text-input.ts#L30)
#### Parameters
##### n
`number`
#### Returns
`this`
***
### setPlaceholder()
> **setPlaceholder**(`placeholder`): `this`
Defined in: [sdk/js/src/builders/text-input.ts:46](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/text-input.ts#L46)
#### Parameters
##### placeholder
`string`
#### Returns
`this`
***
### setRequired()
> **setRequired**(`required?`): `this`
Defined in: [sdk/js/src/builders/text-input.ts:38](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/text-input.ts#L38)
#### Parameters
##### required?
`boolean` = `true`
#### Returns
`this`
***
### setStyle()
> **setStyle**(`style`): `this`
Defined in: [sdk/js/src/builders/text-input.ts:26](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/text-input.ts#L26)
#### Parameters
##### style
[`TextInputStyle`](/docs/reference/js/zaun-bot/type-aliases/textinputstyle/)
#### Returns
`this`
***
### setValue()
> **setValue**(`value`): `this`
Defined in: [sdk/js/src/builders/text-input.ts:42](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/text-input.ts#L42)
#### Parameters
##### value
`string`
#### Returns
`this`
***
### toWit()
> **toWit**(): `TextInput`
Defined in: [sdk/js/src/builders/text-input.ts:53](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/text-input.ts#L53)
#### Returns
`TextInput`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/classes/thumbnailbuilder/
---
# ThumbnailBuilder
Defined in: [sdk/js/src/builders/layout.ts:23](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/layout.ts#L23)
Type 11: a small picture, an image attachment of the same message.
## Constructors
### Constructor
> **new ThumbnailBuilder**(): `ThumbnailBuilder`
#### Returns
`ThumbnailBuilder`
## Methods
### setDescription()
> **setDescription**(`description`): `this`
Defined in: [sdk/js/src/builders/layout.ts:31](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/layout.ts#L31)
#### Parameters
##### description
`string`
#### Returns
`this`
***
### setMedia()
> **setMedia**(`attachmentId`): `this`
Defined in: [sdk/js/src/builders/layout.ts:27](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/layout.ts#L27)
#### Parameters
##### attachmentId
`string`
#### Returns
`this`
***
### setSpoiler()
> **setSpoiler**(`spoiler?`): `this`
Defined in: [sdk/js/src/builders/layout.ts:35](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/layout.ts#L35)
#### Parameters
##### spoiler?
`boolean` = `true`
#### Returns
`this`
***
### toWit()
> **toWit**(): `Thumbnail`
Defined in: [sdk/js/src/builders/layout.ts:39](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/layout.ts#L39)
#### Returns
`Thumbnail`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/classes/usercontextmenucommandinteraction/
---
# UserContextMenuCommandInteraction
Defined in: [sdk/js/src/interactions/command.ts:41](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/command.ts#L41)
A user context-menu command.
## Extends
- `CommandInteraction`
## Constructors
### Constructor
> **new UserContextMenuCommandInteraction**(`raw`, `data`): `UserContextMenuCommandInteraction`
Defined in: [sdk/js/src/interactions/command.ts:26](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/command.ts#L26)
#### Parameters
##### raw
`Interaction`
##### data
`CommandData`
#### Returns
`UserContextMenuCommandInteraction`
#### Inherited from
`CommandInteraction.constructor`
## Properties
### appPermissions
> `readonly` **appPermissions**: `bigint`
Defined in: [sdk/js/src/interactions/base.ts:20](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L20)
The bot's effective permissions in the channel.
#### Inherited from
`CommandInteraction.appPermissions`
***
### botId
> `readonly` **botId**: `string`
Defined in: [sdk/js/src/interactions/base.ts:15](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L15)
The bot's id in this community.
#### Inherited from
`CommandInteraction.botId`
***
### channelId
> `readonly` **channelId**: `string`
Defined in: [sdk/js/src/interactions/base.ts:16](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L16)
#### Inherited from
`CommandInteraction.channelId`
***
### command
> `readonly` **command**: `CommandData`
Defined in: [sdk/js/src/interactions/command.ts:24](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/command.ts#L24)
The WIT command data.
#### Inherited from
`CommandInteraction.command`
***
### commandId
> `readonly` **commandId**: `string`
Defined in: [sdk/js/src/interactions/command.ts:20](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/command.ts#L20)
#### Inherited from
`CommandInteraction.commandId`
***
### commandName
> `readonly` **commandName**: `string`
Defined in: [sdk/js/src/interactions/command.ts:21](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/command.ts#L21)
#### Inherited from
`CommandInteraction.commandName`
***
### createdTimestamp
> `readonly` **createdTimestamp**: `number`
Defined in: [sdk/js/src/interactions/base.ts:24](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L24)
When the host received it, ms.
#### Inherited from
`CommandInteraction.createdTimestamp`
***
### deferred
> **deferred**: `boolean` = `false`
Defined in: [sdk/js/src/interactions/base.ts:30](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L30)
Whether the response was deferred.
#### Inherited from
`CommandInteraction.deferred`
***
### id
> `readonly` **id**: `string`
Defined in: [sdk/js/src/interactions/base.ts:13](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L13)
The interaction id.
#### Inherited from
`CommandInteraction.id`
***
### locale
> `readonly` **locale**: `string`
Defined in: [sdk/js/src/interactions/base.ts:22](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L22)
The invoker's locale (BCP 47), if their client sent one.
#### Inherited from
`CommandInteraction.locale`
***
### member
> `readonly` **member**: [`Member`](/docs/reference/js/zaun-bot/classes/member/)
Defined in: [sdk/js/src/interactions/base.ts:18](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L18)
Who triggered it: `interaction.member.send(...)` sends them a DM.
#### Inherited from
`CommandInteraction.member`
***
### options
> `readonly` **options**: [`CommandInteractionOptionResolver`](/docs/reference/js/zaun-bot/classes/commandinteractionoptionresolver/)
Defined in: [sdk/js/src/interactions/command.ts:22](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/command.ts#L22)
#### Inherited from
`CommandInteraction.options`
***
### raw
> `readonly` **raw**: `Interaction`
Defined in: [sdk/js/src/interactions/base.ts:26](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L26)
The WIT interaction, for anything the classes do not expose.
#### Inherited from
`CommandInteraction.raw`
***
### replied
> **replied**: `boolean` = `false`
Defined in: [sdk/js/src/interactions/base.ts:28](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L28)
Whether an initial response was sent.
#### Inherited from
`CommandInteraction.replied`
## Accessors
### targetId
#### Get Signature
> **get** **targetId**(): `string`
Defined in: [sdk/js/src/interactions/command.ts:45](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/command.ts#L45)
The member acted on.
##### Returns
`string`
***
### targetMember
#### Get Signature
> **get** **targetMember**(): [`Member`](/docs/reference/js/zaun-bot/classes/member/)
Defined in: [sdk/js/src/interactions/command.ts:48](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/command.ts#L48)
##### Returns
[`Member`](/docs/reference/js/zaun-bot/classes/member/)
***
### userId
#### Get Signature
> **get** **userId**(): `string`
Defined in: [sdk/js/src/interactions/base.ts:44](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L44)
The invoker's member id.
##### Returns
`string`
#### Inherited from
`CommandInteraction.userId`
## Methods
### deferReply()
> **deferReply**(`options?`): `void`
Defined in: [sdk/js/src/interactions/base.ts:81](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L81)
Shows "thinking…" and buys 15 minutes; finish with [editReply](/docs/reference/js/zaun-bot/classes/repliableinteraction/#editreply).
#### Parameters
##### options?
###### ephemeral?
`boolean`
#### Returns
`void`
#### Inherited from
`CommandInteraction.deferReply`
***
### deleteReply()
> **deleteReply**(): `void`
Defined in: [sdk/js/src/interactions/base.ts:92](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L92)
Deletes the original response.
#### Returns
`void`
#### Inherited from
`CommandInteraction.deleteReply`
***
### editReply()
> **editReply**(`payload`): `void`
Defined in: [sdk/js/src/interactions/base.ts:87](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L87)
Replaces the original response (ends a deferred reply).
#### Parameters
##### payload
[`MessagePayload`](/docs/reference/js/zaun-bot/type-aliases/messagepayload/)
#### Returns
`void`
#### Inherited from
`CommandInteraction.editReply`
***
### followUp()
> **followUp**(`payload`): `string`
Defined in: [sdk/js/src/interactions/base.ts:97](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L97)
Another message, within 15 minutes (at most 10).
#### Parameters
##### payload
[`MessagePayload`](/docs/reference/js/zaun-bot/type-aliases/messagepayload/)
#### Returns
`string`
#### Inherited from
`CommandInteraction.followUp`
***
### isAnySelectMenu()
> **isAnySelectMenu**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:67](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L67)
#### Returns
`boolean`
#### Inherited from
`CommandInteraction.isAnySelectMenu`
***
### isAutocomplete()
> **isAutocomplete**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:69](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L69)
#### Returns
`boolean`
#### Inherited from
`CommandInteraction.isAutocomplete`
***
### isButton()
> **isButton**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:61](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L61)
#### Returns
`boolean`
#### Inherited from
`CommandInteraction.isButton`
***
### isChannelSelectMenu()
> **isChannelSelectMenu**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:66](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L66)
#### Returns
`boolean`
#### Inherited from
`CommandInteraction.isChannelSelectMenu`
***
### isChatInputCommand()
> **isChatInputCommand**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:55](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L55)
#### Returns
`boolean`
#### Inherited from
`CommandInteraction.isChatInputCommand`
***
### isCommand()
> **isCommand**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:59](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L59)
#### Returns
`boolean`
#### Inherited from
`CommandInteraction.isCommand`
***
### isContextMenuCommand()
> **isContextMenuCommand**(): `boolean`
Defined in: [sdk/js/src/interactions/command.ts:42](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/command.ts#L42)
#### Returns
`boolean`
#### Overrides
`CommandInteraction.isContextMenuCommand`
***
### isMentionableSelectMenu()
> **isMentionableSelectMenu**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:65](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L65)
#### Returns
`boolean`
#### Inherited from
`CommandInteraction.isMentionableSelectMenu`
***
### isMessageComponent()
> **isMessageComponent**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:60](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L60)
#### Returns
`boolean`
#### Inherited from
`CommandInteraction.isMessageComponent`
***
### isMessageContextMenuCommand()
> **isMessageContextMenuCommand**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:58](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L58)
#### Returns
`boolean`
#### Inherited from
`CommandInteraction.isMessageContextMenuCommand`
***
### isModalSubmit()
> **isModalSubmit**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:68](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L68)
#### Returns
`boolean`
#### Inherited from
`CommandInteraction.isModalSubmit`
***
### isRepliable()
> **isRepliable**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:70](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L70)
#### Returns
`boolean`
#### Inherited from
`CommandInteraction.isRepliable`
***
### isRoleSelectMenu()
> **isRoleSelectMenu**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:64](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L64)
#### Returns
`boolean`
#### Inherited from
`CommandInteraction.isRoleSelectMenu`
***
### isStringSelectMenu()
> **isStringSelectMenu**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:62](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L62)
#### Returns
`boolean`
#### Inherited from
`CommandInteraction.isStringSelectMenu`
***
### isUserContextMenuCommand()
> **isUserContextMenuCommand**(): `this is UserContextMenuCommandInteraction`
Defined in: [sdk/js/src/interactions/command.ts:43](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/command.ts#L43)
#### Returns
`this is UserContextMenuCommandInteraction`
#### Overrides
`CommandInteraction.isUserContextMenuCommand`
***
### isUserSelectMenu()
> **isUserSelectMenu**(): `boolean`
Defined in: [sdk/js/src/interactions/base.ts:63](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L63)
#### Returns
`boolean`
#### Inherited from
`CommandInteraction.isUserSelectMenu`
***
### reply()
> **reply**(`payload`): `string`
Defined in: [sdk/js/src/interactions/base.ts:76](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L76)
Answers with a message in the channel (or only to the invoker with `ephemeral`).
#### Parameters
##### payload
[`MessagePayload`](/docs/reference/js/zaun-bot/type-aliases/messagepayload/)
#### Returns
`string`
#### Inherited from
`CommandInteraction.reply`
***
### showModal()
> **showModal**(`modal`): `void`
Defined in: [sdk/js/src/interactions/base.ts:105](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/base.ts#L105)
Opens a modal for the invoker.
#### Parameters
##### modal
[`ModalBuilder`](/docs/reference/js/zaun-bot/classes/modalbuilder/)
#### Returns
`void`
#### Inherited from
`CommandInteraction.showModal`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/classes/userselectmenubuilder/
---
# UserSelectMenuBuilder
Defined in: [sdk/js/src/builders/select.ts:135](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/select.ts#L135)
Type 5: members.
## Extends
- `EntitySelectBuilder`
## Constructors
### Constructor
> **new UserSelectMenuBuilder**(): `UserSelectMenuBuilder`
#### Returns
`UserSelectMenuBuilder`
#### Inherited from
`EntitySelectBuilder.constructor`
## Accessors
### customId
#### Get Signature
> **get** **customId**(): `string`
Defined in: [sdk/js/src/builders/select.ts:78](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/select.ts#L78)
##### Returns
`string`
#### Inherited from
`EntitySelectBuilder.customId`
## Methods
### setCustomId()
> **setCustomId**(`id`): `this`
Defined in: [sdk/js/src/builders/select.ts:53](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/select.ts#L53)
#### Parameters
##### id
`string`
#### Returns
`this`
#### Inherited from
`EntitySelectBuilder.setCustomId`
***
### setDefaultUsers()
> **setDefaultUsers**(...`ids`): `this`
Defined in: [sdk/js/src/builders/select.ts:137](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/select.ts#L137)
#### Parameters
##### ids
...`string`[]
#### Returns
`this`
***
### setDisabled()
> **setDisabled**(`disabled?`): `this`
Defined in: [sdk/js/src/builders/select.ts:74](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/select.ts#L74)
#### Parameters
##### disabled?
`boolean` = `true`
#### Returns
`this`
#### Inherited from
`EntitySelectBuilder.setDisabled`
***
### setMaxValues()
> **setMaxValues**(`n`): `this`
Defined in: [sdk/js/src/builders/select.ts:65](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/select.ts#L65)
#### Parameters
##### n
`number`
#### Returns
`this`
#### Inherited from
`EntitySelectBuilder.setMaxValues`
***
### setMinValues()
> **setMinValues**(`n`): `this`
Defined in: [sdk/js/src/builders/select.ts:61](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/select.ts#L61)
#### Parameters
##### n
`number`
#### Returns
`this`
#### Inherited from
`EntitySelectBuilder.setMinValues`
***
### setPlaceholder()
> **setPlaceholder**(`placeholder`): `this`
Defined in: [sdk/js/src/builders/select.ts:57](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/select.ts#L57)
#### Parameters
##### placeholder
`string`
#### Returns
`this`
#### Inherited from
`EntitySelectBuilder.setPlaceholder`
***
### setRequired()
> **setRequired**(`required?`): `this`
Defined in: [sdk/js/src/builders/select.ts:70](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/select.ts#L70)
In a modal: whether an answer is needed (default true).
#### Parameters
##### required?
`boolean` = `true`
#### Returns
`this`
#### Inherited from
`EntitySelectBuilder.setRequired`
***
### toWit()
> **toWit**(): `EntitySelect`
Defined in: [sdk/js/src/builders/select.ts:124](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/select.ts#L124)
#### Returns
`EntitySelect`
#### Inherited from
`EntitySelectBuilder.toWit`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/classes/zaunerror/
---
# ZaunError
Defined in: [sdk/js/src/errors.ts:6](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/errors.ts#L6)
The host refused a call (`FORBIDDEN`, `NOT_FOUND`, `RATE_LIMITED`, `NOT_GRANTED`, …).
## Extends
- `Error`
## Extended by
- [`HttpError`](/docs/reference/js/zaun-bot/classes/httperror/)
## Constructors
### Constructor
> **new ZaunError**(`code`, `detail?`, `retryAfterMs?`): `ZaunError`
Defined in: [sdk/js/src/errors.ts:14](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/errors.ts#L14)
#### Parameters
##### code
`string`
##### detail?
`string`
##### retryAfterMs?
`number`
#### Returns
`ZaunError`
#### Overrides
`Error.constructor`
## Properties
### code
> `readonly` **code**: `string`
Defined in: [sdk/js/src/errors.ts:8](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/errors.ts#L8)
The protocol error code, or a runtime code such as `NOT_GRANTED`.
***
### detail
> `readonly` **detail**: `string`
Defined in: [sdk/js/src/errors.ts:10](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/errors.ts#L10)
The `reason` or `field` the host gave.
***
### retryAfterMs
> `readonly` **retryAfterMs**: `number`
Defined in: [sdk/js/src/errors.ts:12](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/errors.ts#L12)
For `RATE_LIMITED` and `BUSY`: when to try again, in ms.
## Methods
### isUnsupported()
> **isUnsupported**(): `boolean`
Defined in: [sdk/js/src/errors.ts:27](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/errors.ts#L27)
Whether the host does not implement this call (or this case of it) yet: an older host, or a
feature it lacks, such as volume without an Opus encoder. Fall back to what the bot did
before; trying again will not help.
#### Returns
`boolean`
***
### from()
> `static` **from**(`e`): `ZaunError`
Defined in: [sdk/js/src/errors.ts:32](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/errors.ts#L32)
From the WIT `host-error`.
#### Parameters
##### e
`HostError`
#### Returns
`ZaunError`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/classes/zaunvalidationerror/
---
# ZaunValidationError
Defined in: [sdk/js/src/errors.ts:39](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/errors.ts#L39)
A builder or message breaks a protocol limit; thrown before anything reaches the host.
## Extends
- `Error`
## Constructors
### Constructor
> **new ZaunValidationError**(`field`, `message`): `ZaunValidationError`
Defined in: [sdk/js/src/errors.ts:43](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/errors.ts#L43)
#### Parameters
##### field
`string`
##### message
`string`
#### Returns
`ZaunValidationError`
#### Overrides
`Error.constructor`
## Properties
### field
> `readonly` **field**: `string`
Defined in: [sdk/js/src/errors.ts:41](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/errors.ts#L41)
The field at fault, dotted (`components.custom_id`).
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/functions/haspermission/
---
# hasPermission
> **hasPermission**(`bits`, `needed`): `boolean`
Defined in: [sdk/js/src/permissions.ts:43](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/permissions.ts#L43)
Whether `bits` holds every bit of `needed`.
## Parameters
### bits
`bigint`
### needed
`bigint`
## Returns
`boolean`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/functions/interactionfromwit/
---
# interactionFromWit
> **interactionFromWit**(`raw`): [`Interaction`](/docs/reference/js/zaun-bot/type-aliases/interaction/)
Defined in: [sdk/js/src/interactions/index.ts:23](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/index.ts#L23)
The class for `raw`.
## Parameters
### raw
`Interaction`
## Returns
[`Interaction`](/docs/reference/js/zaun-bot/type-aliases/interaction/)
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/functions/isid/
---
# isId
> **isId**(`id`): `boolean`
Defined in: [sdk/js/src/mention.ts:31](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/mention.ts#L31)
Whether `id` is a well-formed Zaun id: 16 bytes in unpadded base64url.
## Parameters
### id
`string`
## Returns
`boolean`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/functions/parsementions/
---
# parseMentions
> **parseMentions**(`content`): `Mentions`
Defined in: [sdk/js/src/mention.ts:45](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/mention.ts#L45)
The mentions `content` shows: `<@id>` (and the usual `<@!id>`) for members, `<@&id>` for
roles, `@everyone`. Each id once, in order, at most 50 members and 20 roles; malformed ids are
skipped. Use it only on text the bot wrote: on text from members it would mention whoever
they named.
## Parameters
### content
`string`
## Returns
`Mentions`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/functions/rolemention/
---
# roleMention
> **roleMention**(`roleId`): `string`
Defined in: [sdk/js/src/mention.ts:23](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/mention.ts#L23)
The text that shows a role mention: `<@&id>`.
## Parameters
### roleId
`string`
## Returns
`string`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/functions/setcommands/
---
# setCommands
> **setCommands**(`commands`): `RegisteredCommand`[]
Defined in: [sdk/js/src/api.ts:166](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/api.ts#L166)
Replaces the bot's commands at run time (the ones from `bot.command` register at start).
## Parameters
### commands
[`CommandLike`](/docs/reference/js/zaun-bot/interfaces/commandlike/)[]
## Returns
`RegisteredCommand`[]
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/functions/tobody/
---
# toBody
> **toBody**(`payload`, `ephemeral?`): `MessageBody`
Defined in: [sdk/js/src/message.ts:65](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/message.ts#L65)
The WIT `message-body` of a payload; `ephemeral` overrides the payload's own flag.
## Parameters
### payload
[`MessagePayload`](/docs/reference/js/zaun-bot/type-aliases/messagepayload/)
### ephemeral?
`boolean`
## Returns
`MessageBody`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/functions/usermention/
---
# userMention
> **userMention**(`memberId`): `string`
Defined in: [sdk/js/src/mention.ts:15](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/mention.ts#L15)
The text that shows a member mention: `<@id>`.
## Parameters
### memberId
`string`
## Returns
`string`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/interfaces/audiostreamoptions/
---
# AudioStreamOptions
Defined in: [sdk/js/src/audio.ts:16](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/audio.ts#L16)
## Properties
### format
> **format**: [`AudioFormat`](/docs/reference/js/zaun-bot/type-aliases/audioformat/)
Defined in: [sdk/js/src/audio.ts:17](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/audio.ts#L17)
***
### lowWaterMs?
> `optional` **lowWaterMs?**: `number`
Defined in: [sdk/js/src/audio.ts:19](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/audio.ts#L19)
`audioLow` fires when less than this is buffered, in ms (20–2000; default 200).
***
### title?
> `optional` **title?**: `string`
Defined in: [sdk/js/src/audio.ts:21](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/audio.ts#L21)
Shown as the current title while the stream plays.
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/interfaces/autocompletechoice/
---
# AutocompleteChoice
Defined in: [sdk/js/src/interactions/command.ts:12](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/command.ts#L12)
A choice returned to autocomplete.
## Properties
### name
> **name**: `string`
Defined in: [sdk/js/src/interactions/command.ts:13](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/command.ts#L13)
***
### nameLocalizations?
> `optional` **nameLocalizations?**: `Record`\<`string`, `string`\>
Defined in: [sdk/js/src/interactions/command.ts:15](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/command.ts#L15)
***
### value
> **value**: `string` \| `number`
Defined in: [sdk/js/src/interactions/command.ts:14](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/command.ts#L14)
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/interfaces/botevents/
---
# BotEvents
Defined in: [sdk/js/src/events.ts:20](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/events.ts#L20)
Listener signatures by event name. Community events arrive only when the manifest's `events`
names them (or their group: `messages`, `reactions`, `members`, `channels`, `roles`,
`typing`, `presence`, `community`, `commands`, `dms`).
## Properties
### audioClose
> **audioClose**: () => `unknown`
Defined in: [sdk/js/src/events.ts:85](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/events.ts#L85)
The `audio` stream closed (drained, closed at once, or the voice stay ended).
#### Returns
`unknown`
***
### audioLow
> **audioLow**: (`bufferedMs`) => `unknown`
Defined in: [sdk/js/src/events.ts:83](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/events.ts#L83)
The `audio` stream's buffer fell below its low-water mark: write more (ms still buffered).
#### Parameters
##### bufferedMs
`number`
#### Returns
`unknown`
***
### channelCreate
> **channelCreate**: `On`\<`Channel`\>
Defined in: [sdk/js/src/events.ts:47](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/events.ts#L47)
(`channels`)
***
### channelDelete
> **channelDelete**: `On`\<`string`\>
Defined in: [sdk/js/src/events.ts:49](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/events.ts#L49)
***
### channelUpdate
> **channelUpdate**: `On`\<`Channel`\>
Defined in: [sdk/js/src/events.ts:48](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/events.ts#L48)
***
### commandsUpdate
> **commandsUpdate**: `On`\<`string`\>
Defined in: [sdk/js/src/events.ts:61](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/events.ts#L61)
(`commands`) A bot's command list changed: its bot id.
***
### communityUpdate
> **communityUpdate**: `On`\<`CommunityProfile`\>
Defined in: [sdk/js/src/events.ts:59](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/events.ts#L59)
(`community`)
***
### config
> **config**: (`config`, `bot`) => `unknown`
Defined in: [sdk/js/src/events.ts:24](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/events.ts#L24)
The owner changed the configuration while the bot runs (no restart): every value.
#### Parameters
##### config
`ReadonlyMap`\<`string`, `string`\>
##### bot
[`Bot`](/docs/reference/js/zaun-bot/classes/bot/)
#### Returns
`unknown`
***
### dmCreate
> **dmCreate**: `On`\<`Channel`\>
Defined in: [sdk/js/src/events.ts:63](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/events.ts#L63)
(`dms`) A DM with the bot opened, by the bot or a member.
***
### dmDelete
> **dmDelete**: `On`\<`string`\>
Defined in: [sdk/js/src/events.ts:65](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/events.ts#L65)
(`dms`) The bot closed a DM: its channel id.
***
### error
> **error**: (`error`) => `unknown`
Defined in: [sdk/js/src/events.ts:87](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/events.ts#L87)
A handler threw or rejected.
#### Parameters
##### error
`Error`
#### Returns
`unknown`
***
### init
> **init**: (`bot`) => `unknown`
Defined in: [sdk/js/src/events.ts:22](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/events.ts#L22)
The instance started (`init`), before its commands register. `bot.config` is set.
#### Parameters
##### bot
[`Bot`](/docs/reference/js/zaun-bot/classes/bot/)
#### Returns
`unknown`
***
### interactionCreate
> **interactionCreate**: (`interaction`) => `unknown`
Defined in: [sdk/js/src/events.ts:28](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/events.ts#L28)
Any interaction, after its command/component/modal handler ran. (`interactionCreate`)
#### Parameters
##### interaction
[`Interaction`](/docs/reference/js/zaun-bot/type-aliases/interaction/)
#### Returns
`unknown`
***
### memberAdd
> **memberAdd**: `On`\<[`Member`](/docs/reference/js/zaun-bot/classes/member/)\>
Defined in: [sdk/js/src/events.ts:38](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/events.ts#L38)
(`members`, capability `members`)
***
### memberRemove
> **memberRemove**: `On`\<`string`\>
Defined in: [sdk/js/src/events.ts:41](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/events.ts#L41)
A member left, was kicked or banned: its id.
***
### memberRolesUpdate
> **memberRolesUpdate**: `On`\<`MemberRoles`\>
Defined in: [sdk/js/src/events.ts:44](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/events.ts#L44)
***
### memberTimeout
> **memberTimeout**: `On`\<`MemberTimeout`\>
Defined in: [sdk/js/src/events.ts:45](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/events.ts#L45)
***
### memberUpdate
> **memberUpdate**: `On`\<[`Member`](/docs/reference/js/zaun-bot/classes/member/)\>
Defined in: [sdk/js/src/events.ts:39](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/events.ts#L39)
***
### messageCreate
> **messageCreate**: `On`\<[`EventMessage`](/docs/reference/js/zaun-bot/type-aliases/eventmessage/)\>
Defined in: [sdk/js/src/events.ts:30](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/events.ts#L30)
(`messages`) Content follows the `message_content` capability; DMs arrive whole.
***
### messageDelete
> **messageDelete**: `On`\<\{ `channelId`: `string`; `messageId`: `string`; \}\>
Defined in: [sdk/js/src/events.ts:32](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/events.ts#L32)
***
### messageDeleteBulk
> **messageDeleteBulk**: `On`\<\{ `channelId`: `string`; `messageIds`: `string`[]; \}\>
Defined in: [sdk/js/src/events.ts:33](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/events.ts#L33)
***
### messageReactionAdd
> **messageReactionAdd**: `On`\<`Reaction`\>
Defined in: [sdk/js/src/events.ts:35](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/events.ts#L35)
(`reactions`)
***
### messageReactionRemove
> **messageReactionRemove**: `On`\<`Reaction`\>
Defined in: [sdk/js/src/events.ts:36](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/events.ts#L36)
***
### messageUpdate
> **messageUpdate**: `On`\<[`EventMessage`](/docs/reference/js/zaun-bot/type-aliases/eventmessage/)\>
Defined in: [sdk/js/src/events.ts:31](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/events.ts#L31)
***
### presenceUpdate
> **presenceUpdate**: `On`\<`Presence`\>
Defined in: [sdk/js/src/events.ts:57](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/events.ts#L57)
(`presence`, capability `presence`)
***
### queueEnd
> **queueEnd**: () => `unknown`
Defined in: [sdk/js/src/events.ts:81](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/events.ts#L81)
The last track played out with nothing queued (not after `stop` or `leave`).
#### Returns
`unknown`
***
### raw
> **raw**: `On`\<\{ `json`: `string`; `kind`: `string`; \}\>
Defined in: [sdk/js/src/events.ts:67](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/events.ts#L67)
An event without a typed form: its type and JSON body. (`raw`)
***
### ready
> **ready**: `On`\<[`Me`](/docs/reference/js/zaun-bot/interfaces/me/)\>
Defined in: [sdk/js/src/events.ts:26](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/events.ts#L26)
The bot's connection is up: who it is. (`ready`)
***
### removed
> **removed**: `On`\<`string`\>
Defined in: [sdk/js/src/events.ts:43](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/events.ts#L43)
This bot was removed (kicked or banned): the reason.
***
### roleCreate
> **roleCreate**: `On`\<`Role`\>
Defined in: [sdk/js/src/events.ts:51](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/events.ts#L51)
(`roles`)
***
### roleDelete
> **roleDelete**: `On`\<`string`\>
Defined in: [sdk/js/src/events.ts:53](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/events.ts#L53)
***
### roleUpdate
> **roleUpdate**: `On`\<`Role`\>
Defined in: [sdk/js/src/events.ts:52](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/events.ts#L52)
***
### timer
> **timer**: (`timer`) => `unknown`
Defined in: [sdk/js/src/events.ts:69](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/events.ts#L69)
A timer from `bot.timers` fired.
#### Parameters
##### timer
###### id
`number`
###### tag
`string`
#### Returns
`unknown`
***
### trackEnd
> **trackEnd**: (`title`) => `unknown`
Defined in: [sdk/js/src/events.ts:73](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/events.ts#L73)
#### Parameters
##### title
`string`
#### Returns
`unknown`
***
### trackError
> **trackError**: (`error`) => `unknown`
Defined in: [sdk/js/src/events.ts:75](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/events.ts#L75)
A track could not be read (the text names no URL).
#### Parameters
##### error
`string`
#### Returns
`unknown`
***
### trackStart
> **trackStart**: (`title`) => `unknown`
Defined in: [sdk/js/src/events.ts:72](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/events.ts#L72)
#### Parameters
##### title
`string`
#### Returns
`unknown`
***
### typingStart
> **typingStart**: `On`\<`Typing`\>
Defined in: [sdk/js/src/events.ts:55](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/events.ts#L55)
(`typing`)
***
### voiceEnd
> **voiceEnd**: (`reason`) => `unknown`
Defined in: [sdk/js/src/events.ts:79](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/events.ts#L79)
The bot's voice stay ended (left, moved, disconnected).
#### Parameters
##### reason
`string`
#### Returns
`unknown`
***
### voiceEvent
> **voiceEvent**: (`event`) => `unknown`
Defined in: [sdk/js/src/events.ts:71](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/events.ts#L71)
Voice: anything from the bot's stay or player (the WIT event).
#### Parameters
##### event
`VoiceEvent`
#### Returns
`unknown`
***
### voiceMemberJoin
> **voiceMemberJoin**: (`memberId`) => `unknown`
Defined in: [sdk/js/src/events.ts:76](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/events.ts#L76)
#### Parameters
##### memberId
`string`
#### Returns
`unknown`
***
### voiceMemberLeave
> **voiceMemberLeave**: (`memberId`) => `unknown`
Defined in: [sdk/js/src/events.ts:77](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/events.ts#L77)
#### Parameters
##### memberId
`string`
#### Returns
`unknown`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/interfaces/command/
---
# Command
Defined in: [sdk/js/src/bot.ts:31](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/bot.ts#L31)
A registered command.
## Properties
### autocomplete?
> `optional` **autocomplete?**: (`i`) => `unknown`
Defined in: [sdk/js/src/bot.ts:34](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/bot.ts#L34)
#### Parameters
##### i
[`AutocompleteInteraction`](/docs/reference/js/zaun-bot/classes/autocompleteinteraction/)
#### Returns
`unknown`
***
### data
> **data**: [`CommandLike`](/docs/reference/js/zaun-bot/interfaces/commandlike/)
Defined in: [sdk/js/src/bot.ts:32](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/bot.ts#L32)
***
### execute?
> `optional` **execute?**: (`i`) => `unknown`
Defined in: [sdk/js/src/bot.ts:33](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/bot.ts#L33)
#### Parameters
##### i
[`ChatInputCommandInteraction`](/docs/reference/js/zaun-bot/classes/chatinputcommandinteraction/) \| [`UserContextMenuCommandInteraction`](/docs/reference/js/zaun-bot/classes/usercontextmenucommandinteraction/) \| [`MessageContextMenuCommandInteraction`](/docs/reference/js/zaun-bot/classes/messagecontextmenucommandinteraction/)
#### Returns
`unknown`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/interfaces/commandlike/
---
# CommandLike
Defined in: [sdk/js/src/builders/command.ts:111](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/command.ts#L111)
Anything that becomes an application command.
## Properties
### name
> `readonly` **name**: `string`
Defined in: [sdk/js/src/builders/command.ts:112](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/command.ts#L112)
## Methods
### toWit()
> **toWit**(): `ApplicationCommand`
Defined in: [sdk/js/src/builders/command.ts:113](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/command.ts#L113)
#### Returns
`ApplicationCommand`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/interfaces/embeddata/
---
# EmbedData
Defined in: [sdk/js/src/builders/embed.ts:9](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/embed.ts#L9)
The data `EmbedBuilder` holds.
## Properties
### author?
> `optional` **author?**: `object`
Defined in: [sdk/js/src/builders/embed.ts:15](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/embed.ts#L15)
#### iconAttachment?
> `optional` **iconAttachment?**: `string`
#### name
> **name**: `string`
#### url?
> `optional` **url?**: `string`
***
### color?
> `optional` **color?**: `number`
Defined in: [sdk/js/src/builders/embed.ts:13](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/embed.ts#L13)
***
### description?
> `optional` **description?**: `string`
Defined in: [sdk/js/src/builders/embed.ts:11](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/embed.ts#L11)
***
### fields?
> `optional` **fields?**: `object`[]
Defined in: [sdk/js/src/builders/embed.ts:19](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/embed.ts#L19)
#### inline?
> `optional` **inline?**: `boolean`
#### name
> **name**: `string`
#### value
> **value**: `string`
***
### footer?
> `optional` **footer?**: `object`
Defined in: [sdk/js/src/builders/embed.ts:16](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/embed.ts#L16)
#### iconAttachment?
> `optional` **iconAttachment?**: `string`
#### text
> **text**: `string`
***
### imageAttachment?
> `optional` **imageAttachment?**: `string`
Defined in: [sdk/js/src/builders/embed.ts:17](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/embed.ts#L17)
***
### thumbnailAttachment?
> `optional` **thumbnailAttachment?**: `string`
Defined in: [sdk/js/src/builders/embed.ts:18](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/embed.ts#L18)
***
### timestamp?
> `optional` **timestamp?**: `number`
Defined in: [sdk/js/src/builders/embed.ts:14](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/embed.ts#L14)
***
### title?
> `optional` **title?**: `string`
Defined in: [sdk/js/src/builders/embed.ts:10](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/embed.ts#L10)
***
### url?
> `optional` **url?**: `string`
Defined in: [sdk/js/src/builders/embed.ts:12](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/embed.ts#L12)
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/interfaces/httpresponse/
---
# HttpResponse
Defined in: [sdk/js/src/api.ts:100](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/api.ts#L100)
An HTTPS response.
## Properties
### body
> **body**: `Uint8Array`
Defined in: [sdk/js/src/api.ts:103](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/api.ts#L103)
***
### headers
> **headers**: `Record`\<`string`, `string`\>
Defined in: [sdk/js/src/api.ts:102](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/api.ts#L102)
***
### status
> **status**: `number`
Defined in: [sdk/js/src/api.ts:101](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/api.ts#L101)
## Methods
### json()
> **json**\<`T`\>(): `T`
Defined in: [sdk/js/src/api.ts:105](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/api.ts#L105)
#### Type Parameters
##### T
`T` = `unknown`
#### Returns
`T`
***
### text()
> **text**(): `string`
Defined in: [sdk/js/src/api.ts:104](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/api.ts#L104)
#### Returns
`string`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/interfaces/me/
---
# Me
Defined in: [sdk/js/src/context.ts:11](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/context.ts#L11)
Who the bot is in its community, from the host's `ready` event.
## Properties
### botId
> **botId**: `string`
Defined in: [sdk/js/src/context.ts:13](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/context.ts#L13)
The installation.
***
### communityId
> **communityId**: `string`
Defined in: [sdk/js/src/context.ts:17](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/context.ts#L17)
The community it runs for.
***
### memberId
> **memberId**: `string`
Defined in: [sdk/js/src/context.ts:15](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/context.ts#L15)
The bot's own member.
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/interfaces/mediagalleryitem/
---
# MediaGalleryItem
Defined in: [sdk/js/src/builders/layout.ts:73](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/layout.ts#L73)
One picture of a gallery.
## Properties
### description?
> `optional` **description?**: `string`
Defined in: [sdk/js/src/builders/layout.ts:75](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/layout.ts#L75)
***
### media
> **media**: `string`
Defined in: [sdk/js/src/builders/layout.ts:74](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/layout.ts#L74)
***
### spoiler?
> `optional` **spoiler?**: `boolean`
Defined in: [sdk/js/src/builders/layout.ts:76](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/layout.ts#L76)
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/interfaces/messageoptions/
---
# MessageOptions
Defined in: [sdk/js/src/message.ts:13](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/message.ts#L13)
A message to send.
## Properties
### attachments?
> `optional` **attachments?**: `string`[]
Defined in: [sdk/js/src/message.ts:18](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/message.ts#L18)
Attachment ids from `bot.messages.upload` (or `files` uploaded for you by `send`).
***
### components?
> `optional` **components?**: [`TopLevelComponent`](/docs/reference/js/zaun-bot/type-aliases/toplevelcomponent/)[]
Defined in: [sdk/js/src/message.ts:16](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/message.ts#L16)
***
### componentsV2?
> `optional` **componentsV2?**: `boolean`
Defined in: [sdk/js/src/message.ts:40](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/message.ts#L40)
Lay the message out with Components V2 (content and embeds must be empty). Set
automatically when a component other than an action row is used.
***
### content?
> `optional` **content?**: `string`
Defined in: [sdk/js/src/message.ts:14](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/message.ts#L14)
***
### embeds?
> `optional` **embeds?**: ([`EmbedBuilder`](/docs/reference/js/zaun-bot/classes/embedbuilder/) \| [`EmbedData`](/docs/reference/js/zaun-bot/interfaces/embeddata/))[]
Defined in: [sdk/js/src/message.ts:15](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/message.ts#L15)
***
### ephemeral?
> `optional` **ephemeral?**: `boolean`
Defined in: [sdk/js/src/message.ts:31](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/message.ts#L31)
Only the invoker sees it (interaction replies and follow-ups only).
***
### mentions?
> `optional` **mentions?**: `object`
Defined in: [sdk/js/src/message.ts:24](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/message.ts#L24)
Who is notified (each id once; ≤ 50 members, ≤ 20 roles). Zaun names mentions explicitly:
the content only shows them (`userMention(id)`, `roleMention(id)`). On an edit, absent
leaves the mentions as they were, and `{}` clears them.
#### everyone?
> `optional` **everyone?**: `boolean`
#### members?
> `optional` **members?**: `string`[]
#### roles?
> `optional` **roles?**: `string`[]
***
### mentionsFromContent?
> `optional` **mentionsFromContent?**: `boolean`
Defined in: [sdk/js/src/message.ts:29](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/message.ts#L29)
Also notify whoever `content` shows (`<@id>`, `<@&id>`, `@everyone`; see
`parseMentions`). Only for text the bot wrote, never for text a member gave it.
***
### silent?
> `optional` **silent?**: `boolean`
Defined in: [sdk/js/src/message.ts:33](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/message.ts#L33)
Mentions do not notify.
***
### suppressEmbeds?
> `optional` **suppressEmbeds?**: `boolean`
Defined in: [sdk/js/src/message.ts:35](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/message.ts#L35)
Embeds are not shown.
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/type-aliases/applicationcommandoptiontype/
---
# ApplicationCommandOptionType
> **ApplicationCommandOptionType** = *typeof* [`ApplicationCommandOptionType`](/docs/reference/js/zaun-bot/variables/applicationcommandoptiontype/)\[keyof *typeof* [`ApplicationCommandOptionType`](/docs/reference/js/zaun-bot/variables/applicationcommandoptiontype/)\]
Defined in: [sdk/js/src/builders/options.ts:9](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/options.ts#L9)
Option types (standard numbers; 1 and 2 are sub-commands and groups).
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/type-aliases/applicationcommandtype/
---
# ApplicationCommandType
> **ApplicationCommandType** = *typeof* [`ApplicationCommandType`](/docs/reference/js/zaun-bot/variables/applicationcommandtype/)\[keyof *typeof* [`ApplicationCommandType`](/docs/reference/js/zaun-bot/variables/applicationcommandtype/)\]
Defined in: [sdk/js/src/builders/command.ts:12](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/command.ts#L12)
Command types (standard numbers).
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/type-aliases/audioformat/
---
# AudioFormat
> **AudioFormat** = `"opus"` \| \{ `pcm`: \{ `channels`: `1` \| `2`; `sampleRate`: `8000` \| `12000` \| `16000` \| `24000` \| `48000`; \}; \}
Defined in: [sdk/js/src/audio.ts:14](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/audio.ts#L14)
`'opus'` packets the bot encodes, or 16-bit PCM the host encodes (needs an Opus encoder).
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/type-aliases/buttoninteraction/
---
# ButtonInteraction
> **ButtonInteraction** = [`MessageComponentInteraction`](/docs/reference/js/zaun-bot/classes/messagecomponentinteraction/)
Defined in: [sdk/js/src/interactions/component.ts:63](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/component.ts#L63)
Type guards for narrowing.
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/type-aliases/buttonstyle/
---
# ButtonStyle
> **ButtonStyle** = *typeof* [`ButtonStyle`](/docs/reference/js/zaun-bot/variables/buttonstyle/)\[keyof *typeof* [`ButtonStyle`](/docs/reference/js/zaun-bot/variables/buttonstyle/)\]
Defined in: [sdk/js/src/builders/button.ts:9](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/button.ts#L9)
Button styles (standard numbers; premium 6 is not supported).
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/type-aliases/channelselectmenuinteraction/
---
# ChannelSelectMenuInteraction
> **ChannelSelectMenuInteraction** = [`MessageComponentInteraction`](/docs/reference/js/zaun-bot/classes/messagecomponentinteraction/)
Defined in: [sdk/js/src/interactions/component.ts:68](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/component.ts#L68)
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/type-aliases/containercomponent/
---
# ContainerComponent
> **ContainerComponent** = [`ActionRowBuilder`](/docs/reference/js/zaun-bot/classes/actionrowbuilder/) \| [`TextDisplayBuilder`](/docs/reference/js/zaun-bot/classes/textdisplaybuilder/) \| [`SectionBuilder`](/docs/reference/js/zaun-bot/classes/sectionbuilder/) \| [`MediaGalleryBuilder`](/docs/reference/js/zaun-bot/classes/mediagallerybuilder/) \| [`FileBuilder`](/docs/reference/js/zaun-bot/classes/filebuilder/) \| [`SeparatorBuilder`](/docs/reference/js/zaun-bot/classes/separatorbuilder/)
Defined in: [sdk/js/src/builders/layout.ts:136](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/layout.ts#L136)
What a container (and a V2 message) may hold.
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/type-aliases/eventmessage/
---
# EventMessage
> **EventMessage** = [`Message`](/docs/reference/js/zaun-bot/classes/message/) & `object`
Defined in: [sdk/js/src/context.ts:21](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/context.ts#L21)
A message as events deliver it, with whether it is in a DM with the bot.
## Type Declaration
### isDM
> `readonly` **isDM**: `boolean`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/type-aliases/interaction/
---
# Interaction
> **Interaction** = [`ChatInputCommandInteraction`](/docs/reference/js/zaun-bot/classes/chatinputcommandinteraction/) \| [`UserContextMenuCommandInteraction`](/docs/reference/js/zaun-bot/classes/usercontextmenucommandinteraction/) \| [`MessageContextMenuCommandInteraction`](/docs/reference/js/zaun-bot/classes/messagecontextmenucommandinteraction/) \| [`MessageComponentInteraction`](/docs/reference/js/zaun-bot/classes/messagecomponentinteraction/) \| [`ModalSubmitInteraction`](/docs/reference/js/zaun-bot/classes/modalsubmitinteraction/) \| [`AutocompleteInteraction`](/docs/reference/js/zaun-bot/classes/autocompleteinteraction/)
Defined in: [sdk/js/src/interactions/index.ts:18](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/index.ts#L18)
Any interaction a bot can receive.
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/type-aliases/labelcomponent/
---
# LabelComponent
> **LabelComponent** = [`TextInputBuilder`](/docs/reference/js/zaun-bot/classes/textinputbuilder/) \| `Exclude`\<[`RowComponent`](/docs/reference/js/zaun-bot/type-aliases/rowcomponent/), [`ButtonBuilder`](/docs/reference/js/zaun-bot/classes/buttonbuilder/)\> \| [`FileUploadBuilder`](/docs/reference/js/zaun-bot/classes/fileuploadbuilder/) \| [`RadioGroupBuilder`](/docs/reference/js/zaun-bot/classes/radiogroupbuilder/) \| [`CheckboxGroupBuilder`](/docs/reference/js/zaun-bot/classes/checkboxgroupbuilder/) \| [`CheckboxBuilder`](/docs/reference/js/zaun-bot/classes/checkboxbuilder/)
Defined in: [sdk/js/src/builders/modal.ts:16](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/modal.ts#L16)
What a label may hold.
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/type-aliases/loopmode/
---
# LoopMode
> **LoopMode** = `w.voiceTypes.LoopMode`
Defined in: [sdk/js/src/voice.ts:25](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/voice.ts#L25)
What happens when a track ends: `'off'`, `'track'` (repeat it) or `'queue'` (requeue it).
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/type-aliases/mentionableselectmenuinteraction/
---
# MentionableSelectMenuInteraction
> **MentionableSelectMenuInteraction** = [`MessageComponentInteraction`](/docs/reference/js/zaun-bot/classes/messagecomponentinteraction/)
Defined in: [sdk/js/src/interactions/component.ts:67](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/component.ts#L67)
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/type-aliases/messagepayload/
---
# MessagePayload
> **MessagePayload** = `string` \| [`MessageOptions`](/docs/reference/js/zaun-bot/interfaces/messageoptions/) \| [`EmbedBuilder`](/docs/reference/js/zaun-bot/classes/embedbuilder/)
Defined in: [sdk/js/src/message.ts:44](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/message.ts#L44)
Anything `reply`, `send`, `followUp` and friends accept.
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/type-aliases/presencestatus/
---
# PresenceStatus
> **PresenceStatus** = `"online"` \| `"idle"` \| `"dnd"` \| `"invisible"`
Defined in: [sdk/js/src/presence.ts:21](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/presence.ts#L21)
`online`, `idle`, `dnd`, or `invisible` (looks offline to everyone).
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/type-aliases/roleselectmenuinteraction/
---
# RoleSelectMenuInteraction
> **RoleSelectMenuInteraction** = [`MessageComponentInteraction`](/docs/reference/js/zaun-bot/classes/messagecomponentinteraction/)
Defined in: [sdk/js/src/interactions/component.ts:66](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/component.ts#L66)
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/type-aliases/rowcomponent/
---
# RowComponent
> **RowComponent** = [`ButtonBuilder`](/docs/reference/js/zaun-bot/classes/buttonbuilder/) \| [`StringSelectMenuBuilder`](/docs/reference/js/zaun-bot/classes/stringselectmenubuilder/) \| [`UserSelectMenuBuilder`](/docs/reference/js/zaun-bot/classes/userselectmenubuilder/) \| [`RoleSelectMenuBuilder`](/docs/reference/js/zaun-bot/classes/roleselectmenubuilder/) \| [`MentionableSelectMenuBuilder`](/docs/reference/js/zaun-bot/classes/mentionableselectmenubuilder/) \| [`ChannelSelectMenuBuilder`](/docs/reference/js/zaun-bot/classes/channelselectmenubuilder/)
Defined in: [sdk/js/src/builders/row.ts:13](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/row.ts#L13)
What an action row may hold.
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/type-aliases/separatorspacingsize/
---
# SeparatorSpacingSize
> **SeparatorSpacingSize** = *typeof* [`SeparatorSpacingSize`](/docs/reference/js/zaun-bot/variables/separatorspacingsize/)\[keyof *typeof* [`SeparatorSpacingSize`](/docs/reference/js/zaun-bot/variables/separatorspacingsize/)\]
Defined in: [sdk/js/src/builders/layout.ts:115](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/layout.ts#L115)
Separator spacing (standard numbers).
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/type-aliases/stringselectmenuinteraction/
---
# StringSelectMenuInteraction
> **StringSelectMenuInteraction** = [`MessageComponentInteraction`](/docs/reference/js/zaun-bot/classes/messagecomponentinteraction/)
Defined in: [sdk/js/src/interactions/component.ts:64](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/component.ts#L64)
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/type-aliases/textinputstyle/
---
# TextInputStyle
> **TextInputStyle** = *typeof* [`TextInputStyle`](/docs/reference/js/zaun-bot/variables/textinputstyle/)\[keyof *typeof* [`TextInputStyle`](/docs/reference/js/zaun-bot/variables/textinputstyle/)\]
Defined in: [sdk/js/src/builders/text-input.ts:9](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/text-input.ts#L9)
Text input styles (standard numbers).
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/type-aliases/toplevelcomponent/
---
# TopLevelComponent
> **TopLevelComponent** = [`ContainerComponent`](/docs/reference/js/zaun-bot/type-aliases/containercomponent/) \| [`ContainerBuilder`](/docs/reference/js/zaun-bot/classes/containerbuilder/)
Defined in: [sdk/js/src/builders/layout.ts:191](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/layout.ts#L191)
Any top-level message component.
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/type-aliases/trackoptions/
---
# TrackOptions
> **TrackOptions** = \{ `title?`: `string`; `url`: `string`; \} \| \{ `ogg`: `Uint8Array`; `title?`: `string`; \} \| \{ `pushed`: `true`; `title?`: `string`; \}
Defined in: [sdk/js/src/voice.ts:11](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/voice.ts#L11)
Something to play: an Ogg Opus or WebM Opus URL (WebM where the host demuxes it), `https://` on
a `network` host or `http://`/`https://` on a `local_network` address (the host checks it);
Ogg Opus bytes; or pushed Opus packets.
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/type-aliases/userselectmenuinteraction/
---
# UserSelectMenuInteraction
> **UserSelectMenuInteraction** = [`MessageComponentInteraction`](/docs/reference/js/zaun-bot/classes/messagecomponentinteraction/)
Defined in: [sdk/js/src/interactions/component.ts:65](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/component.ts#L65)
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/type-aliases/voicestate/
---
# VoiceState
> **VoiceState** = `Omit`\<`w.voiceTypes.VoiceState`, `"positionMs"` \| `"durationMs"`\> & `object`
Defined in: [sdk/js/src/voice.ts:20](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/voice.ts#L20)
Where the bot is and what it plays. `positionMs` and `durationMs` are numbers here (the WIT
`u64`s, converted); `durationMs` is `undefined` for live streams and pushed audio.
## Type Declaration
### durationMs
> **durationMs**: `number` \| `undefined`
### positionMs
> **positionMs**: `number`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/variables/applicationcommandoptiontype/
---
# ApplicationCommandOptionType
> `const` **ApplicationCommandOptionType**: `object`
Defined in: [sdk/js/src/builders/options.ts:9](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/options.ts#L9)
Option types (standard numbers; 1 and 2 are sub-commands and groups).
## Type Declaration
### Attachment
> `readonly` **Attachment**: `11` = `11`
### Boolean
> `readonly` **Boolean**: `5` = `5`
### Channel
> `readonly` **Channel**: `7` = `7`
### Integer
> `readonly` **Integer**: `4` = `4`
### Mentionable
> `readonly` **Mentionable**: `9` = `9`
### Number
> `readonly` **Number**: `10` = `10`
### Role
> `readonly` **Role**: `8` = `8`
### String
> `readonly` **String**: `3` = `3`
### Subcommand
> `readonly` **Subcommand**: `1` = `1`
### SubcommandGroup
> `readonly` **SubcommandGroup**: `2` = `2`
### User
> `readonly` **User**: `6` = `6`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/variables/applicationcommandtype/
---
# ApplicationCommandType
> `const` **ApplicationCommandType**: `object`
Defined in: [sdk/js/src/builders/command.ts:12](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/command.ts#L12)
Command types (standard numbers).
## Type Declaration
### ChatInput
> `readonly` **ChatInput**: `1` = `1`
### Message
> `readonly` **Message**: `3` = `3`
### User
> `readonly` **User**: `2` = `2`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/variables/audio/
---
# audio
> `const` **audio**: `object`
Defined in: [sdk/js/src/audio.ts:29](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/audio.ts#L29)
The bot's audio output stream. Errors throw `ZaunError`.
## Type Declaration
### bufferedMs()
> **bufferedMs**(): `number`
The audio written and not yet played, in ms (0 without a stream).
#### Returns
`number`
### clear()
> **clear**(): `void`
Drops everything buffered at once; the stream stays open.
#### Returns
`void`
### close()
> **close**(`drain?`): `void`
Closes the stream, after the buffer has played (`drain`, the default) or at once.
#### Parameters
##### drain?
`boolean` = `true`
#### Returns
`void`
### open()
> **open**(`options`): `void`
Opens the stream, 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 (PCM without an encoder).
#### Parameters
##### options
[`AudioStreamOptions`](/docs/reference/js/zaun-bot/interfaces/audiostreamoptions/)
#### Returns
`void`
### writeOpus()
> **writeOpus**(`packets`): `number`
Opus packets (2.5–120 ms each, ≤ 1000 bytes); returns the ms buffered (`BUSY` past 3 s).
#### Parameters
##### packets
`Uint8Array`\<`ArrayBufferLike`\>[]
#### Returns
`number`
### writePcm()
> **writePcm**(`samples`): `number`
Interleaved samples, any count; returns the ms buffered (`BUSY` past 3 s).
#### Parameters
##### samples
`Int16Array`
#### Returns
`number`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/variables/buttonstyle/
---
# ButtonStyle
> `const` **ButtonStyle**: `object`
Defined in: [sdk/js/src/builders/button.ts:9](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/button.ts#L9)
Button styles (standard numbers; premium 6 is not supported).
## Type Declaration
### Danger
> `readonly` **Danger**: `4` = `4`
### Link
> `readonly` **Link**: `5` = `5`
### Primary
> `readonly` **Primary**: `1` = `1`
### Secondary
> `readonly` **Secondary**: `2` = `2`
### Success
> `readonly` **Success**: `3` = `3`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/variables/community/
---
# community
> `const` **community**: `object`
Defined in: [sdk/js/src/api.ts:151](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/api.ts#L151)
Reads and moderation, checked by the host against the bot's grants and permissions.
## Type Declaration
### addRole
> **addRole**: (`memberId`, `roleId`) => `void`
#### Parameters
##### memberId
`string`
##### roleId
`string`
#### Returns
`void`
### getChannel
> **getChannel**: (`id`) => `Channel`
#### Parameters
##### id
`string`
#### Returns
`Channel`
### getMember
> **getMember**: (`id`) => [`Member`](/docs/reference/js/zaun-bot/classes/member/)
#### Parameters
##### id
`string`
#### Returns
[`Member`](/docs/reference/js/zaun-bot/classes/member/)
### getRole
> **getRole**: (`id`) => `Role`
#### Parameters
##### id
`string`
#### Returns
`Role`
### kick
> **kick**: (`memberId`, `reason?`) => `void`
#### Parameters
##### memberId
`string`
##### reason?
`string`
#### Returns
`void`
### listChannels
> **listChannels**: () => `Channel`[]
#### Returns
`Channel`[]
### listMembers
> **listMembers**: (`options`) => [`Member`](/docs/reference/js/zaun-bot/classes/member/)[]
#### Parameters
##### options?
###### after?
`string`
###### limit?
`number`
#### Returns
[`Member`](/docs/reference/js/zaun-bot/classes/member/)[]
### listRoles
> **listRoles**: () => `Role`[]
#### Returns
`Role`[]
### removeRole
> **removeRole**: (`memberId`, `roleId`) => `void`
#### Parameters
##### memberId
`string`
##### roleId
`string`
#### Returns
`void`
### timeout
> **timeout**: (`memberId`, `until`, `reason?`) => `void`
Times a member out until `until` (ms); `null` clears it.
#### Parameters
##### memberId
`string`
##### until
`number`
##### reason?
`string`
#### Returns
`void`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/variables/componenttype/
---
# ComponentType
> `const` **ComponentType**: `object`
Defined in: [sdk/js/src/interactions/component.ts:9](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/interactions/component.ts#L9)
Component types (standard numbers).
## Type Declaration
### ActionRow
> `readonly` **ActionRow**: `1` = `1`
### Button
> `readonly` **Button**: `2` = `2`
### ChannelSelect
> `readonly` **ChannelSelect**: `8` = `8`
### Checkbox
> `readonly` **Checkbox**: `23` = `23`
### CheckboxGroup
> `readonly` **CheckboxGroup**: `22` = `22`
### Container
> `readonly` **Container**: `17` = `17`
### File
> `readonly` **File**: `13` = `13`
### FileUpload
> `readonly` **FileUpload**: `19` = `19`
### Label
> `readonly` **Label**: `18` = `18`
### MediaGallery
> `readonly` **MediaGallery**: `12` = `12`
### MentionableSelect
> `readonly` **MentionableSelect**: `7` = `7`
### RadioGroup
> `readonly` **RadioGroup**: `21` = `21`
### RoleSelect
> `readonly` **RoleSelect**: `6` = `6`
### Section
> `readonly` **Section**: `9` = `9`
### Separator
> `readonly` **Separator**: `14` = `14`
### StringSelect
> `readonly` **StringSelect**: `3` = `3`
### TextDisplay
> `readonly` **TextDisplay**: `10` = `10`
### TextInput
> `readonly` **TextInput**: `4` = `4`
### Thumbnail
> `readonly` **Thumbnail**: `11` = `11`
### UserSelect
> `readonly` **UserSelect**: `5` = `5`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/variables/dms/
---
# dms
> `const` **dms**: `object`
Defined in: [sdk/js/src/dms.ts:8](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/dms.ts#L8)
The bot's DMs. A member can turn DMs from bots off; then `open` throws `FORBIDDEN`.
## Type Declaration
### close()
> **close**(`channelId`): `void`
Hides a DM from the bot's list.
#### Parameters
##### channelId
`string`
#### Returns
`void`
### listOpen()
> **listOpen**(): `Channel`[]
The DMs the bot has open.
#### Returns
`Channel`[]
### open()
> **open**(`memberId`): `Channel`
The DM with `memberId`, opened when there is none.
#### Parameters
##### memberId
`string`
#### Returns
`Channel`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/variables/everyonemention/
---
# everyoneMention
> `const` **everyoneMention**: `"@everyone"` = `'@everyone'`
Defined in: [sdk/js/src/mention.ts:10](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/mention.ts#L10)
The text that shows `@everyone`.
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/variables/http/
---
# http
> `const` **http**: `object`
Defined in: [sdk/js/src/api.ts:121](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/api.ts#L121)
HTTPS to hosts in the bot's `network` grant, and `http://` or `https://` to the exact
`host:port` addresses of its `local_network` grant. The host makes the request and checks
the URL; the SDK passes it through.
## Type Declaration
### fetch()
> **fetch**(`url`, `init?`): [`HttpResponse`](/docs/reference/js/zaun-bot/interfaces/httpresponse/)
#### Parameters
##### url
`string`
##### init?
###### body?
`string` \| `Uint8Array`\<`ArrayBufferLike`\>
###### headers?
`Record`\<`string`, `string`\>
###### method?
`string`
###### timeoutMs?
`number`
#### Returns
[`HttpResponse`](/docs/reference/js/zaun-bot/interfaces/httpresponse/)
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/variables/limits/
---
# Limits
> `const` **Limits**: `object`
Defined in: [sdk/js/src/limits.ts:2](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/limits.ts#L2)
Protocol limits, checked by the builders before sending.
## Type Declaration
### autocompleteChoices
> `readonly` **autocompleteChoices**: `25` = `25`
### buttonLabel
> `readonly` **buttonLabel**: `80` = `80`
### buttonsPerRow
> `readonly` **buttonsPerRow**: `5` = `5`
### chatInputCommands
> `readonly` **chatInputCommands**: `100` = `100`
### checkboxOptions
> `readonly` **checkboxOptions**: readonly \[`1`, `10`\]
### choices
> `readonly` **choices**: `25` = `25`
### choiceText
> `readonly` **choiceText**: `100` = `100`
### commandDescription
> `readonly` **commandDescription**: `100` = `100`
### commandName
> `readonly` **commandName**: `32` = `32`
### commandOptions
> `readonly` **commandOptions**: `25` = `25`
### componentsTotal
> `readonly` **componentsTotal**: `40` = `40`
### contextMenuCommands
> `readonly` **contextMenuCommands**: `15` = `15`
### customId
> `readonly` **customId**: `100` = `100`
### embedAuthor
> `readonly` **embedAuthor**: `256` = `256`
### embedDescription
> `readonly` **embedDescription**: `4096` = `4096`
### embedFieldName
> `readonly` **embedFieldName**: `256` = `256`
### embedFields
> `readonly` **embedFields**: `25` = `25`
### embedFieldValue
> `readonly` **embedFieldValue**: `1024` = `1024`
### embedFooter
> `readonly` **embedFooter**: `2048` = `2048`
### embeds
> `readonly` **embeds**: `10` = `10`
### embedTitle
> `readonly` **embedTitle**: `256` = `256`
### embedTotal
> `readonly` **embedTotal**: `6000` = `6000`
### fileUploads
> `readonly` **fileUploads**: `10` = `10`
### followups
> `readonly` **followups**: `10` = `10`
### labelDescription
> `readonly` **labelDescription**: `100` = `100`
### labelText
> `readonly` **labelText**: `45` = `45`
### mediaDescription
> `readonly` **mediaDescription**: `1024` = `1024`
### mediaGalleryItems
> `readonly` **mediaGalleryItems**: `10` = `10`
### messageContent
> `readonly` **messageContent**: `4000` = `4000`
### modalItems
> `readonly` **modalItems**: `5` = `5`
### modalTitle
> `readonly` **modalTitle**: `45` = `45`
### optionLength
> `readonly` **optionLength**: `6000` = `6000`
### radioOptions
> `readonly` **radioOptions**: readonly \[`2`, `10`\]
### rows
> `readonly` **rows**: `5` = `5`
### sectionTexts
> `readonly` **sectionTexts**: `3` = `3`
### selectOptions
> `readonly` **selectOptions**: `25` = `25`
### selectOptionText
> `readonly` **selectOptionText**: `100` = `100`
### selectPlaceholder
> `readonly` **selectPlaceholder**: `150` = `150`
### textDisplayTotal
> `readonly` **textDisplayTotal**: `4000` = `4000`
### textInput
> `readonly` **textInput**: `4000` = `4000`
### textInputPlaceholder
> `readonly` **textInputPlaceholder**: `100` = `100`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/variables/log/
---
# log
> `const` **log**: `Record`\<`"trace"` \| `"debug"` \| `"info"` \| `"warn"` \| `"error"`, (...`args`) => `void`\>
Defined in: [sdk/js/src/api.ts:148](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/api.ts#L148)
Lines for the operator (`zaun-host bot logs`); rate-limited by the host.
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/variables/membermention/
---
# memberMention
> `const` **memberMention**: (`memberId`) => `string` = `userMention`
Defined in: [sdk/js/src/mention.ts:20](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/mention.ts#L20)
Same as `userMention`: Zaun calls users members.
The text that shows a member mention: `<@id>`.
## Parameters
### memberId
`string`
## Returns
`string`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/variables/mentionlimits/
---
# MentionLimits
> `const` **MentionLimits**: `object`
Defined in: [sdk/js/src/mention.ts:12](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/mention.ts#L12)
Most members, and roles, one message may mention (spec §12).
## Type Declaration
### members
> `readonly` **members**: `50` = `50`
### roles
> `readonly` **roles**: `20` = `20`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/variables/messages/
---
# messages
> `const` **messages**: `object`
Defined in: [sdk/js/src/api.ts:12](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/api.ts#L12)
Messages and reactions in channels the bot can see.
## Type Declaration
### delete()
> **delete**(`channelId`, `messageId`): `void`
#### Parameters
##### channelId
`string`
##### messageId
`string`
#### Returns
`void`
### dm()
> **dm**(`memberId`, `payload`): `object`
A direct message to `memberId` (capability `dms`): opens the DM when needed. Returns the
DM's channel id and the message id.
#### Parameters
##### memberId
`string`
##### payload
[`MessagePayload`](/docs/reference/js/zaun-bot/type-aliases/messagepayload/)
#### Returns
`object`
##### channelId
> **channelId**: `string`
##### messageId
> **messageId**: `string`
### edit()
> **edit**(`channelId`, `messageId`, `payload`): `void`
Edits one of the bot's messages.
#### Parameters
##### channelId
`string`
##### messageId
`string`
##### payload
[`MessagePayload`](/docs/reference/js/zaun-bot/type-aliases/messagepayload/)
#### Returns
`void`
### history()
> **history**(`channelId`, `options?`): [`Message`](/docs/reference/js/zaun-bot/classes/message/)[]
Up to `limit` (1–100) messages before the sequence `before`.
#### Parameters
##### channelId
`string`
##### options?
###### before?
`number`
###### limit?
`number`
#### Returns
[`Message`](/docs/reference/js/zaun-bot/classes/message/)[]
### react()
> **react**(`channelId`, `messageId`, `emoji`): `void`
#### Parameters
##### channelId
`string`
##### messageId
`string`
##### emoji
`string`
#### Returns
`void`
### send()
> **send**(`channelId`, `payload`, `options?`): `string`
Posts a message; returns its id.
#### Parameters
##### channelId
`string`
##### payload
[`MessagePayload`](/docs/reference/js/zaun-bot/type-aliases/messagepayload/)
##### options?
###### replyTo?
`string`
#### Returns
`string`
### unreact()
> **unreact**(`channelId`, `messageId`, `emoji`): `void`
#### Parameters
##### channelId
`string`
##### messageId
`string`
##### emoji
`string`
#### Returns
`void`
### upload()
> **upload**(`channelId`, `name`, `mime`, `bytes`): `string`
Uploads a file for the bot's next message (capability `attachments`); returns its id.
#### Parameters
##### channelId
`string`
##### name
`string`
##### mime
`string`
##### bytes
`Uint8Array`
#### Returns
`string`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/variables/permissionflagsbits/
---
# PermissionFlagsBits
> `const` **PermissionFlagsBits**: `object`
Defined in: [sdk/js/src/permissions.ts:2](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/permissions.ts#L2)
Zaun permission bits.
## Type Declaration
### AddReactions
> `readonly` **AddReactions**: `bigint`
### Administrator
> `readonly` **Administrator**: `bigint`
### ApproveMembers
> `readonly` **ApproveMembers**: `bigint`
### AttachFiles
> `readonly` **AttachFiles**: `bigint`
### BanMembers
> `readonly` **BanMembers**: `bigint`
### BypassSlowmode
> `readonly` **BypassSlowmode**: `bigint`
### ChangeNickname
> `readonly` **ChangeNickname**: `bigint`
### Connect
> `readonly` **Connect**: `bigint`
### CreateInvite
> `readonly` **CreateInvite**: `bigint`
### CreateThreads
> `readonly` **CreateThreads**: `bigint`
### DeafenMembers
> `readonly` **DeafenMembers**: `bigint`
### EmbedLinks
> `readonly` **EmbedLinks**: `bigint`
### KickMembers
> `readonly` **KickMembers**: `bigint`
### ManageChannels
> `readonly` **ManageChannels**: `bigint`
### ManageCommunity
> `readonly` **ManageCommunity**: `bigint`
### ManageEmojis
> `readonly` **ManageEmojis**: `bigint`
### ManageInvites
> `readonly` **ManageInvites**: `bigint`
### ManageMessages
> `readonly` **ManageMessages**: `bigint`
### ManageNicknames
> `readonly` **ManageNicknames**: `bigint`
### ManageReports
> `readonly` **ManageReports**: `bigint`
### ManageRoles
> `readonly` **ManageRoles**: `bigint`
### ManageSafety
> `readonly` **ManageSafety**: `bigint`
### ManageThreads
> `readonly` **ManageThreads**: `bigint`
### ManageWebhooks
> `readonly` **ManageWebhooks**: `bigint`
### MentionEveryone
> `readonly` **MentionEveryone**: `bigint`
### MoveMembers
> `readonly` **MoveMembers**: `bigint`
### MuteMembers
> `readonly` **MuteMembers**: `bigint`
### ReadMessageHistory
> `readonly` **ReadMessageHistory**: `bigint`
### SendMessages
> `readonly` **SendMessages**: `bigint`
### SendMessagesInThreads
> `readonly` **SendMessagesInThreads**: `bigint`
### Speak
> `readonly` **Speak**: `bigint`
### Stream
> `readonly` **Stream**: `bigint`
### TimeoutMembers
> `readonly` **TimeoutMembers**: `bigint`
### UseApplicationCommands
> `readonly` **UseApplicationCommands**: `bigint`
### Video
> `readonly` **Video**: `bigint`
### ViewAuditLog
> `readonly` **ViewAuditLog**: `bigint`
### ViewChannel
> `readonly` **ViewChannel**: `bigint`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/variables/presence/
---
# presence
> `const` **presence**: `object`
Defined in: [sdk/js/src/presence.ts:83](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/presence.ts#L83)
The bot's presence and custom status text.
## Type Declaration
### clearStatus()
> **clearStatus**(): `void`
Clears the custom status text and emoji.
#### Returns
`void`
### set()
> **set**(`status`, `activity?`): `void`
Sets the status and activity (none: no activity).
#### Parameters
##### status
[`PresenceStatus`](/docs/reference/js/zaun-bot/type-aliases/presencestatus/)
##### activity?
[`Activity`](/docs/reference/js/zaun-bot/classes/activity/)
#### Returns
`void`
### setStatus()
> **setStatus**(`text?`, `emoji?`, `expiresAt?`): `void`
Sets the custom status text and emoji, cleared by the host at `expiresAt` (ms) if given.
#### Parameters
##### text?
`string`
##### emoji?
`string`
##### expiresAt?
`number` \| `bigint`
#### Returns
`void`
### setStatusText()
> **setStatusText**(`text`): `void`
Sets the custom status text, kept until changed.
#### Parameters
##### text
`string`
#### Returns
`void`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/variables/separatorspacingsize/
---
# SeparatorSpacingSize
> `const` **SeparatorSpacingSize**: `object`
Defined in: [sdk/js/src/builders/layout.ts:115](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/layout.ts#L115)
Separator spacing (standard numbers).
## Type Declaration
### Large
> `readonly` **Large**: `2` = `2`
### Small
> `readonly` **Small**: `1` = `1`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/variables/storage/
---
# storage
> `const` **storage**: `object`
Defined in: [sdk/js/src/api.ts:53](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/api.ts#L53)
The bot's key-value storage (capability `storage_bytes`).
## Type Declaration
### delete()
> **delete**(`key`): `void`
#### Parameters
##### key
`string`
#### Returns
`void`
### get()
> **get**(`key`): `Uint8Array`\<`ArrayBufferLike`\>
#### Parameters
##### key
`string`
#### Returns
`Uint8Array`\<`ArrayBufferLike`\>
### getJSON()
> **getJSON**\<`T`\>(`key`): `T`
A JSON value (bigints are not supported by JSON).
#### Type Parameters
##### T
`T` = `unknown`
#### Parameters
##### key
`string`
#### Returns
`T`
### getString()
> **getString**(`key`): `string`
#### Parameters
##### key
`string`
#### Returns
`string`
### keys()
> **keys**(`prefix?`, `options?`): `string`[]
Keys starting with `prefix`, in order.
#### Parameters
##### prefix?
`string` = `''`
##### options?
###### after?
`string`
###### limit?
`number`
#### Returns
`string`[]
### set()
> **set**(`key`, `value`): `void`
#### Parameters
##### key
`string`
##### value
`Uint8Array`
#### Returns
`void`
### setJSON()
> **setJSON**(`key`, `value`): `void`
#### Parameters
##### key
`string`
##### value
`unknown`
#### Returns
`void`
### setString()
> **setString**(`key`, `value`): `void`
#### Parameters
##### key
`string`
##### value
`string`
#### Returns
`void`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/variables/textinputstyle/
---
# TextInputStyle
> `const` **TextInputStyle**: `object`
Defined in: [sdk/js/src/builders/text-input.ts:9](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/builders/text-input.ts#L9)
Text input styles (standard numbers).
## Type Declaration
### Paragraph
> `readonly` **Paragraph**: `2` = `2`
### Short
> `readonly` **Short**: `1` = `1`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/variables/timers/
---
# timers
> `const` **timers**: `object`
Defined in: [sdk/js/src/api.ts:85](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/api.ts#L85)
Timers (capability `timers`): they fire the bot's `timer` event.
## Type Declaration
### after()
> **after**(`ms`, `tag`): `number`
Once after `ms`; returns the timer id.
#### Parameters
##### ms
`number`
##### tag
`string`
#### Returns
`number`
### cancel()
> **cancel**(`id`): `void`
#### Parameters
##### id
`number`
#### Returns
`void`
### every()
> **every**(`ms`, `tag`): `number`
Every `ms` (≥ 1000).
#### Parameters
##### ms
`number`
##### tag
`string`
#### Returns
`number`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-bot/variables/voice/
---
# voice
> `const` **voice**: `object`
Defined in: [sdk/js/src/voice.ts:35](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/voice.ts#L35)
The bot's voice stay and player. Errors throw `ZaunError` (`FORBIDDEN` without grants).
## Type Declaration
### clearQueue()
> **clearQueue**(): `void`
Empties the queue; unlike `stop`, the current track keeps playing.
#### Returns
`void`
### endStream()
> **endStream**(): `void`
The `pushed` track ends once its buffer has played.
#### Returns
`void`
### enqueue()
> **enqueue**(`t`): `number`
Adds to the queue (≤ 100); returns its length.
#### Parameters
##### t
`string` \| [`TrackOptions`](/docs/reference/js/zaun-bot/type-aliases/trackoptions/)
#### Returns
`number`
### join()
> **join**(`channelId`): `void`
Joins a voice channel (leaving another first); returns once audio can flow.
#### Parameters
##### channelId
`string`
#### Returns
`void`
### leave()
> **leave**(): `void`
Leaves; playback stops and the queue clears.
#### Returns
`void`
### moveTrack()
> **moveTrack**(`from`, `to`): `void`
Moves the queued track at `from` to `to` (both 0-based); the tracks between shift.
#### Parameters
##### from
`number`
##### to
`number`
#### Returns
`void`
### pause()
> **pause**(): `void`
#### Returns
`void`
### play()
> **play**(`t`): `void`
Plays now, replacing the current track (a string is a URL).
#### Parameters
##### t
`string` \| [`TrackOptions`](/docs/reference/js/zaun-bot/type-aliases/trackoptions/)
#### Returns
`void`
### push()
> **push**(`packets`): `number`
Opus packets for the current `pushed` track; returns ms buffered (`BUSY` past 3 s).
#### Parameters
##### packets
`Uint8Array`\<`ArrayBufferLike`\>[]
#### Returns
`number`
### remove()
> **remove**(`index`): `string`
Removes the queued track at `index` (0 plays next); returns its title. Throws `NOT_FOUND`
past the end. Like every queue call, `UNSUPPORTED` on hosts without queue control.
#### Parameters
##### index
`number`
#### Returns
`string`
### resume()
> **resume**(): `void`
#### Returns
`void`
### seek()
> **seek**(`ms`): `void`
Jumps to `ms` into the current track; past the end, the track ends. Throws `UNSUPPORTED` for
live streams and pushed audio, and on hosts that cannot seek; `CONFLICT` when nothing plays.
#### Parameters
##### ms
`number`
#### Returns
`void`
### setLoop()
> **setLoop**(`mode`): `void`
Sets what happens when a track ends.
#### Parameters
##### mode
`LoopMode`
#### Returns
`void`
### setVolume()
> **setVolume**(`percent`): `void`
Sets the playback volume, 0–200 % (100 when the bot joins). Throws `ZaunError` `BAD_REQUEST`
(detail `percent`) outside 0–200, checked before the call, and `UNSUPPORTED` on hosts without
an Opus encoder, which is most of them for now: tell the member and go on.
#### Parameters
##### percent
`number`
#### Returns
`void`
### shuffle()
> **shuffle**(): `void`
Puts the queue in a random order; the current track keeps playing.
#### Returns
`void`
### skip()
> **skip**(): `void`
#### Returns
`void`
### state()
> **state**(): [`VoiceState`](/docs/reference/js/zaun-bot/type-aliases/voicestate/)
#### Returns
[`VoiceState`](/docs/reference/js/zaun-bot/type-aliases/voicestate/)
### stop()
> **stop**(): `void`
Ends the current track and clears the queue.
#### Returns
`void`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-client/readme/
---
# zaun-client
## Classes
- [ActionRowBuilder](/docs/reference/js/zaun-client/classes/actionrowbuilder/)
- [Attachment](/docs/reference/js/zaun-client/classes/attachment/)
- [AttachmentReader](/docs/reference/js/zaun-client/classes/attachmentreader/)
- [ButtonBuilder](/docs/reference/js/zaun-client/classes/buttonbuilder/)
- [Channel](/docs/reference/js/zaun-client/classes/channel/)
- [Client](/docs/reference/js/zaun-client/classes/client/)
- [Collection](/docs/reference/js/zaun-client/classes/collection/)
- [CommandBuilder](/docs/reference/js/zaun-client/classes/commandbuilder/)
- [Community](/docs/reference/js/zaun-client/classes/community/)
- [ContainerBuilder](/docs/reference/js/zaun-client/classes/containerbuilder/)
- [Embed](/docs/reference/js/zaun-client/classes/embed/)
- [EmbedBuilder](/docs/reference/js/zaun-client/classes/embedbuilder/)
- [Interaction](/docs/reference/js/zaun-client/classes/interaction/)
- [Member](/docs/reference/js/zaun-client/classes/member/)
- [Message](/docs/reference/js/zaun-client/classes/message/)
- [MessageMentions](/docs/reference/js/zaun-client/classes/messagementions/)
- [ModalBuilder](/docs/reference/js/zaun-client/classes/modalbuilder/)
- [Permissions](/docs/reference/js/zaun-client/classes/permissions/)
- [RawClient](/docs/reference/js/zaun-client/classes/rawclient/)
- [Role](/docs/reference/js/zaun-client/classes/role/)
- [SelectBuilder](/docs/reference/js/zaun-client/classes/selectbuilder/)
- [SimplexClient](/docs/reference/js/zaun-client/classes/simplexclient/)
- [TextInputBuilder](/docs/reference/js/zaun-client/classes/textinputbuilder/)
- [VoiceConnection](/docs/reference/js/zaun-client/classes/voiceconnection/)
- [ZaunError](/docs/reference/js/zaun-client/classes/zaunerror/)
## Interfaces
- [Activity](/docs/reference/js/zaun-client/interfaces/activity/)
- [AllowedMentions](/docs/reference/js/zaun-client/interfaces/allowedmentions/)
- [ApplicationCommandData](/docs/reference/js/zaun-client/interfaces/applicationcommanddata/)
- [BotCapabilities](/docs/reference/js/zaun-client/interfaces/botcapabilities/)
- [BotCard](/docs/reference/js/zaun-client/interfaces/botcard/)
- [BotConfigKey](/docs/reference/js/zaun-client/interfaces/botconfigkey/)
- [BotSource](/docs/reference/js/zaun-client/interfaces/botsource/)
- [CatalogSeen](/docs/reference/js/zaun-client/interfaces/catalogseen/)
- [CatalogVerification](/docs/reference/js/zaun-client/interfaces/catalogverification/)
- [ClientEvents](/docs/reference/js/zaun-client/interfaces/clientevents/)
- [CommandOptionData](/docs/reference/js/zaun-client/interfaces/commandoptiondata/)
- [DmChannelData](/docs/reference/js/zaun-client/interfaces/dmchanneldata/)
- [DmSettings](/docs/reference/js/zaun-client/interfaces/dmsettings/)
- [EmbedData](/docs/reference/js/zaun-client/interfaces/embeddata/)
- [EmbedFieldData](/docs/reference/js/zaun-client/interfaces/embedfielddata/)
- [FileToSend](/docs/reference/js/zaun-client/interfaces/filetosend/)
- [HistoryVerification](/docs/reference/js/zaun-client/interfaces/historyverification/)
- [InstallSource](/docs/reference/js/zaun-client/interfaces/installsource/)
- [MentionsData](/docs/reference/js/zaun-client/interfaces/mentionsdata/)
- [MentionsInput](/docs/reference/js/zaun-client/interfaces/mentionsinput/)
- [OptionValueData](/docs/reference/js/zaun-client/interfaces/optionvaluedata/)
- [PackageIdentity](/docs/reference/js/zaun-client/interfaces/packageidentity/)
- [PackageInspection](/docs/reference/js/zaun-client/interfaces/packageinspection/)
- [Presence](/docs/reference/js/zaun-client/interfaces/presence/)
- [RegistryError](/docs/reference/js/zaun-client/interfaces/registryerror/)
- [StartOptions](/docs/reference/js/zaun-client/interfaces/startoptions/)
- [VoiceEvents](/docs/reference/js/zaun-client/interfaces/voiceevents/)
- [VoiceState](/docs/reference/js/zaun-client/interfaces/voicestate/)
## Type Aliases
- [BotMessageOptions](/docs/reference/js/zaun-client/type-aliases/botmessageoptions/)
- [ComponentData](/docs/reference/js/zaun-client/type-aliases/componentdata/)
- [MessageEditOptions](/docs/reference/js/zaun-client/type-aliases/messageeditoptions/)
- [MessageOptions](/docs/reference/js/zaun-client/type-aliases/messageoptions/)
- [PermissionFlag](/docs/reference/js/zaun-client/type-aliases/permissionflag/)
- [PermissionResolvable](/docs/reference/js/zaun-client/type-aliases/permissionresolvable/)
- [PictureSource](/docs/reference/js/zaun-client/type-aliases/picturesource/)
## Variables
- [ApplicationCommandType](/docs/reference/js/zaun-client/variables/applicationcommandtype/)
- [ButtonStyle](/docs/reference/js/zaun-client/variables/buttonstyle/)
- [ComponentType](/docs/reference/js/zaun-client/variables/componenttype/)
- [everyoneMention](/docs/reference/js/zaun-client/variables/everyonemention/)
- [InteractionType](/docs/reference/js/zaun-client/variables/interactiontype/)
- [MentionLimits](/docs/reference/js/zaun-client/variables/mentionlimits/)
- [MessageFlags](/docs/reference/js/zaun-client/variables/messageflags/)
- [OptionType](/docs/reference/js/zaun-client/variables/optiontype/)
- [RawAttachmentReader](/docs/reference/js/zaun-client/variables/rawattachmentreader/)
- [TextInputStyle](/docs/reference/js/zaun-client/variables/textinputstyle/)
## Functions
- [inspectPackage](/docs/reference/js/zaun-client/functions/inspectpackage/)
- [memberMention](/docs/reference/js/zaun-client/functions/membermention/)
- [parseMentions](/docs/reference/js/zaun-client/functions/parsementions/)
- [registryKeyId](/docs/reference/js/zaun-client/functions/registrykeyid/)
- [roleMention](/docs/reference/js/zaun-client/functions/rolemention/)
- [userMention](/docs/reference/js/zaun-client/functions/usermention/)
- [verifyCatalog](/docs/reference/js/zaun-client/functions/verifycatalog/)
- [verifyHistory](/docs/reference/js/zaun-client/functions/verifyhistory/)
---
url: https://zaunchat.github.io/docs/reference/js/zaun-client/classes/actionrowbuilder/
---
# ActionRowBuilder
Defined in: [zaun/js/index.d.ts:429](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L429)
## Extends
- `Builder`\<[`ComponentData`](/docs/reference/js/zaun-client/type-aliases/componentdata/)\>
## Constructors
### Constructor
> **new ActionRowBuilder**(`components?`): `ActionRowBuilder`
Defined in: [zaun/js/index.d.ts:430](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L430)
#### Parameters
##### components?
([`ComponentData`](/docs/reference/js/zaun-client/type-aliases/componentdata/) \| \{ `toJSON`(): [`ComponentData`](/docs/reference/js/zaun-client/type-aliases/componentdata/); \})[]
#### Returns
`ActionRowBuilder`
#### Overrides
`Builder.constructor`
## Properties
### data
> **data**: [`ComponentData`](/docs/reference/js/zaun-client/type-aliases/componentdata/)
Defined in: [zaun/js/index.d.ts:410](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L410)
#### Inherited from
`Builder.data`
## Methods
### addComponents()
> **addComponents**(...`components`): `this`
Defined in: [zaun/js/index.d.ts:431](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L431)
#### Parameters
##### components
...([`ComponentData`](/docs/reference/js/zaun-client/type-aliases/componentdata/) \| \{ `toJSON`(): [`ComponentData`](/docs/reference/js/zaun-client/type-aliases/componentdata/); \})[]
#### Returns
`this`
***
### toJSON()
> **toJSON**(): [`ComponentData`](/docs/reference/js/zaun-client/type-aliases/componentdata/)
Defined in: [zaun/js/index.d.ts:411](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L411)
#### Returns
[`ComponentData`](/docs/reference/js/zaun-client/type-aliases/componentdata/)
#### Inherited from
`Builder.toJSON`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-client/classes/attachment/
---
# Attachment
Defined in: [zaun/js/index.d.ts:693](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L693)
## Constructors
### Constructor
> **new Attachment**(): `Attachment`
#### Returns
`Attachment`
## Properties
### contentType
> `readonly` **contentType**: `string`
Defined in: [zaun/js/index.d.ts:698](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L698)
***
### id
> `readonly` **id**: `string`
Defined in: [zaun/js/index.d.ts:695](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L695)
***
### message
> `readonly` **message**: [`Message`](/docs/reference/js/zaun-client/classes/message/)
Defined in: [zaun/js/index.d.ts:694](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L694)
***
### name
> `readonly` **name**: `string`
Defined in: [zaun/js/index.d.ts:696](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L696)
***
### size
> `readonly` **size**: `number`
Defined in: [zaun/js/index.d.ts:697](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L697)
## Methods
### download()
> **download**(): `Promise`\<`Uint8Array`\<`ArrayBufferLike`\>\>
Defined in: [zaun/js/index.d.ts:700](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L700)
The bytes, checked against the attachment's size and SHA3-256.
#### Returns
`Promise`\<`Uint8Array`\<`ArrayBufferLike`\>\>
***
### open()
> **open**(): `Promise`\<[`AttachmentReader`](/docs/reference/js/zaun-client/classes/attachmentreader/)\>
Defined in: [zaun/js/index.d.ts:703](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L703)
The file to read while it downloads, once its first chunk is here and the file's length
is the attachment's. The host's download permission and limits apply as for `download`.
#### Returns
`Promise`\<[`AttachmentReader`](/docs/reference/js/zaun-client/classes/attachmentreader/)\>
---
url: https://zaunchat.github.io/docs/reference/js/zaun-client/classes/attachmentreader/
---
# AttachmentReader
Defined in: [zaun/js/index.d.ts:710](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L710)
An attachment read while it downloads. Every byte a read gives is plaintext of a chunk
whose SHA-256 the file's description (sent by the host over the post-quantum connection)
named. The attachment's own SHA3-256, and XFTP's whole-file digest and tag, are checked
once every chunk was read in order: `verified()`.
## Constructors
### Constructor
> **new AttachmentReader**(): `AttachmentReader`
#### Returns
`AttachmentReader`
## Properties
### attachment
> `readonly` **attachment**: [`Attachment`](/docs/reference/js/zaun-client/classes/attachment/)
Defined in: [zaun/js/index.d.ts:711](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L711)
***
### raw
> `readonly` **raw**: `RawAttachmentReader`
Defined in: [zaun/js/index.d.ts:712](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L712)
***
### size
> `readonly` **size**: `number`
Defined in: [zaun/js/index.d.ts:714](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L714)
The attachment's size in bytes.
## Methods
### close()
> **close**(): `void`
Defined in: [zaun/js/index.d.ts:726](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L726)
Stops the download; waiting and later reads reject with `closed`.
#### Returns
`void`
***
### progress()
> **progress**(): `object`
Defined in: [zaun/js/index.d.ts:724](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L724)
Encrypted bytes fetched so far (again after an eviction) and of the whole file.
#### Returns
`object`
##### fetched
> **fetched**: `number`
##### total
> **total**: `number`
***
### read()
> **read**(`offset`, `length`, `signal?`): `Promise`\<`Uint8Array`\<`ArrayBufferLike`\>\>
Defined in: [zaun/js/index.d.ts:718](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L718)
Up to `length` bytes from `offset`: fewer when the range runs past what is downloaded,
none at the end. Waits for the first chunk the range needs. `signal` gives it up
(`aborted`); a failed check rejects with `mismatch`, a closed reader with `closed`.
#### Parameters
##### offset
`number`
##### length
`number`
##### signal?
`AbortSignal`
#### Returns
`Promise`\<`Uint8Array`\<`ArrayBufferLike`\>\>
***
### verified()
> **verified**(): `Promise`\<`void`\>
Defined in: [zaun/js/index.d.ts:722](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L722)
Resolves once every chunk went through the whole-file checks and the file's size and
SHA3-256 are the attachment's; rejects with `mismatch` (and fails every read after) when
not, or with why the download stopped.
#### Returns
`Promise`\<`void`\>
---
url: https://zaunchat.github.io/docs/reference/js/zaun-client/classes/buttonbuilder/
---
# ButtonBuilder
Defined in: [zaun/js/index.d.ts:413](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L413)
## Extends
- `Builder`\<[`ComponentData`](/docs/reference/js/zaun-client/type-aliases/componentdata/)\>
## Constructors
### Constructor
> **new ButtonBuilder**(`data?`): `ButtonBuilder`
Defined in: [zaun/js/index.d.ts:414](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L414)
#### Parameters
##### data?
`object`
#### Returns
`ButtonBuilder`
#### Overrides
`Builder.constructor`
## Properties
### data
> **data**: [`ComponentData`](/docs/reference/js/zaun-client/type-aliases/componentdata/)
Defined in: [zaun/js/index.d.ts:410](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L410)
#### Inherited from
`Builder.data`
## Methods
### setCustomId()
> **setCustomId**(`id`): `this`
Defined in: [zaun/js/index.d.ts:418](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L418)
#### Parameters
##### id
`string`
#### Returns
`this`
***
### setDisabled()
> **setDisabled**(`disabled?`): `this`
Defined in: [zaun/js/index.d.ts:420](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L420)
#### Parameters
##### disabled?
`boolean`
#### Returns
`this`
***
### setEmoji()
> **setEmoji**(`emoji`): `this`
Defined in: [zaun/js/index.d.ts:417](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L417)
#### Parameters
##### emoji
`string`
#### Returns
`this`
***
### setLabel()
> **setLabel**(`label`): `this`
Defined in: [zaun/js/index.d.ts:416](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L416)
#### Parameters
##### label
`string`
#### Returns
`this`
***
### setStyle()
> **setStyle**(`style`): `this`
Defined in: [zaun/js/index.d.ts:415](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L415)
#### Parameters
##### style
`number`
#### Returns
`this`
***
### setURL()
> **setURL**(`url`): `this`
Defined in: [zaun/js/index.d.ts:419](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L419)
#### Parameters
##### url
`string`
#### Returns
`this`
***
### toJSON()
> **toJSON**(): [`ComponentData`](/docs/reference/js/zaun-client/type-aliases/componentdata/)
Defined in: [zaun/js/index.d.ts:411](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L411)
#### Returns
[`ComponentData`](/docs/reference/js/zaun-client/type-aliases/componentdata/)
#### Inherited from
`Builder.toJSON`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-client/classes/channel/
---
# Channel
Defined in: [zaun/js/index.d.ts:646](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L646)
## Constructors
### Constructor
> **new Channel**(): `Channel`
#### Returns
`Channel`
## Properties
### client
> `readonly` **client**: [`Client`](/docs/reference/js/zaun-client/classes/client/)
Defined in: [zaun/js/index.d.ts:647](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L647)
***
### community
> `readonly` **community**: [`Community`](/docs/reference/js/zaun-client/classes/community/)
Defined in: [zaun/js/index.d.ts:648](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L648)
***
### data
> `readonly` **data**: `any`
Defined in: [zaun/js/index.d.ts:658](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L658)
***
### id
> `readonly` **id**: `string`
Defined in: [zaun/js/index.d.ts:649](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L649)
***
### isDM
> `readonly` **isDM**: `boolean`
Defined in: [zaun/js/index.d.ts:686](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L686)
DM: a direct message, not a community channel.
***
### members
> `readonly` **members**: [`Collection`](/docs/reference/js/zaun-client/classes/collection/)\<`string`, [`Member`](/docs/reference/js/zaun-client/classes/member/)\>
Defined in: [zaun/js/index.d.ts:656](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L656)
Who is in this voice channel now.
***
### messages
> `readonly` **messages**: `object`
Defined in: [zaun/js/index.d.ts:657](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L657)
#### fetch()
> **fetch**(`options?`): `Promise`\<[`Collection`](/docs/reference/js/zaun-client/classes/collection/)\<`string`, [`Message`](/docs/reference/js/zaun-client/classes/message/)\>\>
##### Parameters
###### options?
###### before?
`number`
###### limit?
`number`
##### Returns
`Promise`\<[`Collection`](/docs/reference/js/zaun-client/classes/collection/)\<`string`, [`Message`](/docs/reference/js/zaun-client/classes/message/)\>\>
***
### name
> `readonly` **name**: `string`
Defined in: [zaun/js/index.d.ts:650](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L650)
***
### parent
> `readonly` **parent**: `Channel`
Defined in: [zaun/js/index.d.ts:654](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L654)
***
### position
> `readonly` **position**: `number`
Defined in: [zaun/js/index.d.ts:653](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L653)
***
### recipient
> `readonly` **recipient**: [`Member`](/docs/reference/js/zaun-client/classes/member/)
Defined in: [zaun/js/index.d.ts:688](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L688)
DM: the other participant of a direct message, or null.
***
### topic
> `readonly` **topic**: `string`
Defined in: [zaun/js/index.d.ts:652](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L652)
***
### type
> `readonly` **type**: `"text"` \| `"announcement"` \| `"voice"` \| `"category"` \| `"forum"` \| `"stage"`
Defined in: [zaun/js/index.d.ts:651](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L651)
***
### typing
> `readonly` **typing**: \{ `kind`: `"named"`; `member_ids`: `string`[]; \} \| \{ `count`: `1` \| `2` \| `3`; `kind`: `"anonymous"`; \}
Defined in: [zaun/js/index.d.ts:662](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L662)
Who else is typing now, or `null`; anonymous channels give only a count (3 = three or more).
***
### typingMode
> `readonly` **typingMode**: `"named"` \| `"anonymous"` \| `"off"`
Defined in: [zaun/js/index.d.ts:660](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L660)
Who sees typing here.
## Methods
### autocomplete()
> **autocomplete**(`command`, `options`): `Promise`\<`string`\>
Defined in: [zaun/js/index.d.ts:678](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L678)
Asks for suggestions for the option marked `focused`; they come as `autocomplete`.
#### Parameters
##### command
`string` \| [`ApplicationCommandData`](/docs/reference/js/zaun-client/interfaces/applicationcommanddata/)
##### options
[`OptionValueData`](/docs/reference/js/zaun-client/interfaces/optionvaluedata/)[]
#### Returns
`Promise`\<`string`\>
***
### click()
> **click**(`message`, `customId`, `values?`): `Promise`\<`string`\>
Defined in: [zaun/js/index.d.ts:676](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L676)
Clicks a button, or chooses `values` in a select, of bot message `message` (its id).
#### Parameters
##### message
`string`
##### customId
`string`
##### values?
`string`[]
#### Returns
`Promise`\<`string`\>
***
### closeDm()
> **closeDm**(): `Promise`\<`void`\>
Defined in: [zaun/js/index.d.ts:690](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L690)
DM: closes a direct message for this member.
#### Returns
`Promise`\<`void`\>
***
### delete()
> **delete**(): `Promise`\<`void`\>
Defined in: [zaun/js/index.d.ts:684](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L684)
#### Returns
`Promise`\<`void`\>
***
### invokeCommand()
> **invokeCommand**(`command`, `options?`, `target?`): `Promise`\<`string`\>
Defined in: [zaun/js/index.d.ts:674](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L674)
Runs a bot command here: a command object, its id, or a slash command's name (`"help"`,
looked up in `community.commands`; rejects when no bot or several have it). Resolves with
the interaction id (answers come as events).
#### Parameters
##### command
`string` \| [`ApplicationCommandData`](/docs/reference/js/zaun-client/interfaces/applicationcommanddata/)
##### options?
[`OptionValueData`](/docs/reference/js/zaun-client/interfaces/optionvaluedata/)[]
##### target?
`string`
#### Returns
`Promise`\<`string`\>
***
### isCategory()
> **isCategory**(): `boolean`
Defined in: [zaun/js/index.d.ts:669](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L669)
#### Returns
`boolean`
***
### isText()
> **isText**(): `boolean`
Defined in: [zaun/js/index.d.ts:667](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L667)
#### Returns
`boolean`
***
### isVoice()
> **isVoice**(): `boolean`
Defined in: [zaun/js/index.d.ts:668](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L668)
#### Returns
`boolean`
***
### join()
> **join**(`options?`): `Promise`\<[`VoiceConnection`](/docs/reference/js/zaun-client/classes/voiceconnection/)\>
Defined in: [zaun/js/index.d.ts:683](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L683)
Joins this voice channel (browsers with WebRTC only). Relayed through the host's TURN
server unless `allowDirect`, and sealed end to end.
#### Parameters
##### options?
###### allowDirect?
`boolean`
###### selfDeaf?
`boolean`
###### selfMute?
`boolean`
###### track?
`MediaStreamTrack`
#### Returns
`Promise`\<[`VoiceConnection`](/docs/reference/js/zaun-client/classes/voiceconnection/)\>
***
### send()
> **send**(`options`): `Promise`\<[`Message`](/docs/reference/js/zaun-client/classes/message/)\>
Defined in: [zaun/js/index.d.ts:670](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L670)
#### Parameters
##### options
[`MessageOptions`](/docs/reference/js/zaun-client/type-aliases/messageoptions/)
#### Returns
`Promise`\<[`Message`](/docs/reference/js/zaun-client/classes/message/)\>
***
### setTypingMode()
> **setTypingMode**(`mode`): `Promise`\<`void`\>
Defined in: [zaun/js/index.d.ts:666](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L666)
typing: sets who sees typing here (`MANAGE_CHANNELS`).
#### Parameters
##### mode
`"named"` \| `"anonymous"` \| `"off"`
#### Returns
`Promise`\<`void`\>
***
### startTyping()
> **startTyping**(): `boolean`
Defined in: [zaun/js/index.d.ts:664](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L664)
Says this member is typing; `false` (nothing sent) where typing is `off`.
#### Returns
`boolean`
***
### submitModal()
> **submitModal**(`modal`, `customId`, `components`): `Promise`\<`string`\>
Defined in: [zaun/js/index.d.ts:680](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L680)
Submits a modal from `modalOpen` (its `interaction` is `modal`).
#### Parameters
##### modal
`string`
##### customId
`string`
##### components
`object`[]
#### Returns
`Promise`\<`string`\>
---
url: https://zaunchat.github.io/docs/reference/js/zaun-client/classes/client/
---
# Client
Defined in: [zaun/js/index.d.ts:938](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L938)
## Constructors
### Constructor
> **new Client**(): `Client`
#### Returns
`Client`
## Properties
### communities
> `readonly` **communities**: [`Collection`](/docs/reference/js/zaun-client/classes/collection/)\<`string`, [`Community`](/docs/reference/js/zaun-client/classes/community/)\>
Defined in: [zaun/js/index.d.ts:944](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L944)
***
### raw
> `readonly` **raw**: [`RawClient`](/docs/reference/js/zaun-client/classes/rawclient/)
Defined in: [zaun/js/index.d.ts:942](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L942)
***
### saved
> `readonly` **saved**: [`Collection`](/docs/reference/js/zaun-client/classes/collection/)\<`string`, [`Community`](/docs/reference/js/zaun-client/classes/community/)\>
Defined in: [zaun/js/index.d.ts:946](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L946)
The communities kept in the store, known as soon as `start` resolves.
***
### simplex
> `readonly` **simplex**: [`SimplexClient`](/docs/reference/js/zaun-client/classes/simplexclient/)
Defined in: [zaun/js/index.d.ts:943](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L943)
## Methods
### close()
> **close**(): `Promise`\<`void`\>
Defined in: [zaun/js/index.d.ts:955](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L955)
#### Returns
`Promise`\<`void`\>
***
### community()
> **community**(`id`): [`Community`](/docs/reference/js/zaun-client/classes/community/)
Defined in: [zaun/js/index.d.ts:947](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L947)
#### Parameters
##### id
`string`
#### Returns
[`Community`](/docs/reference/js/zaun-client/classes/community/)
***
### createCommunity()
> **createCommunity**(`options`): `Promise`\<[`Community`](/docs/reference/js/zaun-client/classes/community/)\>
Defined in: [zaun/js/index.d.ts:949](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L949)
#### Parameters
##### options
###### displayName?
`string`
###### host
`string`
###### hostKey
`string`
###### name
`string`
#### Returns
`Promise`\<[`Community`](/docs/reference/js/zaun-client/classes/community/)\>
***
### join()
> **join**(`invite`, `displayName?`): `Promise`\<[`Community`](/docs/reference/js/zaun-client/classes/community/)\>
Defined in: [zaun/js/index.d.ts:948](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L948)
#### Parameters
##### invite
`string`
##### displayName?
`string`
#### Returns
`Promise`\<[`Community`](/docs/reference/js/zaun-client/classes/community/)\>
***
### off()
> **off**\<`E`\>(`name`, `f`): `this`
Defined in: [zaun/js/index.d.ts:952](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L952)
#### Type Parameters
##### E
`E` *extends* keyof [`ClientEvents`](/docs/reference/js/zaun-client/interfaces/clientevents/)
#### Parameters
##### name
`E`
##### f
(...`args`) => `void`
#### Returns
`this`
***
### on()
> **on**\<`E`\>(`name`, `f`): `this`
Defined in: [zaun/js/index.d.ts:950](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L950)
#### Type Parameters
##### E
`E` *extends* keyof [`ClientEvents`](/docs/reference/js/zaun-client/interfaces/clientevents/)
#### Parameters
##### name
`E`
##### f
(...`args`) => `void`
#### Returns
`this`
***
### once()
> **once**\<`E`\>(`name`, `f?`): `Promise`\<[`ClientEvents`](/docs/reference/js/zaun-client/interfaces/clientevents/)\[`E`\]\[`0`\]\>
Defined in: [zaun/js/index.d.ts:951](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L951)
#### Type Parameters
##### E
`E` *extends* keyof [`ClientEvents`](/docs/reference/js/zaun-client/interfaces/clientevents/)
#### Parameters
##### name
`E`
##### f?
(...`args`) => `void`
#### Returns
`Promise`\<[`ClientEvents`](/docs/reference/js/zaun-client/interfaces/clientevents/)\[`E`\]\[`0`\]\>
***
### save()
> **save**(): `Uint8Array`
Defined in: [zaun/js/index.d.ts:953](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L953)
#### Returns
`Uint8Array`
***
### saveChanges()
> **saveChanges**(): `Uint8Array`
Defined in: [zaun/js/index.d.ts:954](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L954)
#### Returns
`Uint8Array`
***
### setPresence()
> **setPresence**(`status`, `activity?`): `boolean`
Defined in: [zaun/js/index.d.ts:941](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L941)
presence: status and activity in every community; `false` when either is not valid.
#### Parameters
##### status
`"online"` \| `"idle"` \| `"dnd"` \| `"invisible"`
##### activity?
[`Activity`](/docs/reference/js/zaun-client/interfaces/activity/)
#### Returns
`boolean`
***
### start()
> `static` **start**(`options`): `Promise`\<`Client`\>
Defined in: [zaun/js/index.d.ts:939](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L939)
#### Parameters
##### options
[`StartOptions`](/docs/reference/js/zaun-client/interfaces/startoptions/)
#### Returns
`Promise`\<`Client`\>
---
url: https://zaunchat.github.io/docs/reference/js/zaun-client/classes/collection/
---
# Collection
Defined in: [zaun/js/index.d.ts:52](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L52)
## Extends
- `Map`\<`K`, `V`\>
## Type Parameters
### K
`K`
### V
`V`
## Constructors
### Constructor
> **new Collection**\<`K`, `V`\>(`entries?`): `Collection`\<`K`, `V`\>
Defined in: ../../../node\_modules/typescript/lib/lib.es2015.collection.d.ts:50
#### Parameters
##### entries?
readonly (readonly \[`K`, `V`\])[]
#### Returns
`Collection`\<`K`, `V`\>
#### Inherited from
`Map.constructor`
### Constructor
> **new Collection**\<`K`, `V`\>(`iterable?`): `Collection`\<`K`, `V`\>
Defined in: ../../../node\_modules/typescript/lib/lib.es2015.collection.d.ts:49
#### Parameters
##### iterable?
`Iterable`\
#### Returns
`Collection`\<`K`, `V`\>
#### Inherited from
`Map.constructor`
## Methods
### every()
> **every**(`f`): `boolean`
Defined in: [zaun/js/index.d.ts:57](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L57)
#### Parameters
##### f
(`v`, `k`, `c`) => `boolean`
#### Returns
`boolean`
***
### filter()
> **filter**(`f`): `Collection`\<`K`, `V`\>
Defined in: [zaun/js/index.d.ts:54](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L54)
#### Parameters
##### f
(`v`, `k`, `c`) => `boolean`
#### Returns
`Collection`\<`K`, `V`\>
***
### find()
> **find**(`f`): `V`
Defined in: [zaun/js/index.d.ts:53](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L53)
#### Parameters
##### f
(`v`, `k`, `c`) => `boolean`
#### Returns
`V`
***
### first()
> **first**(): `V`
Defined in: [zaun/js/index.d.ts:58](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L58)
#### Returns
`V`
***
### map()
> **map**\<`T`\>(`f`): `T`[]
Defined in: [zaun/js/index.d.ts:55](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L55)
#### Type Parameters
##### T
`T`
#### Parameters
##### f
(`v`, `k`, `c`) => `T`
#### Returns
`T`[]
***
### some()
> **some**(`f`): `boolean`
Defined in: [zaun/js/index.d.ts:56](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L56)
#### Parameters
##### f
(`v`, `k`, `c`) => `boolean`
#### Returns
`boolean`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-client/classes/commandbuilder/
---
# CommandBuilder
Defined in: [zaun/js/index.d.ts:456](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L456)
## Extends
- `Builder`\<[`ApplicationCommandData`](/docs/reference/js/zaun-client/interfaces/applicationcommanddata/)\>
## Constructors
### Constructor
> **new CommandBuilder**(`data?`): `CommandBuilder`
Defined in: [zaun/js/index.d.ts:457](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L457)
#### Parameters
##### data?
`object`
#### Returns
`CommandBuilder`
#### Overrides
`Builder.constructor`
## Properties
### data
> **data**: [`ApplicationCommandData`](/docs/reference/js/zaun-client/interfaces/applicationcommanddata/)
Defined in: [zaun/js/index.d.ts:410](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L410)
#### Inherited from
`Builder.data`
## Methods
### addOption()
> **addOption**(`option`): `this`
Defined in: [zaun/js/index.d.ts:462](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L462)
#### Parameters
##### option
[`CommandOptionData`](/docs/reference/js/zaun-client/interfaces/commandoptiondata/) \| \{ `toJSON`(): [`CommandOptionData`](/docs/reference/js/zaun-client/interfaces/commandoptiondata/); \}
#### Returns
`this`
***
### setDefaultMemberPermissions()
> **setDefaultMemberPermissions**(`bits`): `this`
Defined in: [zaun/js/index.d.ts:461](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L461)
#### Parameters
##### bits
`string` \| `bigint`
#### Returns
`this`
***
### setDescription()
> **setDescription**(`text`): `this`
Defined in: [zaun/js/index.d.ts:459](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L459)
#### Parameters
##### text
`string`
#### Returns
`this`
***
### setName()
> **setName**(`name`): `this`
Defined in: [zaun/js/index.d.ts:458](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L458)
#### Parameters
##### name
`string`
#### Returns
`this`
***
### setType()
> **setType**(`type`): `this`
Defined in: [zaun/js/index.d.ts:460](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L460)
#### Parameters
##### type
`number`
#### Returns
`this`
***
### toJSON()
> **toJSON**(): [`ApplicationCommandData`](/docs/reference/js/zaun-client/interfaces/applicationcommanddata/)
Defined in: [zaun/js/index.d.ts:411](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L411)
#### Returns
[`ApplicationCommandData`](/docs/reference/js/zaun-client/interfaces/applicationcommanddata/)
#### Inherited from
`Builder.toJSON`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-client/classes/community/
---
# Community
Defined in: [zaun/js/index.d.ts:81](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L81)
## Constructors
### Constructor
> **new Community**(): `Community`
#### Returns
`Community`
## Properties
### bots
> `readonly` **bots**: [`Collection`](/docs/reference/js/zaun-client/classes/collection/)\<`string`, [`BotCard`](/docs/reference/js/zaun-client/interfaces/botcard/)\>
Defined in: [zaun/js/index.d.ts:108](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L108)
Installed bots' public cards, as last heard.
***
### channels
> `readonly` **channels**: [`Collection`](/docs/reference/js/zaun-client/classes/collection/)\<`string`, [`Channel`](/docs/reference/js/zaun-client/classes/channel/)\> & `object`
Defined in: [zaun/js/index.d.ts:88](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L88)
#### Type Declaration
##### create()
> **create**(`name`, `options?`): `Promise`\<[`Channel`](/docs/reference/js/zaun-client/classes/channel/)\>
###### Parameters
###### name
`string`
###### options?
###### parent?
`string` \| [`Channel`](/docs/reference/js/zaun-client/classes/channel/)
###### type?
`"text"` \| `"announcement"` \| `"voice"` \| `"category"`
###### Returns
`Promise`\<[`Channel`](/docs/reference/js/zaun-client/classes/channel/)\>
***
### client
> `readonly` **client**: [`Client`](/docs/reference/js/zaun-client/classes/client/)
Defined in: [zaun/js/index.d.ts:82](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L82)
***
### commands
> `readonly` **commands**: [`Collection`](/docs/reference/js/zaun-client/classes/collection/)\<`string`, [`ApplicationCommandData`](/docs/reference/js/zaun-client/interfaces/applicationcommanddata/)\>
Defined in: [zaun/js/index.d.ts:106](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L106)
Bot commands in this community, as last heard (each with its `bot_id`).
***
### data
> `readonly` **data**: `any`
Defined in: [zaun/js/index.d.ts:96](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L96)
The cache as plain data.
***
### description
> `readonly` **description**: `string`
Defined in: [zaun/js/index.d.ts:85](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L85)
***
### dms
> `readonly` **dms**: [`Channel`](/docs/reference/js/zaun-client/classes/channel/)[]
Defined in: [zaun/js/index.d.ts:137](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L137)
DM: this member's open direct messages with bots, from the cache.
***
### id
> `readonly` **id**: `string`
Defined in: [zaun/js/index.d.ts:83](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L83)
***
### isOwner
> `readonly` **isOwner**: `boolean`
Defined in: [zaun/js/index.d.ts:86](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L86)
***
### me
> `readonly` **me**: [`Member`](/docs/reference/js/zaun-client/classes/member/)
Defined in: [zaun/js/index.d.ts:87](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L87)
***
### members
> `readonly` **members**: [`Collection`](/docs/reference/js/zaun-client/classes/collection/)\<`string`, [`Member`](/docs/reference/js/zaun-client/classes/member/)\> & `object`
Defined in: [zaun/js/index.d.ts:94](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L94)
#### Type Declaration
##### fetch()
> **fetch**(): `Promise`\<[`Collection`](/docs/reference/js/zaun-client/classes/collection/)\<`string`, [`Member`](/docs/reference/js/zaun-client/classes/member/)\>\>
###### Returns
`Promise`\<[`Collection`](/docs/reference/js/zaun-client/classes/collection/)\<`string`, [`Member`](/docs/reference/js/zaun-client/classes/member/)\>\>
***
### name
> `readonly` **name**: `string`
Defined in: [zaun/js/index.d.ts:84](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L84)
***
### presences
> `readonly` **presences**: ([`Presence`](/docs/reference/js/zaun-client/interfaces/presence/) & `object`)[]
Defined in: [zaun/js/index.d.ts:113](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L113)
presence: every member not offline.
***
### roles
> `readonly` **roles**: [`Collection`](/docs/reference/js/zaun-client/classes/collection/)\<`string`, [`Role`](/docs/reference/js/zaun-client/classes/role/)\> & `object`
Defined in: [zaun/js/index.d.ts:91](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L91)
#### Type Declaration
##### create()
> **create**(`name`, `options?`): `Promise`\<[`Role`](/docs/reference/js/zaun-client/classes/role/)\>
###### Parameters
###### name
`string`
###### options?
###### permissions?
[`PermissionResolvable`](/docs/reference/js/zaun-client/type-aliases/permissionresolvable/)
###### Returns
`Promise`\<[`Role`](/docs/reference/js/zaun-client/classes/role/)\>
## Methods
### bot()
> **bot**(`botId`): `Promise`\<[`BotCard`](/docs/reference/js/zaun-client/interfaces/botcard/)\>
Defined in: [zaun/js/index.d.ts:110](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L110)
#### Parameters
##### botId
`string`
#### Returns
`Promise`\<[`BotCard`](/docs/reference/js/zaun-client/interfaces/botcard/)\>
***
### botConfig()
> **botConfig**(`bot`): `Promise`\<`Record`\<`string`, `string`\>\>
Defined in: [zaun/js/index.d.ts:131](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L131)
Owner only: the values set for a bot's settings (secrets as `"••••"`); a key not
there uses its card's `default`.
#### Parameters
##### bot
`string` \| [`BotCard`](/docs/reference/js/zaun-client/interfaces/botcard/)
#### Returns
`Promise`\<`Record`\<`string`, `string`\>\>
***
### channel()
> **channel**(`id`): [`Channel`](/docs/reference/js/zaun-client/classes/channel/)
Defined in: [zaun/js/index.d.ts:97](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L97)
#### Parameters
##### id
`string`
#### Returns
[`Channel`](/docs/reference/js/zaun-client/classes/channel/)
***
### configureBot()
> **configureBot**(`bot`, `values`): `Promise`\<`Record`\<`string`, `string`\>\>
Defined in: [zaun/js/index.d.ts:128](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L128)
Owner only: sets or clears (`null`: back to the card's `default`) the values of the
settings a bot declares (`BotCard.config`); resolves with every value the owner has set,
a secret one as `"••••"` (write-only). Rejects with `FORBIDDEN` (not the owner),
`NOT_FOUND`, or `BAD_REQUEST` for a key the bot does not declare. zaun-host 0.4.0.
#### Parameters
##### bot
`string` \| [`BotCard`](/docs/reference/js/zaun-client/interfaces/botcard/)
##### values
`Record`\<`string`, `string` \| `null`\>
#### Returns
`Promise`\<`Record`\<`string`, `string`\>\>
***
### createInvite()
> **createInvite**(`options?`): `Promise`\<`string`\>
Defined in: [zaun/js/index.d.ts:100](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L100)
#### Parameters
##### options?
###### expiresIn?
`number`
###### maxUses?
`number`
#### Returns
`Promise`\<`string`\>
***
### disableBot()
> **disableBot**(`botId`): `Promise`\<[`BotCard`](/docs/reference/js/zaun-client/interfaces/botcard/)\>
Defined in: [zaun/js/index.d.ts:122](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L122)
#### Parameters
##### botId
`string`
#### Returns
`Promise`\<[`BotCard`](/docs/reference/js/zaun-client/interfaces/botcard/)\>
***
### dmSettings()
> **dmSettings**(): `Promise`\<[`DmSettings`](/docs/reference/js/zaun-client/interfaces/dmsettings/)\>
Defined in: [zaun/js/index.d.ts:141](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L141)
DM: whether bots may open DMs with this member.
#### Returns
`Promise`\<[`DmSettings`](/docs/reference/js/zaun-client/interfaces/dmsettings/)\>
***
### enableBot()
> **enableBot**(`botId`): `Promise`\<[`BotCard`](/docs/reference/js/zaun-client/interfaces/botcard/)\>
Defined in: [zaun/js/index.d.ts:121](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L121)
#### Parameters
##### botId
`string`
#### Returns
`Promise`\<[`BotCard`](/docs/reference/js/zaun-client/interfaces/botcard/)\>
***
### fetchBots()
> **fetchBots**(): `Promise`\<[`BotCard`](/docs/reference/js/zaun-client/interfaces/botcard/)[]\>
Defined in: [zaun/js/index.d.ts:109](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L109)
#### Returns
`Promise`\<[`BotCard`](/docs/reference/js/zaun-client/interfaces/botcard/)[]\>
***
### fetchDms()
> **fetchDms**(): `Promise`\<[`Channel`](/docs/reference/js/zaun-client/classes/channel/)[]\>
Defined in: [zaun/js/index.d.ts:139](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L139)
DM: reloads the open DMs from the host.
#### Returns
`Promise`\<[`Channel`](/docs/reference/js/zaun-client/classes/channel/)[]\>
***
### grantBot()
> **grantBot**(`botId`, `grants`): `Promise`\<[`BotCard`](/docs/reference/js/zaun-client/interfaces/botcard/)\>
Defined in: [zaun/js/index.d.ts:120](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L120)
#### Parameters
##### botId
`string`
##### grants
###### capabilities?
[`BotCapabilities`](/docs/reference/js/zaun-client/interfaces/botcapabilities/)
###### permissions?
[`PermissionResolvable`](/docs/reference/js/zaun-client/type-aliases/permissionresolvable/)
#### Returns
`Promise`\<[`BotCard`](/docs/reference/js/zaun-client/interfaces/botcard/)\>
***
### installBot()
> **installBot**(`pkg`, `options?`): `Promise`\<[`BotCard`](/docs/reference/js/zaun-client/interfaces/botcard/)\>
Defined in: [zaun/js/index.d.ts:118](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L118)
Owner only: installs the `.zbot` uploaded as attachment `pkg`, with the registry `source`
it was verified against, if any.
#### Parameters
##### pkg
`string`
##### options?
###### grants?
\{ `capabilities?`: [`BotCapabilities`](/docs/reference/js/zaun-client/interfaces/botcapabilities/); `permissions?`: `string`; \}
###### grants.capabilities?
[`BotCapabilities`](/docs/reference/js/zaun-client/interfaces/botcapabilities/)
###### grants.permissions?
`string`
###### rolePosition?
`number`
###### source?
[`InstallSource`](/docs/reference/js/zaun-client/interfaces/installsource/)
#### Returns
`Promise`\<[`BotCard`](/docs/reference/js/zaun-client/interfaces/botcard/)\>
***
### leave()
> **leave**(): `Promise`\<`void`\>
Defined in: [zaun/js/index.d.ts:104](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L104)
Leaves (the owner cannot). Once the host accepts, the community is forgotten here: its
state and member key leave the store, `communityDelete` follows with `{ t: "left" }`, and
a later join of it from the same store starts afresh.
#### Returns
`Promise`\<`void`\>
***
### member()
> **member**(`id`): [`Member`](/docs/reference/js/zaun-client/classes/member/)
Defined in: [zaun/js/index.d.ts:98](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L98)
#### Parameters
##### id
`string`
#### Returns
[`Member`](/docs/reference/js/zaun-client/classes/member/)
***
### registerBot()
> **registerBot**(`member`, `name?`): `Promise`\<[`BotCard`](/docs/reference/js/zaun-client/interfaces/botcard/)\>
Defined in: [zaun/js/index.d.ts:133](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L133)
Owner only: marks a member connected over SimpleX as an external bot.
#### Parameters
##### member
`string` \| [`Member`](/docs/reference/js/zaun-client/classes/member/)
##### name?
`string`
#### Returns
`Promise`\<[`BotCard`](/docs/reference/js/zaun-client/interfaces/botcard/)\>
***
### removeBot()
> **removeBot**(`botId`, `options?`): `Promise`\<`void`\>
Defined in: [zaun/js/index.d.ts:123](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L123)
#### Parameters
##### botId
`string`
##### options?
###### keepData?
`boolean`
#### Returns
`Promise`\<`void`\>
***
### role()
> **role**(`id`): [`Role`](/docs/reference/js/zaun-client/classes/role/)
Defined in: [zaun/js/index.d.ts:99](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L99)
#### Parameters
##### id
`string`
#### Returns
[`Role`](/docs/reference/js/zaun-client/classes/role/)
***
### setCommands()
> **setCommands**(`commands`): `Promise`\<[`ApplicationCommandData`](/docs/reference/js/zaun-client/interfaces/applicationcommanddata/)[]\>
Defined in: [zaun/js/index.d.ts:135](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L135)
As a bot: replaces this bot's commands.
#### Parameters
##### commands
([`ApplicationCommandData`](/docs/reference/js/zaun-client/interfaces/applicationcommanddata/) \| [`CommandBuilder`](/docs/reference/js/zaun-client/classes/commandbuilder/))[]
#### Returns
`Promise`\<[`ApplicationCommandData`](/docs/reference/js/zaun-client/interfaces/applicationcommanddata/)[]\>
***
### setDmsFromBots()
> **setDmsFromBots**(`allow`): `Promise`\<[`DmSettings`](/docs/reference/js/zaun-client/interfaces/dmsettings/)\>
Defined in: [zaun/js/index.d.ts:142](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L142)
#### Parameters
##### allow
`boolean`
#### Returns
`Promise`\<[`DmSettings`](/docs/reference/js/zaun-client/interfaces/dmsettings/)\>
***
### setStatusText()
> **setStatusText**(`text`, `options?`): `Promise`\<`any`\>
Defined in: [zaun/js/index.d.ts:115](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L115)
Sets this member's custom status here; no text and no emoji clears it.
#### Parameters
##### text
`string`
##### options?
###### emoji?
`string`
###### expiresAt?
`number` \| `Date`
#### Returns
`Promise`\<`any`\>
***
### updateBot()
> **updateBot**(`botId`, `pkg`, `options?`): `Promise`\<[`BotCard`](/docs/reference/js/zaun-client/interfaces/botcard/)\>
Defined in: [zaun/js/index.d.ts:119](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L119)
#### Parameters
##### botId
`string`
##### pkg
`string`
##### options?
###### source?
[`InstallSource`](/docs/reference/js/zaun-client/interfaces/installsource/)
#### Returns
`Promise`\<[`BotCard`](/docs/reference/js/zaun-client/interfaces/botcard/)\>
---
url: https://zaunchat.github.io/docs/reference/js/zaun-client/classes/containerbuilder/
---
# ContainerBuilder
Defined in: [zaun/js/index.d.ts:449](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L449)
## Extends
- `Builder`\<[`ComponentData`](/docs/reference/js/zaun-client/type-aliases/componentdata/)\>
## Constructors
### Constructor
> **new ContainerBuilder**(`data?`): `ContainerBuilder`
Defined in: [zaun/js/index.d.ts:450](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L450)
#### Parameters
##### data?
`object`
#### Returns
`ContainerBuilder`
#### Overrides
`Builder.constructor`
## Properties
### data
> **data**: [`ComponentData`](/docs/reference/js/zaun-client/type-aliases/componentdata/)
Defined in: [zaun/js/index.d.ts:410](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L410)
#### Inherited from
`Builder.data`
## Methods
### addComponents()
> **addComponents**(...`components`): `this`
Defined in: [zaun/js/index.d.ts:454](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L454)
#### Parameters
##### components
...([`ComponentData`](/docs/reference/js/zaun-client/type-aliases/componentdata/) \| \{ `toJSON`(): [`ComponentData`](/docs/reference/js/zaun-client/type-aliases/componentdata/); \})[]
#### Returns
`this`
***
### addSeparator()
> **addSeparator**(`spacing?`): `this`
Defined in: [zaun/js/index.d.ts:453](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L453)
#### Parameters
##### spacing?
`1` \| `2`
#### Returns
`this`
***
### addText()
> **addText**(`content`): `this`
Defined in: [zaun/js/index.d.ts:452](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L452)
#### Parameters
##### content
`string`
#### Returns
`this`
***
### setAccentColor()
> **setAccentColor**(`rgb`): `this`
Defined in: [zaun/js/index.d.ts:451](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L451)
#### Parameters
##### rgb
`number`
#### Returns
`this`
***
### toJSON()
> **toJSON**(): [`ComponentData`](/docs/reference/js/zaun-client/type-aliases/componentdata/)
Defined in: [zaun/js/index.d.ts:411](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L411)
#### Returns
[`ComponentData`](/docs/reference/js/zaun-client/type-aliases/componentdata/)
#### Inherited from
`Builder.toJSON`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-client/classes/embed/
---
# Embed
Defined in: [zaun/js/index.d.ts:538](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L538)
An embed on a message, as received. Pictures are the message's attachments (`null` when
the message object does not have them, as on an edit's event; `data` has their ids).
## Constructors
### Constructor
> **new Embed**(): `Embed`
#### Returns
`Embed`
## Properties
### author
> `readonly` **author**: `object`
Defined in: [zaun/js/index.d.ts:548](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L548)
#### icon
> **icon**: [`Attachment`](/docs/reference/js/zaun-client/classes/attachment/)
#### name
> **name**: `string`
#### url
> **url**: `string`
***
### color
> `readonly` **color**: `number`
Defined in: [zaun/js/index.d.ts:544](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L544)
***
### data
> `readonly` **data**: [`EmbedData`](/docs/reference/js/zaun-client/interfaces/embeddata/)
Defined in: [zaun/js/index.d.ts:540](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L540)
***
### description
> `readonly` **description**: `string`
Defined in: [zaun/js/index.d.ts:542](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L542)
***
### fields
> `readonly` **fields**: `object`[]
Defined in: [zaun/js/index.d.ts:547](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L547)
#### inline
> **inline**: `boolean`
#### name
> **name**: `string`
#### value
> **value**: `string`
***
### footer
> `readonly` **footer**: `object`
Defined in: [zaun/js/index.d.ts:549](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L549)
#### icon
> **icon**: [`Attachment`](/docs/reference/js/zaun-client/classes/attachment/)
#### text
> **text**: `string`
***
### hexColor
> `readonly` **hexColor**: `string`
Defined in: [zaun/js/index.d.ts:545](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L545)
***
### image
> `readonly` **image**: [`Attachment`](/docs/reference/js/zaun-client/classes/attachment/)
Defined in: [zaun/js/index.d.ts:550](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L550)
***
### message
> `readonly` **message**: [`Message`](/docs/reference/js/zaun-client/classes/message/)
Defined in: [zaun/js/index.d.ts:539](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L539)
***
### thumbnail
> `readonly` **thumbnail**: [`Attachment`](/docs/reference/js/zaun-client/classes/attachment/)
Defined in: [zaun/js/index.d.ts:551](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L551)
***
### timestamp
> `readonly` **timestamp**: `Date`
Defined in: [zaun/js/index.d.ts:546](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L546)
***
### title
> `readonly` **title**: `string`
Defined in: [zaun/js/index.d.ts:541](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L541)
***
### url
> `readonly` **url**: `string`
Defined in: [zaun/js/index.d.ts:543](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L543)
## Methods
### toJSON()
> **toJSON**(): [`EmbedData`](/docs/reference/js/zaun-client/interfaces/embeddata/)
Defined in: [zaun/js/index.d.ts:552](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L552)
#### Returns
[`EmbedData`](/docs/reference/js/zaun-client/interfaces/embeddata/)
---
url: https://zaunchat.github.io/docs/reference/js/zaun-client/classes/embedbuilder/
---
# EmbedBuilder
Defined in: [zaun/js/index.d.ts:514](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L514)
A rich embed. Up to 10 per message; limits as the protocol's
(title 256, description 4 096, 25 fields, 6 000 characters in all).
## Constructors
### Constructor
> **new EmbedBuilder**(`data?`): `EmbedBuilder`
Defined in: [zaun/js/index.d.ts:515](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L515)
#### Parameters
##### data?
[`EmbedData`](/docs/reference/js/zaun-client/interfaces/embeddata/) \| [`Embed`](/docs/reference/js/zaun-client/classes/embed/)
#### Returns
`EmbedBuilder`
## Properties
### data
> `readonly` **data**: [`EmbedData`](/docs/reference/js/zaun-client/interfaces/embeddata/)
Defined in: [zaun/js/index.d.ts:518](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L518)
The protocol's fields; pictures still to upload are not in it yet.
## Methods
### addFields()
> **addFields**(...`fields`): `this`
Defined in: [zaun/js/index.d.ts:530](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L530)
#### Parameters
##### fields
...([`EmbedFieldData`](/docs/reference/js/zaun-client/interfaces/embedfielddata/) \| [`EmbedFieldData`](/docs/reference/js/zaun-client/interfaces/embedfielddata/)[])[]
#### Returns
`this`
***
### setAuthor()
> **setAuthor**(`author`): `this`
Defined in: [zaun/js/index.d.ts:526](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L526)
#### Parameters
##### author
###### icon?
[`PictureSource`](/docs/reference/js/zaun-client/type-aliases/picturesource/)
###### name
`string`
###### url?
`string`
#### Returns
`this`
***
### setColor()
> **setColor**(`color`): `this`
Defined in: [zaun/js/index.d.ts:523](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L523)
#### Parameters
##### color
`number` \| `` `#${string}` `` \| \[`number`, `number`, `number`\]
#### Returns
`this`
***
### setDescription()
> **setDescription**(`description`): `this`
Defined in: [zaun/js/index.d.ts:520](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L520)
#### Parameters
##### description
`string`
#### Returns
`this`
***
### setFields()
> **setFields**(...`fields`): `this`
Defined in: [zaun/js/index.d.ts:531](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L531)
#### Parameters
##### fields
...([`EmbedFieldData`](/docs/reference/js/zaun-client/interfaces/embedfielddata/) \| [`EmbedFieldData`](/docs/reference/js/zaun-client/interfaces/embedfielddata/)[])[]
#### Returns
`this`
***
### setFooter()
> **setFooter**(`footer`): `this`
Defined in: [zaun/js/index.d.ts:527](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L527)
#### Parameters
##### footer
###### icon?
[`PictureSource`](/docs/reference/js/zaun-client/type-aliases/picturesource/)
###### text
`string`
#### Returns
`this`
***
### setImage()
> **setImage**(`picture`): `this`
Defined in: [zaun/js/index.d.ts:528](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L528)
#### Parameters
##### picture
[`PictureSource`](/docs/reference/js/zaun-client/type-aliases/picturesource/)
#### Returns
`this`
***
### setThumbnail()
> **setThumbnail**(`picture`): `this`
Defined in: [zaun/js/index.d.ts:529](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L529)
#### Parameters
##### picture
[`PictureSource`](/docs/reference/js/zaun-client/type-aliases/picturesource/)
#### Returns
`this`
***
### setTimestamp()
> **setTimestamp**(`time?`): `this`
Defined in: [zaun/js/index.d.ts:525](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L525)
Now when not given.
#### Parameters
##### time?
`number` \| `Date`
#### Returns
`this`
***
### setTitle()
> **setTitle**(`title`): `this`
Defined in: [zaun/js/index.d.ts:519](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L519)
#### Parameters
##### title
`string`
#### Returns
`this`
***
### setURL()
> **setURL**(`url`): `this`
Defined in: [zaun/js/index.d.ts:522](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L522)
`https://` only.
#### Parameters
##### url
`string`
#### Returns
`this`
***
### spliceFields()
> **spliceFields**(`index`, `deleteCount`, ...`fields`): `this`
Defined in: [zaun/js/index.d.ts:532](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L532)
#### Parameters
##### index
`number`
##### deleteCount
`number`
##### fields
...([`EmbedFieldData`](/docs/reference/js/zaun-client/interfaces/embedfielddata/) \| [`EmbedFieldData`](/docs/reference/js/zaun-client/interfaces/embedfielddata/)[])[]
#### Returns
`this`
***
### toJSON()
> **toJSON**(): [`EmbedData`](/docs/reference/js/zaun-client/interfaces/embeddata/)
Defined in: [zaun/js/index.d.ts:533](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L533)
#### Returns
[`EmbedData`](/docs/reference/js/zaun-client/interfaces/embeddata/)
***
### from()
> `static` **from**(`other`): `EmbedBuilder`
Defined in: [zaun/js/index.d.ts:516](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L516)
#### Parameters
##### other
`EmbedBuilder` \| [`EmbedData`](/docs/reference/js/zaun-client/interfaces/embeddata/) \| [`Embed`](/docs/reference/js/zaun-client/classes/embed/)
#### Returns
`EmbedBuilder`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-client/classes/interaction/
---
# Interaction
Defined in: [zaun/js/index.d.ts:374](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L374)
As a bot: someone used one of this bot's commands, components or modals.
## Constructors
### Constructor
> **new Interaction**(): `Interaction`
#### Returns
`Interaction`
## Properties
### channel
> `readonly` **channel**: [`Channel`](/docs/reference/js/zaun-client/classes/channel/)
Defined in: [zaun/js/index.d.ts:379](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L379)
***
### commandName
> `readonly` **commandName**: `string`
Defined in: [zaun/js/index.d.ts:383](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L383)
***
### community
> `readonly` **community**: [`Community`](/docs/reference/js/zaun-client/classes/community/)
Defined in: [zaun/js/index.d.ts:375](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L375)
***
### customId
> `readonly` **customId**: `string`
Defined in: [zaun/js/index.d.ts:385](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L385)
***
### data
> `readonly` **data**: `any`
Defined in: [zaun/js/index.d.ts:382](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L382)
The interaction as the host sent it.
***
### id
> `readonly` **id**: `string`
Defined in: [zaun/js/index.d.ts:376](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L376)
***
### member
> `readonly` **member**: [`Member`](/docs/reference/js/zaun-client/classes/member/)
Defined in: [zaun/js/index.d.ts:380](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L380)
***
### options
> `readonly` **options**: [`OptionValueData`](/docs/reference/js/zaun-client/interfaces/optionvaluedata/)[]
Defined in: [zaun/js/index.d.ts:384](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L384)
***
### type
> `readonly` **type**: `number`
Defined in: [zaun/js/index.d.ts:378](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L378)
InteractionType: 2 command, 3 component, 4 autocomplete, 5 modal submit.
***
### values
> `readonly` **values**: `string`[]
Defined in: [zaun/js/index.d.ts:386](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L386)
## Methods
### autocomplete()
> **autocomplete**(`choices`): `Promise`\<`unknown`\>
Defined in: [zaun/js/index.d.ts:394](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L394)
#### Parameters
##### choices
`object`[]
#### Returns
`Promise`\<`unknown`\>
***
### defer()
> **defer**(`options?`): `Promise`\<\{ `message_id?`: `string`; \}\>
Defined in: [zaun/js/index.d.ts:391](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L391)
#### Parameters
##### options?
###### ephemeral?
`boolean`
#### Returns
`Promise`\<\{ `message_id?`: `string`; \}\>
***
### deferUpdate()
> **deferUpdate**(): `Promise`\<`unknown`\>
Defined in: [zaun/js/index.d.ts:392](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L392)
#### Returns
`Promise`\<`unknown`\>
***
### deleteReply()
> **deleteReply**(): `Promise`\<`void`\>
Defined in: [zaun/js/index.d.ts:398](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L398)
#### Returns
`Promise`\<`void`\>
***
### editReply()
> **editReply**(`options`): `Promise`\<`void`\>
Defined in: [zaun/js/index.d.ts:397](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L397)
#### Parameters
##### options
[`BotMessageOptions`](/docs/reference/js/zaun-client/type-aliases/botmessageoptions/)
#### Returns
`Promise`\<`void`\>
***
### field()
> **field**(`customId`): `string`
Defined in: [zaun/js/index.d.ts:388](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L388)
#### Parameters
##### customId
`string`
#### Returns
`string`
***
### followUp()
> **followUp**(`options`): `Promise`\<\{ `message_id?`: `string`; \}\>
Defined in: [zaun/js/index.d.ts:396](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L396)
#### Parameters
##### options
[`BotMessageOptions`](/docs/reference/js/zaun-client/type-aliases/botmessageoptions/)
#### Returns
`Promise`\<\{ `message_id?`: `string`; \}\>
***
### option()
> **option**(`name`): `string` \| `number` \| `boolean`
Defined in: [zaun/js/index.d.ts:387](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L387)
#### Parameters
##### name
`string`
#### Returns
`string` \| `number` \| `boolean`
***
### reply()
> **reply**(`options`): `Promise`\<\{ `message_id?`: `string`; \}\>
Defined in: [zaun/js/index.d.ts:390](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L390)
#### Parameters
##### options
[`BotMessageOptions`](/docs/reference/js/zaun-client/type-aliases/botmessageoptions/)
#### Returns
`Promise`\<\{ `message_id?`: `string`; \}\>
***
### respond()
> **respond**(`type`, `data?`): `Promise`\<\{ `message_id?`: `string`; \}\>
Defined in: [zaun/js/index.d.ts:389](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L389)
#### Parameters
##### type
`number`
##### data?
`unknown`
#### Returns
`Promise`\<\{ `message_id?`: `string`; \}\>
***
### showModal()
> **showModal**(`modal`): `Promise`\<`unknown`\>
Defined in: [zaun/js/index.d.ts:395](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L395)
#### Parameters
##### modal
[`ModalBuilder`](/docs/reference/js/zaun-client/classes/modalbuilder/) \| \{ `components`: [`ComponentData`](/docs/reference/js/zaun-client/type-aliases/componentdata/)[]; `custom_id`: `string`; `title`: `string`; \}
#### Returns
`Promise`\<`unknown`\>
***
### update()
> **update**(`options`): `Promise`\<\{ `message_id?`: `string`; \}\>
Defined in: [zaun/js/index.d.ts:393](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L393)
#### Parameters
##### options
[`BotMessageOptions`](/docs/reference/js/zaun-client/type-aliases/botmessageoptions/)
#### Returns
`Promise`\<\{ `message_id?`: `string`; \}\>
---
url: https://zaunchat.github.io/docs/reference/js/zaun-client/classes/member/
---
# Member
Defined in: [zaun/js/index.d.ts:776](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L776)
## Constructors
### Constructor
> **new Member**(): `Member`
#### Returns
`Member`
## Properties
### botId
> `readonly` **botId**: `string`
Defined in: [zaun/js/index.d.ts:796](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L796)
The bot this member is, if it is one.
***
### client
> `readonly` **client**: [`Client`](/docs/reference/js/zaun-client/classes/client/)
Defined in: [zaun/js/index.d.ts:777](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L777)
***
### community
> `readonly` **community**: [`Community`](/docs/reference/js/zaun-client/classes/community/)
Defined in: [zaun/js/index.d.ts:778](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L778)
***
### data
> `readonly` **data**: `any`
Defined in: [zaun/js/index.d.ts:793](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L793)
***
### displayName
> `readonly` **displayName**: `string`
Defined in: [zaun/js/index.d.ts:782](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L782)
***
### id
> `readonly` **id**: `string`
Defined in: [zaun/js/index.d.ts:779](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L779)
***
### isBot
> `readonly` **isBot**: `boolean`
Defined in: [zaun/js/index.d.ts:797](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L797)
***
### isMe
> `readonly` **isMe**: `boolean`
Defined in: [zaun/js/index.d.ts:791](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L791)
***
### isTimedOut
> `readonly` **isTimedOut**: `boolean`
Defined in: [zaun/js/index.d.ts:785](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L785)
***
### joinedAt
> `readonly` **joinedAt**: `Date`
Defined in: [zaun/js/index.d.ts:783](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L783)
***
### partial
> `readonly` **partial**: `boolean`
Defined in: [zaun/js/index.d.ts:781](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L781)
The cache does not have this member yet (`community.members.fetch()`).
***
### presence
> `readonly` **presence**: [`Presence`](/docs/reference/js/zaun-client/interfaces/presence/)
Defined in: [zaun/js/index.d.ts:787](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L787)
presence: status and activity (`offline` when unknown).
***
### roles
> `readonly` **roles**: [`Collection`](/docs/reference/js/zaun-client/classes/collection/)\<`string`, [`Role`](/docs/reference/js/zaun-client/classes/role/)\> & `object`
Defined in: [zaun/js/index.d.ts:792](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L792)
#### Type Declaration
##### add()
> **add**(`role`): `Promise`\<`void`\>
###### Parameters
###### role
`string` \| [`Role`](/docs/reference/js/zaun-client/classes/role/)
###### Returns
`Promise`\<`void`\>
##### remove()
> **remove**(`role`): `Promise`\<`void`\>
###### Parameters
###### role
`string` \| [`Role`](/docs/reference/js/zaun-client/classes/role/)
###### Returns
`Promise`\<`void`\>
***
### statusEmoji
> `readonly` **statusEmoji**: `string`
Defined in: [zaun/js/index.d.ts:790](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L790)
***
### statusText
> `readonly` **statusText**: `string`
Defined in: [zaun/js/index.d.ts:789](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L789)
Custom status text and emoji, if set.
***
### timedOutUntil
> `readonly` **timedOutUntil**: `Date`
Defined in: [zaun/js/index.d.ts:784](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L784)
## Methods
### ban()
> **ban**(`reason?`): `Promise`\<`void`\>
Defined in: [zaun/js/index.d.ts:801](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L801)
#### Parameters
##### reason?
`string`
#### Returns
`Promise`\<`void`\>
***
### canUse()
> **canUse**(`command`, `channel?`): `boolean`
Defined in: [zaun/js/index.d.ts:799](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L799)
Whether this member may use bot `command` in `channel`, as the cache sees it.
#### Parameters
##### command
[`ApplicationCommandData`](/docs/reference/js/zaun-client/interfaces/applicationcommanddata/)
##### channel?
`string` \| [`Channel`](/docs/reference/js/zaun-client/classes/channel/)
#### Returns
`boolean`
***
### dm()
> **dm**(): `Promise`\<[`Channel`](/docs/reference/js/zaun-client/classes/channel/)\>
Defined in: [zaun/js/index.d.ts:809](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L809)
DM: the direct message with this member, opened if needed. Rejects with
`FORBIDDEN` (`dms_closed`) or `RATE_LIMITED` (`dms`).
#### Returns
`Promise`\<[`Channel`](/docs/reference/js/zaun-client/classes/channel/)\>
***
### fingerprint()
> **fingerprint**(): `string`
Defined in: [zaun/js/index.d.ts:804](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L804)
#### Returns
`string`
***
### kick()
> **kick**(`reason?`): `Promise`\<`void`\>
Defined in: [zaun/js/index.d.ts:800](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L800)
#### Parameters
##### reason?
`string`
#### Returns
`Promise`\<`void`\>
***
### mention()
> **mention**(): `string`
Defined in: [zaun/js/index.d.ts:806](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L806)
`<@id>`: the text that shows a mention of this member.
#### Returns
`string`
***
### permissions()
> **permissions**(`channel?`): [`Permissions`](/docs/reference/js/zaun-client/classes/permissions/)
Defined in: [zaun/js/index.d.ts:794](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L794)
#### Parameters
##### channel?
`string` \| [`Channel`](/docs/reference/js/zaun-client/classes/channel/)
#### Returns
[`Permissions`](/docs/reference/js/zaun-client/classes/permissions/)
***
### send()
> **send**(`options`): `Promise`\<[`Message`](/docs/reference/js/zaun-client/classes/message/)\>
Defined in: [zaun/js/index.d.ts:811](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L811)
DM: sends this member a direct message.
#### Parameters
##### options
[`MessageOptions`](/docs/reference/js/zaun-client/type-aliases/messageoptions/)
#### Returns
`Promise`\<[`Message`](/docs/reference/js/zaun-client/classes/message/)\>
***
### timeout()
> **timeout**(`ms`, `reason?`): `Promise`\<`void`\>
Defined in: [zaun/js/index.d.ts:803](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L803)
For `ms` milliseconds; `null` lifts it.
#### Parameters
##### ms
`number`
##### reason?
`string`
#### Returns
`Promise`\<`void`\>
---
url: https://zaunchat.github.io/docs/reference/js/zaun-client/classes/message/
---
# Message
Defined in: [zaun/js/index.d.ts:729](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L729)
## Constructors
### Constructor
> **new Message**(): `Message`
#### Returns
`Message`
## Properties
### attachments
> `readonly` **attachments**: [`Collection`](/docs/reference/js/zaun-client/classes/collection/)\<`string`, [`Attachment`](/docs/reference/js/zaun-client/classes/attachment/)\>
Defined in: [zaun/js/index.d.ts:742](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L742)
***
### author
> `readonly` **author**: [`Member`](/docs/reference/js/zaun-client/classes/member/)
Defined in: [zaun/js/index.d.ts:736](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L736)
***
### authorId
> `readonly` **authorId**: `string`
Defined in: [zaun/js/index.d.ts:735](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L735)
***
### channel
> `readonly` **channel**: [`Channel`](/docs/reference/js/zaun-client/classes/channel/)
Defined in: [zaun/js/index.d.ts:732](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L732)
***
### client
> `readonly` **client**: [`Client`](/docs/reference/js/zaun-client/classes/client/)
Defined in: [zaun/js/index.d.ts:730](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L730)
***
### community
> `readonly` **community**: [`Community`](/docs/reference/js/zaun-client/classes/community/)
Defined in: [zaun/js/index.d.ts:731](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L731)
***
### components
> `readonly` **components**: [`ComponentData`](/docs/reference/js/zaun-client/type-aliases/componentdata/)[]
Defined in: [zaun/js/index.d.ts:750](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L750)
A bot's buttons, selects and layout; `null` on a partial message.
***
### content
> **content**: `string`
Defined in: [zaun/js/index.d.ts:734](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L734)
***
### createdAt
> `readonly` **createdAt**: `Date`
Defined in: [zaun/js/index.d.ts:739](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L739)
***
### editedAt
> `readonly` **editedAt**: `Date`
Defined in: [zaun/js/index.d.ts:740](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L740)
***
### embeds
> **embeds**: [`Embed`](/docs/reference/js/zaun-client/classes/embed/)[]
Defined in: [zaun/js/index.d.ts:745](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L745)
Its embeds; on a partial message `null` when the event did not say (an edit that left
them as they were).
***
### flags
> `readonly` **flags**: `number`
Defined in: [zaun/js/index.d.ts:752](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L752)
MessageFlags bits.
***
### id
> `readonly` **id**: `string`
Defined in: [zaun/js/index.d.ts:733](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L733)
***
### interaction
> `readonly` **interaction**: `object`
Defined in: [zaun/js/index.d.ts:754](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L754)
The interaction a bot's reply answers.
#### interaction\_id
> **interaction\_id**: `string`
#### member\_id
> **member\_id**: `string`
#### name?
> `optional` **name?**: `string`
#### type
> **type**: `number`
***
### loading
> `readonly` **loading**: `boolean`
Defined in: [zaun/js/index.d.ts:756](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L756)
A deferred bot reply still "thinking…".
***
### mentions
> **mentions**: [`MessageMentions`](/docs/reference/js/zaun-client/classes/messagementions/)
Defined in: [zaun/js/index.d.ts:760](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L760)
Who it mentions; `null` on a partial message whose event did not say (an edit that
left them as they were). On a message `send` returns, and after an `edit` that named
some, the ones asked for (the host may have dropped some).
***
### mentionsMe
> `readonly` **mentionsMe**: `boolean`
Defined in: [zaun/js/index.d.ts:762](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L762)
Whether it mentions this client's member: by id, by one of its roles, or `@everyone`.
***
### mine
> `readonly` **mine**: `boolean`
Defined in: [zaun/js/index.d.ts:737](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L737)
***
### partial
> `readonly` **partial**: `boolean`
Defined in: [zaun/js/index.d.ts:748](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L748)
Known only by what an event said (no history is kept): its id, and for an edit its new
text and author. It still acts: reply, edit, delete, react.
***
### replyTo
> `readonly` **replyTo**: `string`
Defined in: [zaun/js/index.d.ts:741](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L741)
***
### sequence
> `readonly` **sequence**: `number`
Defined in: [zaun/js/index.d.ts:738](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L738)
***
### silent
> `readonly` **silent**: `boolean`
Defined in: [zaun/js/index.d.ts:764](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L764)
Sent with SuppressNotifications: its mentions notify nobody.
## Methods
### click()
> **click**(`customId`, `values?`): `Promise`\<`string`\>
Defined in: [zaun/js/index.d.ts:766](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L766)
Clicks a button, or chooses `values` in a select; resolves with the interaction id.
#### Parameters
##### customId
`string`
##### values?
`string`[]
#### Returns
`Promise`\<`string`\>
***
### delete()
> **delete**(): `Promise`\<`void`\>
Defined in: [zaun/js/index.d.ts:771](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L771)
#### Returns
`Promise`\<`void`\>
***
### edit()
> **edit**(`options`): `Promise`\<`Message`\>
Defined in: [zaun/js/index.d.ts:770](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L770)
Resolves with this message, its `content`, `embeds` and (when the edit named any)
`mentions` as sent.
#### Parameters
##### options
[`MessageEditOptions`](/docs/reference/js/zaun-client/type-aliases/messageeditoptions/)
#### Returns
`Promise`\<`Message`\>
***
### react()
> **react**(`emoji`): `Promise`\<`void`\>
Defined in: [zaun/js/index.d.ts:772](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L772)
#### Parameters
##### emoji
`string`
#### Returns
`Promise`\<`void`\>
***
### reply()
> **reply**(`options`): `Promise`\<`Message`\>
Defined in: [zaun/js/index.d.ts:767](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L767)
#### Parameters
##### options
[`MessageOptions`](/docs/reference/js/zaun-client/type-aliases/messageoptions/)
#### Returns
`Promise`\<`Message`\>
***
### unreact()
> **unreact**(`emoji`): `Promise`\<`void`\>
Defined in: [zaun/js/index.d.ts:773](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L773)
#### Parameters
##### emoji
`string`
#### Returns
`Promise`\<`void`\>
---
url: https://zaunchat.github.io/docs/reference/js/zaun-client/classes/messagementions/
---
# MessageMentions
Defined in: [zaun/js/index.d.ts:599](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L599)
Who a message mentions, as the host honoured them.
## Constructors
### Constructor
> **new MessageMentions**(): `MessageMentions`
#### Returns
`MessageMentions`
## Properties
### empty
> `readonly` **empty**: `boolean`
Defined in: [zaun/js/index.d.ts:608](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L608)
***
### everyone
> `readonly` **everyone**: `boolean`
Defined in: [zaun/js/index.d.ts:600](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L600)
***
### memberIds
> `readonly` **memberIds**: `string`[]
Defined in: [zaun/js/index.d.ts:601](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L601)
***
### members
> `readonly` **members**: [`Collection`](/docs/reference/js/zaun-client/classes/collection/)\<`string`, [`Member`](/docs/reference/js/zaun-client/classes/member/)\>
Defined in: [zaun/js/index.d.ts:604](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L604)
id → Member, from the community cache (partial until it has them).
***
### roleIds
> `readonly` **roleIds**: `string`[]
Defined in: [zaun/js/index.d.ts:602](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L602)
***
### roles
> `readonly` **roles**: [`Collection`](/docs/reference/js/zaun-client/classes/collection/)\<`string`, [`Role`](/docs/reference/js/zaun-client/classes/role/)\>
Defined in: [zaun/js/index.d.ts:607](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L607)
***
### users
> `readonly` **users**: [`Collection`](/docs/reference/js/zaun-client/classes/collection/)\<`string`, [`Member`](/docs/reference/js/zaun-client/classes/member/)\>
Defined in: [zaun/js/index.d.ts:606](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L606)
Same as `members`.
## Methods
### has()
> **has**(`target`, `options?`): `boolean`
Defined in: [zaun/js/index.d.ts:610](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L610)
Whether `target` is named, mentioned by `@everyone`, or (a member) by one of its roles.
#### Parameters
##### target
`string` \| [`Member`](/docs/reference/js/zaun-client/classes/member/) \| [`Role`](/docs/reference/js/zaun-client/classes/role/)
##### options?
###### ignoreEveryone?
`boolean`
###### ignoreRoles?
`boolean`
#### Returns
`boolean`
***
### toJSON()
> **toJSON**(): [`MentionsData`](/docs/reference/js/zaun-client/interfaces/mentionsdata/)
Defined in: [zaun/js/index.d.ts:611](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L611)
#### Returns
[`MentionsData`](/docs/reference/js/zaun-client/interfaces/mentionsdata/)
---
url: https://zaunchat.github.io/docs/reference/js/zaun-client/classes/modalbuilder/
---
# ModalBuilder
Defined in: [zaun/js/index.d.ts:442](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L442)
## Extends
- `Builder`\<\{ `components`: [`ComponentData`](/docs/reference/js/zaun-client/type-aliases/componentdata/)[]; `custom_id`: `string`; `title`: `string`; \}\>
## Constructors
### Constructor
> **new ModalBuilder**(`data?`): `ModalBuilder`
Defined in: [zaun/js/index.d.ts:443](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L443)
#### Parameters
##### data?
`object`
#### Returns
`ModalBuilder`
#### Overrides
`Builder<{ custom_id: string; title: string; components: ComponentData[] }>.constructor`
## Properties
### data
> **data**: `object`
Defined in: [zaun/js/index.d.ts:410](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L410)
#### components
> **components**: [`ComponentData`](/docs/reference/js/zaun-client/type-aliases/componentdata/)[]
#### custom\_id
> **custom\_id**: `string`
#### title
> **title**: `string`
#### Inherited from
`Builder.data`
## Methods
### addField()
> **addField**(`label`, `input`, `description?`): `this`
Defined in: [zaun/js/index.d.ts:446](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L446)
#### Parameters
##### label
`string`
##### input
[`ComponentData`](/docs/reference/js/zaun-client/type-aliases/componentdata/) \| \{ `toJSON`(): [`ComponentData`](/docs/reference/js/zaun-client/type-aliases/componentdata/); \}
##### description?
`string`
#### Returns
`this`
***
### addText()
> **addText**(`content`): `this`
Defined in: [zaun/js/index.d.ts:447](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L447)
#### Parameters
##### content
`string`
#### Returns
`this`
***
### setCustomId()
> **setCustomId**(`id`): `this`
Defined in: [zaun/js/index.d.ts:444](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L444)
#### Parameters
##### id
`string`
#### Returns
`this`
***
### setTitle()
> **setTitle**(`title`): `this`
Defined in: [zaun/js/index.d.ts:445](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L445)
#### Parameters
##### title
`string`
#### Returns
`this`
***
### toJSON()
> **toJSON**(): `object`
Defined in: [zaun/js/index.d.ts:411](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L411)
#### Returns
`object`
##### components
> **components**: [`ComponentData`](/docs/reference/js/zaun-client/type-aliases/componentdata/)[]
##### custom\_id
> **custom\_id**: `string`
##### title
> **title**: `string`
#### Inherited from
`Builder.toJSON`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-client/classes/permissions/
---
# Permissions
Defined in: [zaun/js/index.d.ts:72](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L72)
## Constructors
### Constructor
> **new Permissions**(`bits?`): `Permissions`
Defined in: [zaun/js/index.d.ts:75](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L75)
#### Parameters
##### bits?
[`PermissionResolvable`](/docs/reference/js/zaun-client/type-aliases/permissionresolvable/)
#### Returns
`Permissions`
## Properties
### bitfield
> **bitfield**: `bigint`
Defined in: [zaun/js/index.d.ts:76](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L76)
***
### Flags
> `static` **Flags**: `Record`\<[`PermissionFlag`](/docs/reference/js/zaun-client/type-aliases/permissionflag/), `bigint`\>
Defined in: [zaun/js/index.d.ts:73](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L73)
## Methods
### has()
> **has**(`flag`): `boolean`
Defined in: [zaun/js/index.d.ts:77](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L77)
#### Parameters
##### flag
[`PermissionResolvable`](/docs/reference/js/zaun-client/type-aliases/permissionresolvable/)
#### Returns
`boolean`
***
### toArray()
> **toArray**(): [`PermissionFlag`](/docs/reference/js/zaun-client/type-aliases/permissionflag/)[]
Defined in: [zaun/js/index.d.ts:78](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L78)
#### Returns
[`PermissionFlag`](/docs/reference/js/zaun-client/type-aliases/permissionflag/)[]
***
### resolve()
> `static` **resolve**(`p`): `bigint`
Defined in: [zaun/js/index.d.ts:74](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L74)
#### Parameters
##### p
[`PermissionResolvable`](/docs/reference/js/zaun-client/type-aliases/permissionresolvable/)
#### Returns
`bigint`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-client/classes/rawclient/
---
# RawClient
Defined in: zaun/pkg/web/zaun\_client.d.ts:2
The low-level wasm-bindgen client (see the Rust API).
## Constructors
### Constructor
> **new RawClient**(): `RawClient`
#### Returns
`RawClient`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-client/classes/role/
---
# Role
Defined in: [zaun/js/index.d.ts:814](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L814)
## Constructors
### Constructor
> **new Role**(): `Role`
#### Returns
`Role`
## Properties
### color
> `readonly` **color**: `number`
Defined in: [zaun/js/index.d.ts:818](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L818)
***
### community
> `readonly` **community**: [`Community`](/docs/reference/js/zaun-client/classes/community/)
Defined in: [zaun/js/index.d.ts:815](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L815)
***
### id
> `readonly` **id**: `string`
Defined in: [zaun/js/index.d.ts:816](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L816)
***
### managedBy
> `readonly` **managedBy**: `string`
Defined in: [zaun/js/index.d.ts:822](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L822)
The bot whose managed role this is.
***
### name
> `readonly` **name**: `string`
Defined in: [zaun/js/index.d.ts:817](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L817)
***
### permissions
> `readonly` **permissions**: [`Permissions`](/docs/reference/js/zaun-client/classes/permissions/)
Defined in: [zaun/js/index.d.ts:820](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L820)
***
### position
> `readonly` **position**: `number`
Defined in: [zaun/js/index.d.ts:819](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L819)
## Methods
### delete()
> **delete**(): `Promise`\<`void`\>
Defined in: [zaun/js/index.d.ts:825](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L825)
#### Returns
`Promise`\<`void`\>
***
### mention()
> **mention**(): `string`
Defined in: [zaun/js/index.d.ts:824](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L824)
`<@&id>`: the text that shows a mention of this role.
#### Returns
`string`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-client/classes/selectbuilder/
---
# SelectBuilder
Defined in: [zaun/js/index.d.ts:422](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L422)
## Extends
- `Builder`\<[`ComponentData`](/docs/reference/js/zaun-client/type-aliases/componentdata/)\>
## Constructors
### Constructor
> **new SelectBuilder**(`type?`, `data?`): `SelectBuilder`
Defined in: [zaun/js/index.d.ts:423](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L423)
#### Parameters
##### type?
`number`
##### data?
`object`
#### Returns
`SelectBuilder`
#### Overrides
`Builder.constructor`
## Properties
### data
> **data**: [`ComponentData`](/docs/reference/js/zaun-client/type-aliases/componentdata/)
Defined in: [zaun/js/index.d.ts:410](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L410)
#### Inherited from
`Builder.data`
## Methods
### addOption()
> **addOption**(`label`, `value`, `more?`): `this`
Defined in: [zaun/js/index.d.ts:427](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L427)
#### Parameters
##### label
`string`
##### value
`string`
##### more?
###### default?
`boolean`
###### description?
`string`
###### emoji?
`string`
#### Returns
`this`
***
### setCustomId()
> **setCustomId**(`id`): `this`
Defined in: [zaun/js/index.d.ts:424](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L424)
#### Parameters
##### id
`string`
#### Returns
`this`
***
### setPlaceholder()
> **setPlaceholder**(`text`): `this`
Defined in: [zaun/js/index.d.ts:425](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L425)
#### Parameters
##### text
`string`
#### Returns
`this`
***
### setRange()
> **setRange**(`min`, `max`): `this`
Defined in: [zaun/js/index.d.ts:426](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L426)
#### Parameters
##### min
`number`
##### max
`number`
#### Returns
`this`
***
### toJSON()
> **toJSON**(): [`ComponentData`](/docs/reference/js/zaun-client/type-aliases/componentdata/)
Defined in: [zaun/js/index.d.ts:411](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L411)
#### Returns
[`ComponentData`](/docs/reference/js/zaun-client/type-aliases/componentdata/)
#### Inherited from
`Builder.toJSON`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-client/classes/simplexclient/
---
# SimplexClient
Defined in: zaun/pkg/web/zaun\_client.d.ts:4
The SimpleX client the wasm module runs.
## Constructors
### Constructor
> **new SimplexClient**(): `SimplexClient`
#### Returns
`SimplexClient`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-client/classes/textinputbuilder/
---
# TextInputBuilder
Defined in: [zaun/js/index.d.ts:433](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L433)
## Extends
- `Builder`\<[`ComponentData`](/docs/reference/js/zaun-client/type-aliases/componentdata/)\>
## Constructors
### Constructor
> **new TextInputBuilder**(`data?`): `TextInputBuilder`
Defined in: [zaun/js/index.d.ts:434](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L434)
#### Parameters
##### data?
`object`
#### Returns
`TextInputBuilder`
#### Overrides
`Builder.constructor`
## Properties
### data
> **data**: [`ComponentData`](/docs/reference/js/zaun-client/type-aliases/componentdata/)
Defined in: [zaun/js/index.d.ts:410](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L410)
#### Inherited from
`Builder.data`
## Methods
### setCustomId()
> **setCustomId**(`id`): `this`
Defined in: [zaun/js/index.d.ts:435](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L435)
#### Parameters
##### id
`string`
#### Returns
`this`
***
### setLength()
> **setLength**(`min`, `max`): `this`
Defined in: [zaun/js/index.d.ts:437](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L437)
#### Parameters
##### min
`number`
##### max
`number`
#### Returns
`this`
***
### setPlaceholder()
> **setPlaceholder**(`text`): `this`
Defined in: [zaun/js/index.d.ts:439](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L439)
#### Parameters
##### text
`string`
#### Returns
`this`
***
### setRequired()
> **setRequired**(`required?`): `this`
Defined in: [zaun/js/index.d.ts:438](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L438)
#### Parameters
##### required?
`boolean`
#### Returns
`this`
***
### setStyle()
> **setStyle**(`style`): `this`
Defined in: [zaun/js/index.d.ts:436](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L436)
#### Parameters
##### style
`number`
#### Returns
`this`
***
### setValue()
> **setValue**(`text`): `this`
Defined in: [zaun/js/index.d.ts:440](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L440)
#### Parameters
##### text
`string`
#### Returns
`this`
***
### toJSON()
> **toJSON**(): [`ComponentData`](/docs/reference/js/zaun-client/type-aliases/componentdata/)
Defined in: [zaun/js/index.d.ts:411](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L411)
#### Returns
[`ComponentData`](/docs/reference/js/zaun-client/type-aliases/componentdata/)
#### Inherited from
`Builder.toJSON`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-client/classes/voiceconnection/
---
# VoiceConnection
Defined in: [zaun/js/index.d.ts:843](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L843)
## Constructors
### Constructor
> **new VoiceConnection**(): `VoiceConnection`
#### Returns
`VoiceConnection`
## Properties
### canSend
> `readonly` **canSend**: `boolean`
Defined in: [zaun/js/index.d.ts:846](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L846)
***
### channel
> `readonly` **channel**: [`Channel`](/docs/reference/js/zaun-client/classes/channel/)
Defined in: [zaun/js/index.d.ts:844](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L844)
***
### community
> `readonly` **community**: [`Community`](/docs/reference/js/zaun-client/classes/community/)
Defined in: [zaun/js/index.d.ts:845](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L845)
## Methods
### deafen()
> **deafen**(`on?`): `Promise`\<`void`\>
Defined in: [zaun/js/index.d.ts:859](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L859)
#### Parameters
##### on?
`boolean`
#### Returns
`Promise`\<`void`\>
***
### disconnect()
> **disconnect**(): `Promise`\<`void`\>
Defined in: [zaun/js/index.d.ts:861](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L861)
#### Returns
`Promise`\<`void`\>
***
### mute()
> **mute**(`on?`): `Promise`\<`void`\>
Defined in: [zaun/js/index.d.ts:857](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L857)
#### Parameters
##### on?
`boolean`
#### Returns
`Promise`\<`void`\>
***
### off()
> **off**\<`E`\>(`name`, `f`): `this`
Defined in: [zaun/js/index.d.ts:849](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L849)
#### Type Parameters
##### E
`E` *extends* keyof [`VoiceEvents`](/docs/reference/js/zaun-client/interfaces/voiceevents/)
#### Parameters
##### name
`E`
##### f
(...`args`) => `void`
#### Returns
`this`
***
### on()
> **on**\<`E`\>(`name`, `f`): `this`
Defined in: [zaun/js/index.d.ts:848](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L848)
#### Type Parameters
##### E
`E` *extends* keyof [`VoiceEvents`](/docs/reference/js/zaun-client/interfaces/voiceevents/)
#### Parameters
##### name
`E`
##### f
(...`args`) => `void`
#### Returns
`this`
***
### play()
> **play**(`file`): `object`
Defined in: [zaun/js/index.d.ts:856](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L856)
Node.js and Bun: plays an Ogg Opus file (bytes, or a path in Node.js) in real time.
#### Parameters
##### file
`string` \| `Uint8Array`\<`ArrayBufferLike`\>
#### Returns
`object`
##### finished
> **finished**: `Promise`\<`void`\>
##### stop()
> **stop**(): `void`
###### Returns
`void`
***
### sendAudio()
> **sendAudio**(`frame`): `number`
Defined in: [zaun/js/index.d.ts:854](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L854)
Node.js and Bun: sends one Opus packet, sealed for each peer, in real time; returns to
how many peers it went.
#### Parameters
##### frame
`Uint8Array`
#### Returns
`number`
***
### setTrack()
> **setTrack**(`track`): `void`
Defined in: [zaun/js/index.d.ts:851](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L851)
Browsers: sends `track`, or nothing with null.
#### Parameters
##### track
`MediaStreamTrack`
#### Returns
`void`
***
### stats()
> **stats**(): `object`
Defined in: [zaun/js/index.d.ts:847](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L847)
#### Returns
`object`
##### received
> **received**: `number`
##### refused
> **refused**: `number`
##### sent
> **sent**: `number`
***
### undeafen()
> **undeafen**(): `Promise`\<`void`\>
Defined in: [zaun/js/index.d.ts:860](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L860)
#### Returns
`Promise`\<`void`\>
***
### unmute()
> **unmute**(): `Promise`\<`void`\>
Defined in: [zaun/js/index.d.ts:858](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L858)
#### Returns
`Promise`\<`void`\>
---
url: https://zaunchat.github.io/docs/reference/js/zaun-client/classes/zaunerror/
---
# ZaunError
Defined in: [zaun/js/index.d.ts:43](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L43)
## Extends
- `Error`
## Constructors
### Constructor
> **new ZaunError**(`message?`): `ZaunError`
Defined in: ../../../node\_modules/typescript/lib/lib.es5.d.ts:1082
#### Parameters
##### message?
`string`
#### Returns
`ZaunError`
#### Inherited from
`Error.constructor`
### Constructor
> **new ZaunError**(`message?`, `options?`): `ZaunError`
Defined in: ../../../node\_modules/typescript/lib/lib.es5.d.ts:1082
#### Parameters
##### message?
`string`
##### options?
`ErrorOptions`
#### Returns
`ZaunError`
#### Inherited from
`Error.constructor`
## Properties
### body?
> `optional` **body?**: `unknown`
Defined in: [zaun/js/index.d.ts:49](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L49)
***
### code
> **code**: `string`
Defined in: [zaun/js/index.d.ts:46](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L46)
Lowercase for a local failure (`timeout`, `closed`, `bad_link`, `unsupported`, …), or
the host's own code (`FORBIDDEN`, `RATE_LIMITED`, …).
***
### command?
> `optional` **command?**: `string`
Defined in: [zaun/js/index.d.ts:48](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L48)
The command the host refused.
---
url: https://zaunchat.github.io/docs/reference/js/zaun-client/functions/inspectpackage/
---
# inspectPackage
> **inspectPackage**(`bytes`): `Promise`\<[`PackageInspection`](/docs/reference/js/zaun-client/interfaces/packageinspection/)\>
Defined in: [zaun/js/index.d.ts:313](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L313)
What a `.zbot` file says, whether it is signed, and whether it passes the registry's checks.
## Parameters
### bytes
`Bytes`
## Returns
`Promise`\<[`PackageInspection`](/docs/reference/js/zaun-client/interfaces/packageinspection/)\>
---
url: https://zaunchat.github.io/docs/reference/js/zaun-client/functions/membermention/
---
# memberMention
> **memberMention**(`member`): `string`
Defined in: [zaun/js/index.d.ts:617](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L617)
Same as `userMention`.
## Parameters
### member
`string` \| [`Member`](/docs/reference/js/zaun-client/classes/member/)
## Returns
`string`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-client/functions/parsementions/
---
# parseMentions
> **parseMentions**(`content`): [`MentionsData`](/docs/reference/js/zaun-client/interfaces/mentionsdata/)
Defined in: [zaun/js/index.d.ts:623](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L623)
The mentions the text shows: `<@id>`, `<@!id>`, `<@&id>`, `@everyone`; each id once,
at most 50 members and 20 roles.
## Parameters
### content
`string`
## Returns
[`MentionsData`](/docs/reference/js/zaun-client/interfaces/mentionsdata/)
---
url: https://zaunchat.github.io/docs/reference/js/zaun-client/functions/registrykeyid/
---
# registryKeyId
> **registryKeyId**(`key`): `Promise`\<\{ `errors`: [`RegistryError`](/docs/reference/js/zaun-client/interfaces/registryerror/)[]; `id`: `string`; `ok`: `boolean`; \}\>
Defined in: [zaun/js/index.d.ts:315](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L315)
The id of a base64url public key, as a bot card's `source.registry_id` names it.
## Parameters
### key
`string`
## Returns
`Promise`\<\{ `errors`: [`RegistryError`](/docs/reference/js/zaun-client/interfaces/registryerror/)[]; `id`: `string`; `ok`: `boolean`; \}\>
---
url: https://zaunchat.github.io/docs/reference/js/zaun-client/functions/rolemention/
---
# roleMention
> **roleMention**(`role`): `string`
Defined in: [zaun/js/index.d.ts:619](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L619)
`<@&id>`: the text that shows a role mention.
## Parameters
### role
`string` \| [`Role`](/docs/reference/js/zaun-client/classes/role/)
## Returns
`string`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-client/functions/usermention/
---
# userMention
> **userMention**(`member`): `string`
Defined in: [zaun/js/index.d.ts:615](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L615)
`<@id>`: the text that shows a member mention.
## Parameters
### member
`string` \| [`Member`](/docs/reference/js/zaun-client/classes/member/)
## Returns
`string`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-client/functions/verifycatalog/
---
# verifyCatalog
> **verifyCatalog**(`bytes`, `signature`, `pinnedKeys`, `options?`): `Promise`\<[`CatalogVerification`](/docs/reference/js/zaun-client/interfaces/catalogverification/)\>
Defined in: [zaun/js/index.d.ts:297](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L297)
Verifies `catalog.json` (exact bytes) and `catalog.json.sig` against the pinned key (base64url)
whose id the catalog names. `now`: Unix seconds or a Date (default: this device's clock).
`seen`: what an earlier success returned for this registry, so a rollback is refused.
## Parameters
### bytes
`Bytes`
### signature
`string` \| `Uint8Array`\<`ArrayBufferLike`\>
### pinnedKeys
`string` \| `string`[]
### options?
#### now?
`number` \| `Date`
#### seen?
[`CatalogSeen`](/docs/reference/js/zaun-client/interfaces/catalogseen/)
## Returns
`Promise`\<[`CatalogVerification`](/docs/reference/js/zaun-client/interfaces/catalogverification/)\>
---
url: https://zaunchat.github.io/docs/reference/js/zaun-client/functions/verifyhistory/
---
# verifyHistory
> **verifyHistory**(`catalogBytes`, `signature`, `pinnedKeys`, `appId`, `historyBytes`, `options?`): `Promise`\<[`HistoryVerification`](/docs/reference/js/zaun-client/interfaces/historyverification/)\>
Defined in: [zaun/js/index.d.ts:304](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L304)
Verifies the catalog, then `history/.json` against the hash it lists.
## Parameters
### catalogBytes
`Bytes`
### signature
`string` \| `Uint8Array`\<`ArrayBufferLike`\>
### pinnedKeys
`string` \| `string`[]
### appId
`string`
### historyBytes
`Bytes`
### options?
#### now?
`number` \| `Date`
## Returns
`Promise`\<[`HistoryVerification`](/docs/reference/js/zaun-client/interfaces/historyverification/)\>
---
url: https://zaunchat.github.io/docs/reference/js/zaun-client/interfaces/activity/
---
# Activity
Defined in: [zaun/js/index.d.ts:8](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L8)
presence: what a member is doing.
## Properties
### details?
> `optional` **details?**: `string`
Defined in: [zaun/js/index.d.ts:11](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L11)
***
### emoji?
> `optional` **emoji?**: `string`
Defined in: [zaun/js/index.d.ts:17](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L17)
custom only.
***
### name
> **name**: `string`
Defined in: [zaun/js/index.d.ts:10](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L10)
***
### started\_at?
> `optional` **started\_at?**: `number`
Defined in: [zaun/js/index.d.ts:15](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L15)
***
### state?
> `optional` **state?**: `string`
Defined in: [zaun/js/index.d.ts:12](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L12)
***
### type
> **type**: `"playing"` \| `"streaming"` \| `"listening"` \| `"watching"` \| `"competing"` \| `"custom"`
Defined in: [zaun/js/index.d.ts:9](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L9)
***
### url?
> `optional` **url?**: `string`
Defined in: [zaun/js/index.d.ts:14](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L14)
streaming only: an https link, opened only after the reader confirms.
---
url: https://zaunchat.github.io/docs/reference/js/zaun-client/interfaces/allowedmentions/
---
# AllowedMentions
Defined in: [zaun/js/index.d.ts:585](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L585)
other libraries's `allowedMentions`, applied to the mentions the content shows.
## Properties
### parse?
> `optional` **parse?**: (`"users"` \| `"roles"` \| `"everyone"`)[]
Defined in: [zaun/js/index.d.ts:586](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L586)
***
### roles?
> `optional` **roles?**: (`string` \| [`Role`](/docs/reference/js/zaun-client/classes/role/))[]
Defined in: [zaun/js/index.d.ts:588](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L588)
***
### users?
> `optional` **users?**: (`string` \| [`Member`](/docs/reference/js/zaun-client/classes/member/))[]
Defined in: [zaun/js/index.d.ts:587](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L587)
---
url: https://zaunchat.github.io/docs/reference/js/zaun-client/interfaces/applicationcommanddata/
---
# ApplicationCommandData
Defined in: [zaun/js/index.d.ts:332](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L332)
## Properties
### bot\_id?
> `optional` **bot\_id?**: `string`
Defined in: [zaun/js/index.d.ts:334](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L334)
***
### command\_id?
> `optional` **command\_id?**: `string`
Defined in: [zaun/js/index.d.ts:333](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L333)
***
### default\_member\_permissions?
> `optional` **default\_member\_permissions?**: `string`
Defined in: [zaun/js/index.d.ts:340](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L340)
***
### description?
> `optional` **description?**: `string`
Defined in: [zaun/js/index.d.ts:338](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L338)
***
### name
> **name**: `string`
Defined in: [zaun/js/index.d.ts:337](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L337)
***
### options?
> `optional` **options?**: [`CommandOptionData`](/docs/reference/js/zaun-client/interfaces/commandoptiondata/)[]
Defined in: [zaun/js/index.d.ts:339](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L339)
***
### type?
> `optional` **type?**: `number`
Defined in: [zaun/js/index.d.ts:336](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L336)
ApplicationCommandType: 1 slash, 2 user, 3 message.
---
url: https://zaunchat.github.io/docs/reference/js/zaun-client/interfaces/botcapabilities/
---
# BotCapabilities
Defined in: [zaun/js/index.d.ts:147](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L147)
## Properties
### attachments?
> `optional` **attachments?**: `boolean`
Defined in: [zaun/js/index.d.ts:152](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L152)
***
### local\_network?
> `optional` **local\_network?**: `string`[]
Defined in: [zaun/js/index.d.ts:157](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L157)
Exact `host:port` addresses next to the host it may reach (≤ 8); only the operator's
ceiling lets any be granted. Absent when none.
***
### members?
> `optional` **members?**: `boolean`
Defined in: [zaun/js/index.d.ts:149](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L149)
***
### message\_content?
> `optional` **message\_content?**: `boolean`
Defined in: [zaun/js/index.d.ts:148](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L148)
***
### network?
> `optional` **network?**: `string`[]
Defined in: [zaun/js/index.d.ts:154](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L154)
***
### presence?
> `optional` **presence?**: `boolean`
Defined in: [zaun/js/index.d.ts:150](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L150)
***
### storage\_bytes?
> `optional` **storage\_bytes?**: `number`
Defined in: [zaun/js/index.d.ts:153](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L153)
***
### timers?
> `optional` **timers?**: `boolean`
Defined in: [zaun/js/index.d.ts:151](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L151)
---
url: https://zaunchat.github.io/docs/reference/js/zaun-client/interfaces/botcard/
---
# BotCard
Defined in: [zaun/js/index.d.ts:170](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L170)
A bot's public card: every member can read what it was granted.
## Properties
### app\_id
> **app\_id**: `string`
Defined in: [zaun/js/index.d.ts:173](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L173)
***
### bot\_id
> **bot\_id**: `string`
Defined in: [zaun/js/index.d.ts:171](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L171)
***
### capabilities
> **capabilities**: `Required`\<`Omit`\<[`BotCapabilities`](/docs/reference/js/zaun-client/interfaces/botcapabilities/), `"local_network"`\>\> & `Pick`\<[`BotCapabilities`](/docs/reference/js/zaun-client/interfaces/botcapabilities/), `"local_network"`\>
Defined in: [zaun/js/index.d.ts:182](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L182)
***
### config?
> `optional` **config?**: `Record`\<`string`, [`BotConfigKey`](/docs/reference/js/zaun-client/interfaces/botconfigkey/)\>
Defined in: [zaun/js/index.d.ts:186](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L186)
The settings it declares, never their values (absent when none).
***
### description?
> `optional` **description?**: `string`
Defined in: [zaun/js/index.d.ts:175](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L175)
***
### events
> **events**: `string`[]
Defined in: [zaun/js/index.d.ts:184](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L184)
***
### granted\_at
> **granted\_at**: `number`
Defined in: [zaun/js/index.d.ts:190](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L190)
***
### installed\_at
> **installed\_at**: `number`
Defined in: [zaun/js/index.d.ts:187](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L187)
***
### installed\_by
> **installed\_by**: `string`
Defined in: [zaun/js/index.d.ts:188](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L188)
***
### kind
> **kind**: `"hosted"` \| `"external"`
Defined in: [zaun/js/index.d.ts:179](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L179)
***
### member\_id
> **member\_id**: `string`
Defined in: [zaun/js/index.d.ts:172](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L172)
***
### name
> **name**: `string`
Defined in: [zaun/js/index.d.ts:174](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L174)
***
### permissions
> **permissions**: `string`
Defined in: [zaun/js/index.d.ts:181](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L181)
***
### publisher
> **publisher**: `string`
Defined in: [zaun/js/index.d.ts:177](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L177)
***
### requested?
> `optional` **requested?**: `object`
Defined in: [zaun/js/index.d.ts:183](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L183)
#### capabilities
> **capabilities**: [`BotCapabilities`](/docs/reference/js/zaun-client/interfaces/botcapabilities/)
#### permissions
> **permissions**: `string`
***
### signed
> **signed**: `boolean`
Defined in: [zaun/js/index.d.ts:178](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L178)
***
### source?
> `optional` **source?**: [`BotSource`](/docs/reference/js/zaun-client/interfaces/botsource/)
Defined in: [zaun/js/index.d.ts:194](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L194)
Where the host confirmed the running version came from; absent from older hosts and for
bots installed before they recorded it (read that as `direct`). `kind` is the host's
claim: show Official or Community only when `registry_id` is also the key id you pin.
***
### state
> **state**: `"enabled"` \| `"disabled"` \| `"pending_approval"` \| `"crashed"`
Defined in: [zaun/js/index.d.ts:180](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L180)
***
### updated\_at
> **updated\_at**: `number`
Defined in: [zaun/js/index.d.ts:189](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L189)
***
### version
> **version**: `string`
Defined in: [zaun/js/index.d.ts:176](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L176)
---
url: https://zaunchat.github.io/docs/reference/js/zaun-client/interfaces/botconfigkey/
---
# BotConfigKey
Defined in: [zaun/js/index.d.ts:161](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L161)
A setting a bot's manifest declares; the owner sets its value.
## Properties
### default?
> `optional` **default?**: `string`
Defined in: [zaun/js/index.d.ts:164](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L164)
Used while the owner has set nothing; never for a secret.
***
### description
> **description**: `string`
Defined in: [zaun/js/index.d.ts:162](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L162)
***
### secret?
> `optional` **secret?**: `boolean`
Defined in: [zaun/js/index.d.ts:166](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L166)
Masked wherever it is shown.
---
url: https://zaunchat.github.io/docs/reference/js/zaun-client/interfaces/botsource/
---
# BotSource
Defined in: [zaun/js/index.d.ts:198](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L198)
A bot card's `source`. An unknown `kind` reads as `direct`.
## Properties
### kind
> **kind**: `"official"` \| `"community"` \| `"third_party"` \| `"direct"`
Defined in: [zaun/js/index.d.ts:199](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L199)
***
### registry\_id?
> `optional` **registry\_id?**: `string`
Defined in: [zaun/js/index.d.ts:201](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L201)
The registry key's id (`registryKeyId` of the key), present unless `direct`.
***
### registry\_name?
> `optional` **registry\_name?**: `string`
Defined in: [zaun/js/index.d.ts:203](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L203)
The host operator's name for the registry: a label, never trust.
---
url: https://zaunchat.github.io/docs/reference/js/zaun-client/interfaces/catalogseen/
---
# CatalogSeen
Defined in: [zaun/js/index.d.ts:227](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L227)
What to store for a registry after a success, and pass back as `seen` next time.
## Properties
### serial
> **serial**: `number`
Defined in: [zaun/js/index.d.ts:228](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L228)
***
### sha3
> **sha3**: `string`
Defined in: [zaun/js/index.d.ts:229](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L229)
---
url: https://zaunchat.github.io/docs/reference/js/zaun-client/interfaces/catalogverification/
---
# CatalogVerification
Defined in: [zaun/js/index.d.ts:234](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L234)
`verifyCatalog`'s report. `ok` false: only `errors` holds. `ok` but not `installable`: the
catalog expired; show it with its advisories, never install or update from it.
## Properties
### bots
> **bots**: `number`
Defined in: [zaun/js/index.d.ts:247](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L247)
How many bots it lists.
***
### catalog
> **catalog**: `any`
Defined in: [zaun/js/index.d.ts:252](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L252)
The verified catalog (registry-spec format); `null` unless `ok`.
***
### errors
> **errors**: [`RegistryError`](/docs/reference/js/zaun-client/interfaces/registryerror/)[]
Defined in: [zaun/js/index.d.ts:253](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L253)
***
### expired
> **expired**: `boolean`
Defined in: [zaun/js/index.d.ts:245](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L245)
***
### expires
> **expires**: `number`
Defined in: [zaun/js/index.d.ts:244](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L244)
***
### installable
> **installable**: `boolean`
Defined in: [zaun/js/index.d.ts:236](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L236)
***
### issued\_at
> **issued\_at**: `number`
Defined in: [zaun/js/index.d.ts:243](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L243)
***
### name
> **name**: `string`
Defined in: [zaun/js/index.d.ts:240](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L240)
The registry's own name and profile: claims, never a badge.
***
### ok
> **ok**: `boolean`
Defined in: [zaun/js/index.d.ts:235](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L235)
***
### profile
> **profile**: `"official"` \| `"community"` \| `"private"`
Defined in: [zaun/js/index.d.ts:241](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L241)
***
### registry\_id
> **registry\_id**: `string`
Defined in: [zaun/js/index.d.ts:238](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L238)
The id of the pinned key that verified it.
***
### seen
> **seen**: [`CatalogSeen`](/docs/reference/js/zaun-client/interfaces/catalogseen/)
Defined in: [zaun/js/index.d.ts:250](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L250)
***
### serial
> **serial**: `number`
Defined in: [zaun/js/index.d.ts:242](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L242)
***
### sha3
> **sha3**: `string`
Defined in: [zaun/js/index.d.ts:249](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L249)
SHA3-256 of the catalog bytes, hex.
---
url: https://zaunchat.github.io/docs/reference/js/zaun-client/interfaces/clientevents/
---
# ClientEvents
Defined in: [zaun/js/index.d.ts:880](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L880)
## Properties
### appsReady
> **appsReady**: \[`community`: [`Community`](/docs/reference/js/zaun-client/classes/community/)\]
Defined in: [zaun/js/index.d.ts:921](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L921)
The community's bots and their commands loaded (just after `ready`).
***
### autocomplete
> **autocomplete**: \[`suggestions`: `object`\]
Defined in: [zaun/js/index.d.ts:934](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L934)
***
### botRemove
> **botRemove**: \[`community`: [`Community`](/docs/reference/js/zaun-client/classes/community/), `botId`: `string`, `member`: [`Member`](/docs/reference/js/zaun-client/classes/member/)\]
Defined in: [zaun/js/index.d.ts:928](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L928)
***
### botUpdate
> **botUpdate**: \[`community`: [`Community`](/docs/reference/js/zaun-client/classes/community/), `card`: [`BotCard`](/docs/reference/js/zaun-client/interfaces/botcard/)\]
Defined in: [zaun/js/index.d.ts:927](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L927)
***
### change
> **change**: \[\]
Defined in: [zaun/js/index.d.ts:918](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L918)
***
### channelCreate
> **channelCreate**: \[`channel`: [`Channel`](/docs/reference/js/zaun-client/classes/channel/)\]
Defined in: [zaun/js/index.d.ts:888](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L888)
***
### channelDelete
> **channelDelete**: \[`channel`: [`Channel`](/docs/reference/js/zaun-client/classes/channel/)\]
Defined in: [zaun/js/index.d.ts:890](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L890)
***
### channelUpdate
> **channelUpdate**: \[`channel`: [`Channel`](/docs/reference/js/zaun-client/classes/channel/)\]
Defined in: [zaun/js/index.d.ts:889](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L889)
***
### commandsUpdate
> **commandsUpdate**: \[`community`: [`Community`](/docs/reference/js/zaun-client/classes/community/), `botId`: `string`\]
Defined in: [zaun/js/index.d.ts:926](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L926)
***
### communityDelete
> **communityDelete**: \[`community`: [`Community`](/docs/reference/js/zaun-client/classes/community/), `reason`: `object`\]
Defined in: [zaun/js/index.d.ts:902](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L902)
This member left, or was kicked or banned, and the community is forgotten here. A
removal while this client was away arrives on its next session (a host after 0.4.0 says
it again after the welcome; a 0.4.0 host does not, and the community stays unreachable
until it is joined again). `reason.t`: `"left"`, `"kicked"`, `"banned"`, `"rejected"`, `"expired"`.
***
### communityMoved
> **communityMoved**: \[`community`: [`Community`](/docs/reference/js/zaun-client/classes/community/), `host`: `string`\]
Defined in: [zaun/js/index.d.ts:908](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L908)
***
### communityMoveRefused
> **communityMoveRefused**: \[`community`: [`Community`](/docs/reference/js/zaun-client/classes/community/), `code`: `string`\]
Defined in: [zaun/js/index.d.ts:909](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L909)
***
### communityMoving
> **communityMoving**: \[`community`: [`Community`](/docs/reference/js/zaun-client/classes/community/), `host`: `string`\]
Defined in: [zaun/js/index.d.ts:907](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L907)
***
### communityUpdate
> **communityUpdate**: \[`community`: [`Community`](/docs/reference/js/zaun-client/classes/community/)\]
Defined in: [zaun/js/index.d.ts:897](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L897)
***
### disconnect
> **disconnect**: \[`community`: [`Community`](/docs/reference/js/zaun-client/classes/community/)\]
Defined in: [zaun/js/index.d.ts:910](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L910)
***
### dmCreate
> **dmCreate**: \[`channel`: [`Channel`](/docs/reference/js/zaun-client/classes/channel/), `recipient`: [`Member`](/docs/reference/js/zaun-client/classes/member/)\]
Defined in: [zaun/js/index.d.ts:912](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L912)
DM: a direct message became known (opened by either side, or on load).
***
### dmDelete
> **dmDelete**: \[`channel`: [`Channel`](/docs/reference/js/zaun-client/classes/channel/)\]
Defined in: [zaun/js/index.d.ts:914](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L914)
DM: this member closed a direct message.
***
### interactionCreate
> **interactionCreate**: \[`interaction`: [`Interaction`](/docs/reference/js/zaun-client/classes/interaction/)\]
Defined in: [zaun/js/index.d.ts:930](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L930)
As a bot: someone used one of this bot's commands, components or modals.
***
### interactionFail
> **interactionFail**: \[`failure`: `object`\]
Defined in: [zaun/js/index.d.ts:935](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L935)
***
### interactionReply
> **interactionReply**: \[`reply`: `object`\]
Defined in: [zaun/js/index.d.ts:932](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L932)
A bot's ephemeral reply: only this member sees it, nothing keeps it; key by `message.id`.
***
### memberAdd
> **memberAdd**: \[`member`: [`Member`](/docs/reference/js/zaun-client/classes/member/)\]
Defined in: [zaun/js/index.d.ts:894](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L894)
***
### memberRemove
> **memberRemove**: \[`member`: [`Member`](/docs/reference/js/zaun-client/classes/member/), `reason`: `unknown`\]
Defined in: [zaun/js/index.d.ts:896](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L896)
***
### memberUpdate
> **memberUpdate**: \[`member`: [`Member`](/docs/reference/js/zaun-client/classes/member/)\]
Defined in: [zaun/js/index.d.ts:895](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L895)
***
### messageCreate
> **messageCreate**: \[`message`: [`Message`](/docs/reference/js/zaun-client/classes/message/)\]
Defined in: [zaun/js/index.d.ts:882](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L882)
***
### messageDelete
> **messageDelete**: \[`message`: [`Message`](/docs/reference/js/zaun-client/classes/message/), `by`: [`Member`](/docs/reference/js/zaun-client/classes/member/)\]
Defined in: [zaun/js/index.d.ts:884](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L884)
***
### messageDeleteBulk
> **messageDeleteBulk**: \[`messages`: [`Message`](/docs/reference/js/zaun-client/classes/message/)[], `channel`: [`Channel`](/docs/reference/js/zaun-client/classes/channel/)\]
Defined in: [zaun/js/index.d.ts:885](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L885)
***
### messageReactionAdd
> **messageReactionAdd**: \[`reaction`: `object`, `member`: [`Member`](/docs/reference/js/zaun-client/classes/member/)\]
Defined in: [zaun/js/index.d.ts:886](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L886)
***
### messageReactionRemove
> **messageReactionRemove**: \[`reaction`: `object`, `member`: [`Member`](/docs/reference/js/zaun-client/classes/member/)\]
Defined in: [zaun/js/index.d.ts:887](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L887)
***
### messageUpdate
> **messageUpdate**: \[`message`: [`Message`](/docs/reference/js/zaun-client/classes/message/)\]
Defined in: [zaun/js/index.d.ts:883](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L883)
***
### modalOpen
> **modalOpen**: \[`modal`: `object`\]
Defined in: [zaun/js/index.d.ts:933](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L933)
***
### offline
> **offline**: \[\]
Defined in: [zaun/js/index.d.ts:915](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L915)
***
### online
> **online**: \[\]
Defined in: [zaun/js/index.d.ts:916](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L916)
***
### presencesReady
> **presencesReady**: \[`community`: [`Community`](/docs/reference/js/zaun-client/classes/community/)\]
Defined in: [zaun/js/index.d.ts:923](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L923)
presence: who is online loaded (after `ready`).
***
### presenceUpdate
> **presenceUpdate**: \[`presence`: [`Presence`](/docs/reference/js/zaun-client/interfaces/presence/) & `object`\]
Defined in: [zaun/js/index.d.ts:925](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L925)
presence: a member's status or activity changed.
***
### raw
> **raw**: \[`update`: `object`\]
Defined in: [zaun/js/index.d.ts:919](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L919)
***
### ready
> **ready**: \[`community`: [`Community`](/docs/reference/js/zaun-client/classes/community/)\]
Defined in: [zaun/js/index.d.ts:881](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L881)
***
### roleCreate
> **roleCreate**: \[`role`: [`Role`](/docs/reference/js/zaun-client/classes/role/)\]
Defined in: [zaun/js/index.d.ts:891](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L891)
***
### roleDelete
> **roleDelete**: \[`role`: [`Role`](/docs/reference/js/zaun-client/classes/role/)\]
Defined in: [zaun/js/index.d.ts:893](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L893)
***
### roleUpdate
> **roleUpdate**: \[`role`: [`Role`](/docs/reference/js/zaun-client/classes/role/)\]
Defined in: [zaun/js/index.d.ts:892](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L892)
***
### typingStart
> **typingStart**: \[`typing`: `object`\]
Defined in: [zaun/js/index.d.ts:906](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L906)
Someone else is typing: `members` in a named channel; in an anonymous one `members` is
empty and `count` is 1, 2 or 3 (three or more).
***
### voiceStateUpdate
> **voiceStateUpdate**: \[`state`: [`VoiceState`](/docs/reference/js/zaun-client/interfaces/voicestate/)\]
Defined in: [zaun/js/index.d.ts:903](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L903)
***
### warning
> **warning**: \[`warning`: `object`\]
Defined in: [zaun/js/index.d.ts:917](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L917)
---
url: https://zaunchat.github.io/docs/reference/js/zaun-client/interfaces/commandoptiondata/
---
# CommandOptionData
Defined in: [zaun/js/index.d.ts:317](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L317)
## Properties
### autocomplete?
> `optional` **autocomplete?**: `boolean`
Defined in: [zaun/js/index.d.ts:329](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L329)
***
### channel\_types?
> `optional` **channel\_types?**: `unknown`[]
Defined in: [zaun/js/index.d.ts:324](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L324)
***
### choices?
> `optional` **choices?**: `object`[]
Defined in: [zaun/js/index.d.ts:322](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L322)
#### name
> **name**: `string`
#### value
> **value**: `string` \| `number`
***
### description
> **description**: `string`
Defined in: [zaun/js/index.d.ts:320](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L320)
***
### max\_length?
> `optional` **max\_length?**: `number`
Defined in: [zaun/js/index.d.ts:328](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L328)
***
### max\_value?
> `optional` **max\_value?**: `number`
Defined in: [zaun/js/index.d.ts:326](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L326)
***
### min\_length?
> `optional` **min\_length?**: `number`
Defined in: [zaun/js/index.d.ts:327](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L327)
***
### min\_value?
> `optional` **min\_value?**: `number`
Defined in: [zaun/js/index.d.ts:325](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L325)
***
### name
> **name**: `string`
Defined in: [zaun/js/index.d.ts:319](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L319)
***
### options?
> `optional` **options?**: `CommandOptionData`[]
Defined in: [zaun/js/index.d.ts:323](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L323)
***
### required?
> `optional` **required?**: `boolean`
Defined in: [zaun/js/index.d.ts:321](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L321)
***
### type
> **type**: `number`
Defined in: [zaun/js/index.d.ts:318](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L318)
---
url: https://zaunchat.github.io/docs/reference/js/zaun-client/interfaces/dmchanneldata/
---
# DmChannelData
Defined in: [zaun/js/index.d.ts:471](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L471)
DM: a DM channel object (a channel of kind `dm` and its two participants).
## Indexable
> \[`field`: `string`\]: `unknown`
## Properties
### channel\_id
> **channel\_id**: `string`
Defined in: [zaun/js/index.d.ts:472](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L472)
***
### participants
> **participants**: \[`string`, `string`\]
Defined in: [zaun/js/index.d.ts:473](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L473)
---
url: https://zaunchat.github.io/docs/reference/js/zaun-client/interfaces/dmsettings/
---
# DmSettings
Defined in: [zaun/js/index.d.ts:466](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L466)
DM: `member.settings.get` / `.update`.
## Properties
### dms\_from\_bots
> **dms\_from\_bots**: `boolean`
Defined in: [zaun/js/index.d.ts:467](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L467)
---
url: https://zaunchat.github.io/docs/reference/js/zaun-client/interfaces/embeddata/
---
# EmbedData
Defined in: [zaun/js/index.d.ts:490](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L490)
An embed as the protocol has it; pictures are attachment ids of the same message.
## Properties
### author?
> `optional` **author?**: `object`
Defined in: [zaun/js/index.d.ts:499](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L499)
#### icon?
> `optional` **icon?**: `string`
#### name
> **name**: `string`
#### url?
> `optional` **url?**: `string`
***
### color?
> `optional` **color?**: `number`
Defined in: [zaun/js/index.d.ts:496](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L496)
`0xRRGGBB`.
***
### description?
> `optional` **description?**: `string`
Defined in: [zaun/js/index.d.ts:492](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L492)
***
### fields?
> `optional` **fields?**: `object`[]
Defined in: [zaun/js/index.d.ts:503](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L503)
#### inline?
> `optional` **inline?**: `boolean`
#### name
> **name**: `string`
#### value
> **value**: `string`
***
### footer?
> `optional` **footer?**: `object`
Defined in: [zaun/js/index.d.ts:500](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L500)
#### icon?
> `optional` **icon?**: `string`
#### text
> **text**: `string`
***
### image?
> `optional` **image?**: `string`
Defined in: [zaun/js/index.d.ts:501](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L501)
***
### thumbnail?
> `optional` **thumbnail?**: `string`
Defined in: [zaun/js/index.d.ts:502](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L502)
***
### timestamp?
> `optional` **timestamp?**: `number`
Defined in: [zaun/js/index.d.ts:498](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L498)
ms since the epoch.
***
### title?
> `optional` **title?**: `string`
Defined in: [zaun/js/index.d.ts:491](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L491)
***
### url?
> `optional` **url?**: `string`
Defined in: [zaun/js/index.d.ts:494](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L494)
The title's link, `https://` only.
---
url: https://zaunchat.github.io/docs/reference/js/zaun-client/interfaces/embedfielddata/
---
# EmbedFieldData
Defined in: [zaun/js/index.d.ts:506](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L506)
## Properties
### inline?
> `optional` **inline?**: `boolean`
Defined in: [zaun/js/index.d.ts:509](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L509)
***
### name
> **name**: `string`
Defined in: [zaun/js/index.d.ts:507](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L507)
***
### value
> **value**: `string`
Defined in: [zaun/js/index.d.ts:508](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L508)
---
url: https://zaunchat.github.io/docs/reference/js/zaun-client/interfaces/filetosend/
---
# FileToSend
Defined in: [zaun/js/index.d.ts:477](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L477)
## Properties
### contentType?
> `optional` **contentType?**: `string`
Defined in: [zaun/js/index.d.ts:481](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L481)
Guessed from the name when not given.
***
### data
> **data**: `ArrayBuffer` \| `Blob` \| `Uint8Array`\<`ArrayBufferLike`\>
Defined in: [zaun/js/index.d.ts:479](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L479)
***
### name
> **name**: `string`
Defined in: [zaun/js/index.d.ts:478](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L478)
---
url: https://zaunchat.github.io/docs/reference/js/zaun-client/interfaces/historyverification/
---
# HistoryVerification
Defined in: [zaun/js/index.d.ts:257](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L257)
`verifyHistory`'s report.
## Properties
### errors
> **errors**: [`RegistryError`](/docs/reference/js/zaun-client/interfaces/registryerror/)[]
Defined in: [zaun/js/index.d.ts:263](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L263)
***
### history
> **history**: `any`
Defined in: [zaun/js/index.d.ts:262](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L262)
The verified history file; `null` unless `ok`.
***
### ok
> **ok**: `boolean`
Defined in: [zaun/js/index.d.ts:258](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L258)
***
### versions
> **versions**: `string`[]
Defined in: [zaun/js/index.d.ts:260](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L260)
The releases' versions, highest first.
---
url: https://zaunchat.github.io/docs/reference/js/zaun-client/interfaces/installsource/
---
# InstallSource
Defined in: [zaun/js/index.d.ts:207](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L207)
`installBot` / `updateBot`'s `source`: what the app verified the package against.
## Properties
### catalog
> **catalog**: `string`
Defined in: [zaun/js/index.d.ts:209](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L209)
Attachment id of the uploaded `catalog.json`, its exact bytes (at most 16 MiB).
***
### history?
> `optional` **history?**: `string`
Defined in: [zaun/js/index.d.ts:213](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L213)
Attachment id of the uploaded `history/.json`, for a version not in `latest`.
***
### signature
> **signature**: `string`
Defined in: [zaun/js/index.d.ts:211](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L211)
The text of `catalog.json.sig` (at most 4,608 bytes).
---
url: https://zaunchat.github.io/docs/reference/js/zaun-client/interfaces/mentionsdata/
---
# MentionsData
Defined in: [zaun/js/index.d.ts:592](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L592)
The protocol's mentions object.
## Properties
### everyone
> **everyone**: `boolean`
Defined in: [zaun/js/index.d.ts:593](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L593)
***
### members
> **members**: `string`[]
Defined in: [zaun/js/index.d.ts:594](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L594)
***
### roles
> **roles**: `string`[]
Defined in: [zaun/js/index.d.ts:595](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L595)
---
url: https://zaunchat.github.io/docs/reference/js/zaun-client/interfaces/mentionsinput/
---
# MentionsInput
Defined in: [zaun/js/index.d.ts:576](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L576)
Who a post notifies: ids, or the Member and Role objects. The host drops `everyone`, and
roles that are not mentionable, without `MENTION_EVERYONE`, and members not in the
community.
## Properties
### everyone?
> `optional` **everyone?**: `boolean`
Defined in: [zaun/js/index.d.ts:577](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L577)
***
### members?
> `optional` **members?**: (`string` \| [`Member`](/docs/reference/js/zaun-client/classes/member/))[]
Defined in: [zaun/js/index.d.ts:578](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L578)
***
### roles?
> `optional` **roles?**: (`string` \| [`Role`](/docs/reference/js/zaun-client/classes/role/))[]
Defined in: [zaun/js/index.d.ts:581](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L581)
***
### users?
> `optional` **users?**: (`string` \| [`Member`](/docs/reference/js/zaun-client/classes/member/))[]
Defined in: [zaun/js/index.d.ts:580](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L580)
Same as `members`.
---
url: https://zaunchat.github.io/docs/reference/js/zaun-client/interfaces/optionvaluedata/
---
# OptionValueData
Defined in: [zaun/js/index.d.ts:344](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L344)
An option value given to a command: `{ name, type, value?, options?, focused? }`.
## Properties
### focused?
> `optional` **focused?**: `boolean`
Defined in: [zaun/js/index.d.ts:349](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L349)
***
### name
> **name**: `string`
Defined in: [zaun/js/index.d.ts:345](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L345)
***
### options?
> `optional` **options?**: `OptionValueData`[]
Defined in: [zaun/js/index.d.ts:348](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L348)
***
### type
> **type**: `number`
Defined in: [zaun/js/index.d.ts:346](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L346)
***
### value?
> `optional` **value?**: `string` \| `number` \| `boolean`
Defined in: [zaun/js/index.d.ts:347](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L347)
---
url: https://zaunchat.github.io/docs/reference/js/zaun-client/interfaces/packageidentity/
---
# PackageIdentity
Defined in: [zaun/js/index.d.ts:267](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L267)
What a package's header says about itself.
## Extended by
- [`PackageInspection`](/docs/reference/js/zaun-client/interfaces/packageinspection/)
## Properties
### app\_id
> **app\_id**: `string`
Defined in: [zaun/js/index.d.ts:268](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L268)
***
### created\_at
> **created\_at**: `number`
Defined in: [zaun/js/index.d.ts:272](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L272)
***
### manifest
> **manifest**: `any`
Defined in: [zaun/js/index.d.ts:273](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L273)
***
### publisher\_id
> **publisher\_id**: `string`
Defined in: [zaun/js/index.d.ts:271](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L271)
***
### version
> **version**: `string`
Defined in: [zaun/js/index.d.ts:269](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L269)
***
### world
> **world**: `string`
Defined in: [zaun/js/index.d.ts:270](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L270)
---
url: https://zaunchat.github.io/docs/reference/js/zaun-client/interfaces/packageinspection/
---
# PackageInspection
Defined in: [zaun/js/index.d.ts:278](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L278)
`inspectPackage`'s report. The identity fields are set only when `signed_ok`; an unsigned
or badly signed file's claims are under `claimed`, never to be shown as fact.
## Extends
- [`PackageIdentity`](/docs/reference/js/zaun-client/interfaces/packageidentity/)
## Properties
### app\_id
> **app\_id**: `string`
Defined in: [zaun/js/index.d.ts:268](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L268)
#### Inherited from
[`PackageIdentity`](/docs/reference/js/zaun-client/interfaces/packageidentity/).[`app_id`](/docs/reference/js/zaun-client/interfaces/packageidentity/#app_id)
***
### claimed
> **claimed**: [`PackageIdentity`](/docs/reference/js/zaun-client/interfaces/packageidentity/)
Defined in: [zaun/js/index.d.ts:279](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L279)
***
### component\_size
> **component\_size**: `number`
Defined in: [zaun/js/index.d.ts:287](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L287)
***
### created\_at
> **created\_at**: `number`
Defined in: [zaun/js/index.d.ts:272](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L272)
#### Inherited from
[`PackageIdentity`](/docs/reference/js/zaun-client/interfaces/packageidentity/).[`created_at`](/docs/reference/js/zaun-client/interfaces/packageidentity/#created_at)
***
### errors
> **errors**: [`RegistryError`](/docs/reference/js/zaun-client/interfaces/registryerror/)[]
Defined in: [zaun/js/index.d.ts:289](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L289)
***
### header\_hash
> **header\_hash**: `string`
Defined in: [zaun/js/index.d.ts:285](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L285)
***
### manifest
> **manifest**: `any`
Defined in: [zaun/js/index.d.ts:273](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L273)
#### Inherited from
[`PackageIdentity`](/docs/reference/js/zaun-client/interfaces/packageidentity/).[`manifest`](/docs/reference/js/zaun-client/interfaces/packageidentity/#manifest)
***
### manifest\_sha3
> **manifest\_sha3**: `string`
Defined in: [zaun/js/index.d.ts:286](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L286)
***
### publisher\_id
> **publisher\_id**: `string`
Defined in: [zaun/js/index.d.ts:271](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L271)
#### Inherited from
[`PackageIdentity`](/docs/reference/js/zaun-client/interfaces/packageidentity/).[`publisher_id`](/docs/reference/js/zaun-client/interfaces/packageidentity/#publisher_id)
***
### sha3
> **sha3**: `string`
Defined in: [zaun/js/index.d.ts:284](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L284)
SHA3-256 of the whole file, hex: compare it with the catalog's `sha3`.
***
### signed\_ok
> **signed\_ok**: `boolean`
Defined in: [zaun/js/index.d.ts:280](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L280)
***
### size
> **size**: `number`
Defined in: [zaun/js/index.d.ts:288](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L288)
***
### valid
> **valid**: `boolean`
Defined in: [zaun/js/index.d.ts:282](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L282)
Every registry package check passed: signature, hashes, world, manifest, component.
***
### version
> **version**: `string`
Defined in: [zaun/js/index.d.ts:269](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L269)
#### Inherited from
[`PackageIdentity`](/docs/reference/js/zaun-client/interfaces/packageidentity/).[`version`](/docs/reference/js/zaun-client/interfaces/packageidentity/#version)
***
### world
> **world**: `string`
Defined in: [zaun/js/index.d.ts:270](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L270)
#### Inherited from
[`PackageIdentity`](/docs/reference/js/zaun-client/interfaces/packageidentity/).[`world`](/docs/reference/js/zaun-client/interfaces/packageidentity/#world)
---
url: https://zaunchat.github.io/docs/reference/js/zaun-client/interfaces/presence/
---
# Presence
Defined in: [zaun/js/index.d.ts:20](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L20)
presence: a member's status and activity as everyone sees it.
## Properties
### activity
> **activity**: [`Activity`](/docs/reference/js/zaun-client/interfaces/activity/)
Defined in: [zaun/js/index.d.ts:22](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L22)
***
### status
> **status**: `"online"` \| `"idle"` \| `"dnd"` \| `"offline"`
Defined in: [zaun/js/index.d.ts:21](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L21)
---
url: https://zaunchat.github.io/docs/reference/js/zaun-client/interfaces/registryerror/
---
# RegistryError
Defined in: [zaun/js/index.d.ts:219](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L219)
One finding, with the registry's stable code (`E-CATALOG-SIGNATURE`, …).
## Properties
### code
> **code**: `string`
Defined in: [zaun/js/index.d.ts:220](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L220)
***
### hint
> **hint**: `string`
Defined in: [zaun/js/index.d.ts:222](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L222)
***
### message
> **message**: `string`
Defined in: [zaun/js/index.d.ts:221](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L221)
***
### severity
> **severity**: `"error"` \| `"warning"`
Defined in: [zaun/js/index.d.ts:223](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L223)
---
url: https://zaunchat.github.io/docs/reference/js/zaun-client/interfaces/startoptions/
---
# StartOptions
Defined in: [zaun/js/index.d.ts:25](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L25)
## Properties
### changes?
> `optional` **changes?**: `Uint8Array`\<`ArrayBufferLike`\>[]
Defined in: [zaun/js/index.d.ts:36](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L36)
***
### commandTimeout?
> `optional` **commandTimeout?**: `number`
Defined in: [zaun/js/index.d.ts:38](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L38)
Milliseconds: a command (60 000), a join or creation (120 000), a file (600 000).
***
### joinTimeout?
> `optional` **joinTimeout?**: `number`
Defined in: [zaun/js/index.d.ts:39](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L39)
***
### key
> **key**: `string`
Defined in: [zaun/js/index.d.ts:27](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L27)
The store's passphrase.
***
### name?
> `optional` **name?**: `string`
Defined in: [zaun/js/index.d.ts:29](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L29)
The SimpleX profile name a new store starts with.
***
### relays?
> `optional` **relays?**: `string`[]
Defined in: [zaun/js/index.d.ts:31](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L31)
`smp://…` and `xftp://…` servers; the official ones without.
***
### snapshot?
> `optional` **snapshot?**: `Uint8Array`
Defined in: [zaun/js/index.d.ts:35](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L35)
A saved store (`client.save()`), and what changed since (`client.saveChanges()`).
***
### transferTimeout?
> `optional` **transferTimeout?**: `number`
Defined in: [zaun/js/index.d.ts:40](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L40)
***
### tunnel?
> `optional` **tunnel?**: `string`
Defined in: [zaun/js/index.d.ts:33](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L33)
In a browser: a WebSocket tunnel to the relays (`wss://…/v1`).
---
url: https://zaunchat.github.io/docs/reference/js/zaun-client/interfaces/voiceevents/
---
# VoiceEvents
Defined in: [zaun/js/index.d.ts:828](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L828)
## Properties
### audio
> **audio**: \[`event`: `object`\]
Defined in: [zaun/js/index.d.ts:836](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L836)
Node.js and Bun: one opened Opus frame (48 kHz) from a participant.
***
### connected
> **connected**: \[`event`: `object`\]
Defined in: [zaun/js/index.d.ts:832](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L832)
***
### ended
> **ended**: \[`event`: `object`\]
Defined in: [zaun/js/index.d.ts:839](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L839)
***
### joined
> **joined**: \[`participant`: `any`\]
Defined in: [zaun/js/index.d.ts:829](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L829)
***
### keyChanged
> **keyChanged**: \[`event`: `object`\]
Defined in: [zaun/js/index.d.ts:838](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L838)
***
### left
> **left**: \[`event`: `object`\]
Defined in: [zaun/js/index.d.ts:831](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L831)
***
### rekeyed
> **rekeyed**: \[`event`: `object`\]
Defined in: [zaun/js/index.d.ts:837](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L837)
***
### track
> **track**: \[`event`: `object`\]
Defined in: [zaun/js/index.d.ts:834](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L834)
Browsers: a participant's audio, to play.
***
### updated
> **updated**: \[`participant`: `any`\]
Defined in: [zaun/js/index.d.ts:830](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L830)
***
### warning
> **warning**: \[`event`: `object`\]
Defined in: [zaun/js/index.d.ts:840](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L840)
---
url: https://zaunchat.github.io/docs/reference/js/zaun-client/interfaces/voicestate/
---
# VoiceState
Defined in: [zaun/js/index.d.ts:864](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L864)
## Properties
### channel
> **channel**: [`Channel`](/docs/reference/js/zaun-client/classes/channel/)
Defined in: [zaun/js/index.d.ts:866](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L866)
***
### joined
> **joined**: `boolean`
Defined in: [zaun/js/index.d.ts:867](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L867)
***
### left
> **left**: `boolean`
Defined in: [zaun/js/index.d.ts:868](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L868)
***
### member
> **member**: [`Member`](/docs/reference/js/zaun-client/classes/member/)
Defined in: [zaun/js/index.d.ts:865](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L865)
***
### movedTo
> **movedTo**: [`Channel`](/docs/reference/js/zaun-client/classes/channel/)
Defined in: [zaun/js/index.d.ts:872](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L872)
Where a moderator moved them; null unless `left`.
***
### reason
> **reason**: `string`
Defined in: [zaun/js/index.d.ts:870](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L870)
Why they left; null unless `left`.
***
### selfDeaf
> **selfDeaf**: `boolean`
Defined in: [zaun/js/index.d.ts:875](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L875)
***
### selfMute
> **selfMute**: `boolean`
Defined in: [zaun/js/index.d.ts:874](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L874)
Mute and deafen: null when they left (a leave does not say).
***
### serverDeaf
> **serverDeaf**: `boolean`
Defined in: [zaun/js/index.d.ts:877](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L877)
***
### serverMute
> **serverMute**: `boolean`
Defined in: [zaun/js/index.d.ts:876](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L876)
---
url: https://zaunchat.github.io/docs/reference/js/zaun-client/type-aliases/botmessageoptions/
---
# BotMessageOptions
> **BotMessageOptions** = `string` \| \{ `allowedMentions?`: [`AllowedMentions`](/docs/reference/js/zaun-client/interfaces/allowedmentions/); `attachments?`: `string`[]; `components?`: ([`ComponentData`](/docs/reference/js/zaun-client/type-aliases/componentdata/) \| \{ `toJSON`(): [`ComponentData`](/docs/reference/js/zaun-client/type-aliases/componentdata/); \})[]; `content?`: `string`; `embeds?`: ([`EmbedBuilder`](/docs/reference/js/zaun-client/classes/embedbuilder/) \| [`EmbedData`](/docs/reference/js/zaun-client/interfaces/embeddata/))[]; `ephemeral?`: `boolean`; `flags?`: `number`; `mentions?`: [`MentionsInput`](/docs/reference/js/zaun-client/interfaces/mentionsinput/); \}
Defined in: [zaun/js/index.d.ts:355](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L355)
## Union Members
`string`
***
### Type Literal
\{ `allowedMentions?`: [`AllowedMentions`](/docs/reference/js/zaun-client/interfaces/allowedmentions/); `attachments?`: `string`[]; `components?`: ([`ComponentData`](/docs/reference/js/zaun-client/type-aliases/componentdata/) \| \{ `toJSON`(): [`ComponentData`](/docs/reference/js/zaun-client/type-aliases/componentdata/); \})[]; `content?`: `string`; `embeds?`: ([`EmbedBuilder`](/docs/reference/js/zaun-client/classes/embedbuilder/) \| [`EmbedData`](/docs/reference/js/zaun-client/interfaces/embeddata/))[]; `ephemeral?`: `boolean`; `flags?`: `number`; `mentions?`: [`MentionsInput`](/docs/reference/js/zaun-client/interfaces/mentionsinput/); \}
#### allowedMentions?
> `optional` **allowedMentions?**: [`AllowedMentions`](/docs/reference/js/zaun-client/interfaces/allowedmentions/)
As `send`'s, applied to the `content` given here: an edit that keeps its text and
gives this names nobody, clearing the mentions.
#### attachments?
> `optional` **attachments?**: `string`[]
#### components?
> `optional` **components?**: ([`ComponentData`](/docs/reference/js/zaun-client/type-aliases/componentdata/) \| \{ `toJSON`(): [`ComponentData`](/docs/reference/js/zaun-client/type-aliases/componentdata/); \})[]
#### content?
> `optional` **content?**: `string`
#### embeds?
> `optional` **embeds?**: ([`EmbedBuilder`](/docs/reference/js/zaun-client/classes/embedbuilder/) \| [`EmbedData`](/docs/reference/js/zaun-client/interfaces/embeddata/))[]
#### ephemeral?
> `optional` **ephemeral?**: `boolean`
#### flags?
> `optional` **flags?**: `number`
#### mentions?
> `optional` **mentions?**: [`MentionsInput`](/docs/reference/js/zaun-client/interfaces/mentionsinput/)
Who it notifies, as `send`'s. On `reply` and `followUp` none when absent; on `update`
and `editReply` absent keeps the message's mentions and any set replaces them (`{}`
clears).
---
url: https://zaunchat.github.io/docs/reference/js/zaun-client/type-aliases/componentdata/
---
# ComponentData
> **ComponentData** = `object`
Defined in: [zaun/js/index.d.ts:353](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L353)
A component as the wire has it; `type` is a ComponentType.
## Indexable
> \[`key`: `string`\]: `unknown`
## Properties
### type
> **type**: `number`
Defined in: [zaun/js/index.d.ts:353](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L353)
---
url: https://zaunchat.github.io/docs/reference/js/zaun-client/type-aliases/messageeditoptions/
---
# MessageEditOptions
> **MessageEditOptions** = `string` \| [`EmbedBuilder`](/docs/reference/js/zaun-client/classes/embedbuilder/) \| \{ `allowedMentions?`: [`AllowedMentions`](/docs/reference/js/zaun-client/interfaces/allowedmentions/); `content?`: `string`; `embeds?`: ([`EmbedBuilder`](/docs/reference/js/zaun-client/classes/embedbuilder/) \| [`EmbedData`](/docs/reference/js/zaun-client/interfaces/embeddata/))[] \| `null`; `mentions?`: [`MentionsInput`](/docs/reference/js/zaun-client/interfaces/mentionsinput/); \}
Defined in: [zaun/js/index.d.ts:629](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L629)
New text, an embed, or `{ content?, embeds?, mentions?, allowedMentions? }`: text not
given stays; `embeds` replaces them all (`[]` removes them) and may show only attachments
the message has.
## Union Members
`string`
***
[`EmbedBuilder`](/docs/reference/js/zaun-client/classes/embedbuilder/)
***
### Type Literal
\{ `allowedMentions?`: [`AllowedMentions`](/docs/reference/js/zaun-client/interfaces/allowedmentions/); `content?`: `string`; `embeds?`: ([`EmbedBuilder`](/docs/reference/js/zaun-client/classes/embedbuilder/) \| [`EmbedData`](/docs/reference/js/zaun-client/interfaces/embeddata/))[] \| `null`; `mentions?`: [`MentionsInput`](/docs/reference/js/zaun-client/interfaces/mentionsinput/); \}
#### allowedMentions?
> `optional` **allowedMentions?**: [`AllowedMentions`](/docs/reference/js/zaun-client/interfaces/allowedmentions/)
As `send`'s, applied to the text the message is left with (the new `content`, or
its own).
#### content?
> `optional` **content?**: `string`
#### embeds?
> `optional` **embeds?**: ([`EmbedBuilder`](/docs/reference/js/zaun-client/classes/embedbuilder/) \| [`EmbedData`](/docs/reference/js/zaun-client/interfaces/embeddata/))[] \| `null`
#### mentions?
> `optional` **mentions?**: [`MentionsInput`](/docs/reference/js/zaun-client/interfaces/mentionsinput/)
As `send`'s. With neither this nor `allowedMentions` the message keeps its mentions
(the edit sends none, and the host leaves them). With either, the ones named replace
them all: `{}` or nothing the content shows clears them, `@everyone` too. Naming
anyone needs SEND_MESSAGES and counts against the mentions rate limit
(`RATE_LIMITED`). zaun-host 0.4.0 or newer; an older host ignores it.
---
url: https://zaunchat.github.io/docs/reference/js/zaun-client/type-aliases/messageoptions/
---
# MessageOptions
> **MessageOptions** = `string` \| [`EmbedBuilder`](/docs/reference/js/zaun-client/classes/embedbuilder/) \| \{ `allowedMentions?`: [`AllowedMentions`](/docs/reference/js/zaun-client/interfaces/allowedmentions/); `content?`: `string`; `embeds?`: ([`EmbedBuilder`](/docs/reference/js/zaun-client/classes/embedbuilder/) \| [`EmbedData`](/docs/reference/js/zaun-client/interfaces/embeddata/))[]; `files?`: ([`FileToSend`](/docs/reference/js/zaun-client/interfaces/filetosend/) \| `Blob`)[]; `mentions?`: [`MentionsInput`](/docs/reference/js/zaun-client/interfaces/mentionsinput/); `reply?`: [`Message`](/docs/reference/js/zaun-client/classes/message/) \| `string`; \}
Defined in: [zaun/js/index.d.ts:557](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L557)
Text, an embed, or a whole message. Content may be empty beside embeds or files; files
and embed pictures are 10 at most in all.
## Union Members
`string`
***
[`EmbedBuilder`](/docs/reference/js/zaun-client/classes/embedbuilder/)
***
### Type Literal
\{ `allowedMentions?`: [`AllowedMentions`](/docs/reference/js/zaun-client/interfaces/allowedmentions/); `content?`: `string`; `embeds?`: ([`EmbedBuilder`](/docs/reference/js/zaun-client/classes/embedbuilder/) \| [`EmbedData`](/docs/reference/js/zaun-client/interfaces/embeddata/))[]; `files?`: ([`FileToSend`](/docs/reference/js/zaun-client/interfaces/filetosend/) \| `Blob`)[]; `mentions?`: [`MentionsInput`](/docs/reference/js/zaun-client/interfaces/mentionsinput/); `reply?`: [`Message`](/docs/reference/js/zaun-client/classes/message/) \| `string`; \}
#### allowedMentions?
> `optional` **allowedMentions?**: [`AllowedMentions`](/docs/reference/js/zaun-client/interfaces/allowedmentions/)
other libraries's: lets the mentions the content shows notify, all of a kind (`parse`) or
these ids only (`users`, `roles`).
#### content?
> `optional` **content?**: `string`
#### embeds?
> `optional` **embeds?**: ([`EmbedBuilder`](/docs/reference/js/zaun-client/classes/embedbuilder/) \| [`EmbedData`](/docs/reference/js/zaun-client/interfaces/embeddata/))[]
#### files?
> `optional` **files?**: ([`FileToSend`](/docs/reference/js/zaun-client/interfaces/filetosend/) \| `Blob`)[]
#### mentions?
> `optional` **mentions?**: [`MentionsInput`](/docs/reference/js/zaun-client/interfaces/mentionsinput/)
Who it notifies (each once; ≤ 50 members, ≤ 20 roles). The content only shows
mentions (`userMention`, `roleMention`); nothing in it notifies on its own.
#### reply?
> `optional` **reply?**: [`Message`](/docs/reference/js/zaun-client/classes/message/) \| `string`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-client/type-aliases/permissionflag/
---
# PermissionFlag
> **PermissionFlag** = `"ViewChannel"` \| `"ManageChannels"` \| `"ManageRoles"` \| `"ManageCommunity"` \| `"ViewAuditLog"` \| `"CreateInvite"` \| `"ManageInvites"` \| `"KickMembers"` \| `"BanMembers"` \| `"TimeoutMembers"` \| `"ManageWebhooks"` \| `"ManageEmojis"` \| `"Administrator"` \| `"ChangeNickname"` \| `"ManageNicknames"` \| `"ApproveMembers"` \| `"SendMessages"` \| `"ReadMessageHistory"` \| `"ManageMessages"` \| `"AttachFiles"` \| `"EmbedLinks"` \| `"AddReactions"` \| `"MentionEveryone"` \| `"CreateThreads"` \| `"ManageThreads"` \| `"SendMessagesInThreads"` \| `"BypassSlowmode"` \| `"Connect"` \| `"Speak"` \| `"Stream"` \| `"Video"` \| `"MuteMembers"` \| `"DeafenMembers"` \| `"MoveMembers"` \| `"ManageReports"` \| `"ManageSafety"` \| `"UseApplicationCommands"`
Defined in: [zaun/js/index.d.ts:61](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L61)
---
url: https://zaunchat.github.io/docs/reference/js/zaun-client/type-aliases/permissionresolvable/
---
# PermissionResolvable
> **PermissionResolvable** = `bigint` \| `string` \| [`Permissions`](/docs/reference/js/zaun-client/classes/permissions/) \| `PermissionResolvable`[]
Defined in: [zaun/js/index.d.ts:70](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L70)
---
url: https://zaunchat.github.io/docs/reference/js/zaun-client/type-aliases/picturesource/
---
# PictureSource
> **PictureSource** = [`FileToSend`](/docs/reference/js/zaun-client/interfaces/filetosend/) \| `Blob` \| [`Attachment`](/docs/reference/js/zaun-client/classes/attachment/) \| `string`
Defined in: [zaun/js/index.d.ts:487](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L487)
An embed's picture: a file to upload with the message (PNG, JPEG, GIF or WebP), a
`"attachment://name"` naming one of the message's `files`, or an attachment (an
Attachment, or its id). Never a URL: nothing is ever fetched from a third party.
---
url: https://zaunchat.github.io/docs/reference/js/zaun-client/variables/applicationcommandtype/
---
# ApplicationCommandType
> `const` **ApplicationCommandType**: `object`
Defined in: [zaun/js/index.d.ts:406](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L406)
## Type Declaration
### ChatInput
> **ChatInput**: `1`
### Message
> **Message**: `3`
### User
> **User**: `2`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-client/variables/buttonstyle/
---
# ButtonStyle
> `const` **ButtonStyle**: `object`
Defined in: [zaun/js/index.d.ts:402](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L402)
## Type Declaration
### Danger
> **Danger**: `4`
### Link
> **Link**: `5`
### Primary
> **Primary**: `1`
### Secondary
> **Secondary**: `2`
### Success
> **Success**: `3`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-client/variables/componenttype/
---
# ComponentType
> `const` **ComponentType**: `Record`\<`string`, `number`\>
Defined in: [zaun/js/index.d.ts:401](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L401)
---
url: https://zaunchat.github.io/docs/reference/js/zaun-client/variables/everyonemention/
---
# everyoneMention
> `const` **everyoneMention**: `"@everyone"`
Defined in: [zaun/js/index.d.ts:620](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L620)
---
url: https://zaunchat.github.io/docs/reference/js/zaun-client/variables/interactiontype/
---
# InteractionType
> `const` **InteractionType**: `object`
Defined in: [zaun/js/index.d.ts:405](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L405)
## Type Declaration
### ApplicationCommand
> **ApplicationCommand**: `2`
### Autocomplete
> **Autocomplete**: `4`
### MessageComponent
> **MessageComponent**: `3`
### ModalSubmit
> **ModalSubmit**: `5`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-client/variables/mentionlimits/
---
# MentionLimits
> `const` **MentionLimits**: `object`
Defined in: [zaun/js/index.d.ts:624](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L624)
## Type Declaration
### members
> `readonly` **members**: `50`
### roles
> `readonly` **roles**: `20`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-client/variables/messageflags/
---
# MessageFlags
> `const` **MessageFlags**: `object`
Defined in: [zaun/js/index.d.ts:404](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L404)
## Type Declaration
### Ephemeral
> **Ephemeral**: `64`
### IsComponentsV2
> **IsComponentsV2**: `32768`
### Loading
> **Loading**: `128`
### SuppressEmbeds
> **SuppressEmbeds**: `4`
### SuppressNotifications
> **SuppressNotifications**: `4096`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-client/variables/optiontype/
---
# OptionType
> `const` **OptionType**: `Record`\<`string`, `number`\>
Defined in: [zaun/js/index.d.ts:407](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L407)
---
url: https://zaunchat.github.io/docs/reference/js/zaun-client/variables/rawattachmentreader/
---
# RawAttachmentReader
> **RawAttachmentReader**: `any`
---
url: https://zaunchat.github.io/docs/reference/js/zaun-client/variables/textinputstyle/
---
# TextInputStyle
> `const` **TextInputStyle**: `object`
Defined in: [zaun/js/index.d.ts:403](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L403)
## Type Declaration
### Paragraph
> **Paragraph**: `2`
### Short
> **Short**: `1`
---
url: https://zaunchat.github.io/docs/reference/rust/
---
# Rust API
> Generated reference for the zaun-client, zaun-bot and zaun-community-protocol crates.
The Rust reference is generated from each crate's documentation on every deploy and every day:
| Crate | What it is | Browse |
|---|---|---|
| `zaun-client` | the client library for apps and external bots | [pages](/docs/reference/rust/zaun-client/) · [rustdoc HTML](/docs/api/rust/zaun-client/zaun_client/index.html) |
| `zaun-bot` | the SDK for hosted bots (built for `wasm32-wasip2`) | [pages](/docs/reference/rust/zaun-bot/) · [rustdoc HTML](/docs/api/rust/zaun-bot/zaun_bot/index.html) |
| `zaun-community-protocol` | the protocol: ids, messages, commands, events, permissions, signatures | [pages](/docs/reference/rust/zaun-community-protocol/) · [rustdoc HTML](/docs/api/rust/zaun-community-protocol/zaun_community_protocol/index.html) |
- **Pages** are one per public struct, enum, trait, function and type, with signatures, docs, fields,
variants and methods. They are searchable here and available as Markdown for AI tools.
- **rustdoc HTML** is the full output of `cargo doc`, with source links and rustdoc's own search.
> **Note**
>
> If the pages above are missing, this build ran without the generated reference (a local preview).
> Run `npm run gen` to generate it.
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/
---
# 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 {
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/) | |
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-client/
---
# zaun-client 0.6.0
> API reference of the zaun_client crate, generated from rustdoc.
Generated from rustdoc for `zaun_client` 0.6.0. [Browse the full rustdoc HTML](/docs/api/rust/zaun-client/zaun_client/index.html).
A Zaun community client over SimpleX: join, post, moderate and cache communities.
`Client` runs one SimpleX client and keeps a post-quantum connection per community to the
community's host (`zaun-host`). It verifies the host, registers a member key, and keeps a
local cache of each community (channels, roles, members) up to date from the host's events.
In the spirit of discord.js, what it reports are objects that act for themselves:
`Community`, `Channel`, `Message`, `Member`, `Role`, `Attachment`.
`Client::command` sends any command the objects do not wrap.
```rust
use zaun_client::{Client, Event};
let client = Client::builder("./bot").name("Ping bot").key("store passphrase").start()?;
let community = client.join("zaun://join/…", "Ping bot")?;
let general = community.channel_by_name("general").expect("a general channel");
general.send("hello")?;
for event in client.events() {
match event {
Event::MessageCreate(message) if message.content() == "!ping" => {
message.reply("pong")?;
}
Event::MemberAdd(member) => println!("welcome, {member}"),
_ => {}
}
}
```
Messages carry rich embeds as discord.js's do: build one with `EmbedBuilder` and post it
with `MessageOptions`. Its pictures are files uploaded as the message's attachments, never
remote URLs, so no reader's client fetches anything from a third party.
Voice channels join like discord.js's: `channel.join()?` gives a `VoiceSession`, and an
`AudioPlayer` subscribed to it plays files for a music bot.
The host is the authority: the cache and `Member::can` are a local view that lets an
application hide what a member cannot do, and the host still decides.
## Constants
| Item | Summary |
|---|---|
| [`mention::EVERYONE`](/docs/reference/rust/zaun-client/constant-mention-everyone/) | The text that shows `@everyone`. |
| [`TEXT_BUDGET`](/docs/reference/rust/zaun-client/constant-text_budget/) | The largest frame text, in bytes as written inside the JSON string that carries it (`framing::escaped_len`: every `"` or `\` counts twice), that one message always carries, uncompr |
| [`TYPING_SHOWN_MS`](/docs/reference/rust/zaun-client/constant-typing_shown_ms/) | How long one typing signal shows: the host repeats it at most every 3 s while typing goes on, so two missed repeats end it. |
## Enums
| Item | Summary |
|---|---|
| [`AudioPlayerEvent`](/docs/reference/rust/zaun-client/enum-audioplayerevent/) | What a player tells the application. |
| [`AudioPlayerStatus`](/docs/reference/rust/zaun-client/enum-audioplayerstatus/) | What a player is doing. |
| [`ui::EntityKind`](/docs/reference/rust/zaun-client/enum-ui-entitykind/) | What an entity select offers. |
| [`Error`](/docs/reference/rust/zaun-client/enum-error/) | A `zaun-client` failure. |
| [`Event`](/docs/reference/rust/zaun-client/enum-event/) | One thing that happened. |
| [`Picture`](/docs/reference/rust/zaun-client/enum-picture/) | Where an embed's picture (or a message's file) comes from. Pictures are never remote URLs: a file is uploaded as one of the message's attachments, so no reader's client ever fetche |
| [`TypingNow`](/docs/reference/rust/zaun-client/enum-typingnow/) | Who else is typing in a channel, as the host last said. This client is never among them. |
| [`VoiceEvent`](/docs/reference/rust/zaun-client/enum-voiceevent/) | What happens in a voice session. |
## Functions
| Item | Summary |
|---|---|
| [`presence::activity`](/docs/reference/rust/zaun-client/function-presence-activity/) | An activity of `kind` named `name`, for `Client::set_presence`. Set `details`, `state`, `started_at`, `url` (streaming) or `emoji` (custom) on it as needed. |
| [`files::guess_mime`](/docs/reference/rust/zaun-client/function-files-guess_mime/) | A media type from a file name's extension; `application/octet-stream` otherwise. |
| [`registry::inspect_package`](/docs/reference/rust/zaun-client/function-registry-inspect_package/) | What a `.zbot` file says, whether its signature verifies and whether it passes the registry's package checks. |
| [`registry::key_id`](/docs/reference/rust/zaun-client/function-registry-key_id/) | The id of a base64url public key: what a bot card's `source.registry_id` is compared with. |
| [`presence::line`](/docs/reference/rust/zaun-client/function-presence-line/) | "Playing {name}", "Streaming {name}", "Listening to {name}", "Watching {name}", "Competing in {name}", or `{emoji} {name}` for a custom one. |
| [`files::measure`](/docs/reference/rust/zaun-client/function-files-measure/) | The size and SHA3-256 of the file at `path`. |
| [`mention::member`](/docs/reference/rust/zaun-client/function-mention-member/) | The text that shows a member mention, `<@id>` (discord.js `userMention`). It only shows where the mention is: the message's mentions list is what notifies. |
| [`mention::parse`](/docs/reference/rust/zaun-client/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 50 members and 20 roles; malformed ids |
| [`mention::role`](/docs/reference/rust/zaun-client/function-mention-role/) | The text that shows a role mention, `<@&id>` (discord.js `roleMention`). |
| [`files::safe_name`](/docs/reference/rust/zaun-client/function-files-safe_name/) | A name for `name` that is safe as one path component: no separators, no control characters, no leading dots; `attachment` when nothing is left. |
| [`registry::verify_catalog`](/docs/reference/rust/zaun-client/function-registry-verify_catalog/) | Verifies `catalog.json` bytes and the text of `catalog.json.sig` against the key of `pinned` (base64url public keys) that the catalog names, at Unix time `now` (seconds), after `se |
| [`registry::verify_history`](/docs/reference/rust/zaun-client/function-registry-verify_history/) | Verifies the catalog as `verify_catalog` does (no stored serial), then `history/.json` against the hash the verified catalog lists for it. |
## Structs
| Item | Summary |
|---|---|
| [`ui::ActionRow`](/docs/reference/rust/zaun-client/struct-ui-actionrow/) | A row of up to five buttons, or one select. |
| [`Attachment`](/docs/reference/rust/zaun-client/struct-attachment/) | A file on a message. |
| [`AudioPlayer`](/docs/reference/rust/zaun-client/struct-audioplayer/) | Plays `AudioResource`s, one at a time, into every subscribed voice session. |
| [`AudioResource`](/docs/reference/rust/zaun-client/struct-audioresource/) | Something to play: Opus packets, from an Ogg Opus file or stream, from ffmpeg (any format it reads), or from the application. |
| [`ui::Button`](/docs/reference/rust/zaun-client/struct-ui-button/) | A button: one that sends an interaction (`custom_id`), or a link the reader confirms. |
| [`registry::CatalogCheck`](/docs/reference/rust/zaun-client/struct-registry-catalogcheck/) | `verify_catalog`'s answer: the registry's report and, when `ok`, the verified catalog. |
| [`Channel`](/docs/reference/rust/zaun-client/struct-channel/) | A channel or category of a community. |
| [`ui::Checkbox`](/docs/reference/rust/zaun-client/struct-ui-checkbox/) | One yes/no box (type 23); never required. |
| [`ui::CheckboxGroup`](/docs/reference/rust/zaun-client/struct-ui-checkboxgroup/) | Several choices (type 22). |
| [`Client`](/docs/reference/rust/zaun-client/struct-client/) | A Zaun client. Clones share one SimpleX client and one driver; methods may be called from any thread, and block until the host answers or the timeout passes. |
| [`ClientBuilder`](/docs/reference/rust/zaun-client/struct-clientbuilder/) | Configures a `Client`. The directory holds the SimpleX store and `zaun/`, the community keys and state; give every client its own. |
| [`ui::CommandBuilder`](/docs/reference/rust/zaun-client/struct-ui-commandbuilder/) | A slash, user or message command. |
| [`Community`](/docs/reference/rust/zaun-client/struct-community/) | A community this client belongs to (or did: a handle outlives a leave). |
| [`CommunityData`](/docs/reference/rust/zaun-client/struct-communitydata/) | A community as this client last heard of it. Cheap to clone; a clone does not update. |
| [`ui::Container`](/docs/reference/rust/zaun-client/struct-ui-container/) | A box around other components (type 17). |
| [`DmChannel`](/docs/reference/rust/zaun-client/struct-dmchannel/) | A DM channel: an ordinary channel object of kind `dm` with its two participants. |
| [`EditMessage`](/docs/reference/rust/zaun-client/struct-editmessage/) | An edit of one of this member's messages. A plain `&str` replaces the text and leaves the embeds and mentions as they are. |
| [`EmbedBuilder`](/docs/reference/rust/zaun-client/struct-embedbuilder/) | A rich embed, built with chained setters and sent with `MessageOptions::embed`: |
| [`EphemeralReply`](/docs/reference/rust/zaun-client/struct-ephemeralreply/) | A bot's ephemeral reply (`EPHEMERAL`): only this member sees it, nothing stores it, and it lives as long as the interaction (15 minutes). Key it by its message's `message_id`. |
| [`FfmpegOptions`](/docs/reference/rust/zaun-client/struct-ffmpegoptions/) | How `AudioResource::ffmpeg_file` and its siblings transcode. |
| [`ui::File`](/docs/reference/rust/zaun-client/struct-ui-file/) | One attached file (type 13). |
| [`ui::FileUpload`](/docs/reference/rust/zaun-client/struct-ui-fileupload/) | Files the member uploads (type 19). |
| [`HandOff`](/docs/reference/rust/zaun-client/struct-handoff/) | What a hand-off signed and published: the new delegation and the descriptor naming it. |
| [`registry::HistoryCheck`](/docs/reference/rust/zaun-client/struct-registry-historycheck/) | `verify_history`'s answer: the registry's report and, when `ok`, the verified history. |
| [`Interaction`](/docs/reference/rust/zaun-client/struct-interaction/) | Someone used one of this bot's commands, components or modals. Answer within 3 s (`respond`, or `Response::defer` first); follow-ups and edits work for 15 minutes. |
| [`InteractionFailure`](/docs/reference/rust/zaun-client/struct-interactionfailure/) | An interaction that got no answer (the bot timed out, failed or is not running). |
| [`registry::KeyIdReport`](/docs/reference/rust/zaun-client/struct-registry-keyidreport/) | `key_id`'s answer. |
| [`ui::MediaGallery`](/docs/reference/rust/zaun-client/struct-ui-mediagallery/) | Up to ten pictures (type 12). |
| [`Member`](/docs/reference/rust/zaun-client/struct-member/) | A member of a community. |
| [`Message`](/docs/reference/rust/zaun-client/struct-message/) | A message in a channel. |
| [`MessageOptions`](/docs/reference/rust/zaun-client/struct-messageoptions/) | A message to post: text, embeds, files and the message it answers. A plain `&str` is one with text only, so `channel.send("hi")` still reads as it did. |
| [`ui::Modal`](/docs/reference/rust/zaun-client/struct-ui-modal/) | A modal: up to five labelled inputs and texts. |
| [`ModalOpen`](/docs/reference/rust/zaun-client/struct-modalopen/) | A bot asks this member to fill in a modal; submit it with `Channel::submit_modal` and `interaction` as the modal id. |
| [`ui::OptionBuilder`](/docs/reference/rust/zaun-client/struct-ui-optionbuilder/) | An option of a slash command. |
| [`PartialMessage`](/docs/reference/rust/zaun-client/struct-partialmessage/) | A message known only by its id, as an edit, a deletion or a reaction names it: the client keeps no message history, so its text and author are not at hand. It acts like a `Message` |
| [`PendingMessage`](/docs/reference/rust/zaun-client/struct-pendingmessage/) | A post on its way (`Channel::send_pending`): what to show until the host answers. |
| [`Presence`](/docs/reference/rust/zaun-client/struct-presence/) | A member's presence as everyone else sees it (`invisible` members look `Offline`). |
| [`ui::RadioGroup`](/docs/reference/rust/zaun-client/struct-ui-radiogroup/) | One choice among options (type 21). |
| [`Reaction`](/docs/reference/rust/zaun-client/struct-reaction/) | A reaction added or taken off. |
| [`Response`](/docs/reference/rust/zaun-client/struct-response/) | What a bot answers an interaction with. Build one with the constructors. |
| [`Role`](/docs/reference/rust/zaun-client/struct-role/) | A role of a community. |
| [`ui::Section`](/docs/reference/rust/zaun-client/struct-ui-section/) | One to three texts with a button or thumbnail beside them (type 9). |
| [`ui::Select`](/docs/reference/rust/zaun-client/struct-ui-select/) | A select menu. |
| [`ui::Separator`](/docs/reference/rust/zaun-client/struct-ui-separator/) | A line or a gap (type 14). |
| [`Suggestions`](/docs/reference/rust/zaun-client/struct-suggestions/) | A bot's suggestions for the option this member is typing. |
| [`ui::TextDisplay`](/docs/reference/rust/zaun-client/struct-ui-textdisplay/) | Markdown text (type 10). |
| [`ui::TextInput`](/docs/reference/rust/zaun-client/struct-ui-textinput/) | A text field. |
| [`ui::Thumbnail`](/docs/reference/rust/zaun-client/struct-ui-thumbnail/) | A picture beside a section (type 11). |
| [`TypingSeen`](/docs/reference/rust/zaun-client/struct-typingseen/) | A typing state and when it stops showing. |
| [`VoiceLeave`](/docs/reference/rust/zaun-client/struct-voiceleave/) | Why someone left a voice channel. |
| [`VoiceMute`](/docs/reference/rust/zaun-client/struct-voicemute/) | Someone's mute and deafen state in a voice channel. |
| [`VoiceOptions`](/docs/reference/rust/zaun-client/struct-voiceoptions/) | How a voice session connects. |
| [`VoiceSession`](/docs/reference/rust/zaun-client/struct-voicesession/) | One stay in a voice channel. Dropping it leaves the channel. |
| [`VoiceState`](/docs/reference/rust/zaun-client/struct-voicestate/) | Someone's state in a voice channel. |
## Type aliass
| Item | Summary |
|---|---|
| [`Result`](/docs/reference/rust/zaun-client/type-alias-result/) | `Result` with `Error`. |
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-community-protocol/
---
# zaun-community-protocol 0.4.1
> API reference of the zaun_community_protocol crate, generated from rustdoc.
Generated from rustdoc for `zaun_community_protocol` 0.4.1. [Browse the full rustdoc HTML](/docs/api/rust/zaun-community-protocol/zaun_community_protocol/index.html).
Zaun community protocol (`docs/community-protocol/specification.md`).
Pure data and functions: identifiers, canonical encoding, RFC 10073 composite post-quantum
signatures, signed objects, permissions, envelopes, commands, events and limits. No I/O, no
clock (time is always a parameter), no dependency on `simplex-client` (ADR-0001, ADR-0012).
## Constants
| Item | Summary |
|---|---|
| [`limits::ACK_CHANNELS`](/docs/reference/rust/zaun-community-protocol/constant-limits-ack_channels/) | `sync.ack` channels. |
| [`client::ACK_LINGER_MS`](/docs/reference/rust/zaun-community-protocol/constant-client-ack_linger_ms/) | How long a due `sync.ack` waits for a command to go with. A SimpleX connection sends one message at a time, so a command sent right after a lone ack would wait a relay round trip b |
| [`limits::ACTIVITY_MAX`](/docs/reference/rust/zaun-community-protocol/constant-limits-activity_max/) | Presence `activity`, maximum scalars. |
| [`permissions::ALL`](/docs/reference/rust/zaun-community-protocol/constant-permissions-all/) | `ALL` means every known bit, never `u64::MAX` (permissions the protocol). |
| [`limits::APP_CHOICE_TEXT`](/docs/reference/rust/zaun-community-protocol/constant-limits-app_choice_text/) | Choice `name` and string `value`, scalars. |
| [`limits::APP_COMMAND_DESCRIPTION`](/docs/reference/rust/zaun-community-protocol/constant-limits-app_command_description/) | Command and option `description` (`CHAT_INPUT`), scalars. |
| [`limits::APP_COMMAND_NAME`](/docs/reference/rust/zaun-community-protocol/constant-limits-app_command_name/) | Command and option `name`, scalars. |
| [`limits::APP_COMMAND_OPTIONS`](/docs/reference/rust/zaun-community-protocol/constant-limits-app_command_options/) | Options per command or subcommand, and choices per option. |
| [`limits::APP_COMMAND_TEXT_TOTAL`](/docs/reference/rust/zaun-community-protocol/constant-limits-app_command_text_total/) | All names, descriptions, choice names and values of one command, scalars. |
| [`limits::APP_COMMANDS`](/docs/reference/rust/zaun-community-protocol/constant-limits-app_commands/) | Application commands per bot: `CHAT_INPUT`, `USER`, `MESSAGE`. |
| [`signed::APP_ID_MAX`](/docs/reference/rust/zaun-community-protocol/constant-signed-app_id_max/) | Bytes of `app_id` (3–64). |
| [`limits::APP_LOCALIZATIONS`](/docs/reference/rust/zaun-community-protocol/constant-limits-app_localizations/) | Localized names per field. |
| [`limits::APP_OPTION_LENGTH_MAX`](/docs/reference/rust/zaun-community-protocol/constant-limits-app_option_length_max/) | String option `min_length` / `max_length` bound. |
| [`limits::ATTACHMENT_MIME_MAX`](/docs/reference/rust/zaun-community-protocol/constant-limits-attachment_mime_max/) | Attachment media type, bytes. |
| [`limits::ATTACHMENT_NAME`](/docs/reference/rust/zaun-community-protocol/constant-limits-attachment_name/) | Attachment file name, scalars. |
| [`limits::ATTACHMENT_SIZE_MAX`](/docs/reference/rust/zaun-community-protocol/constant-limits-attachment_size_max/) | Largest attachment the protocol allows, in bytes (XFTP's 1 GiB); hosts set lower limits. |
| [`limits::ATTACHMENTS_PER_MESSAGE`](/docs/reference/rust/zaun-community-protocol/constant-limits-attachments_per_message/) | Attachments per message. |
| [`command::object::AUDIT_ACTIONS`](/docs/reference/rust/zaun-community-protocol/constant-command-object-audit_actions/) | Every audit action of the protocol, expanded from its `a.b\|c` notation. |
| [`limits::AUTOCOMPLETE_CHOICES`](/docs/reference/rust/zaun-community-protocol/constant-limits-autocomplete_choices/) | Autocomplete choices. |
| [`limits::BAN_DELETE_WINDOW_MAX_MS`](/docs/reference/rust/zaun-community-protocol/constant-limits-ban_delete_window_max_ms/) | Ban message-deletion window upper bound in milliseconds (7 days). |
| [`crypto::voice::BASE_KEY_LEN`](/docs/reference/rust/zaun-community-protocol/constant-crypto-voice-base_key_len/) | An SFrame base key: 32 bytes. |
| [`limits::BOT_COMPONENT_MAX`](/docs/reference/rust/zaun-community-protocol/constant-limits-bot_component_max/) | The WebAssembly component inside a bot package, bytes. |
| [`limits::BOT_CONFIG_KEYS`](/docs/reference/rust/zaun-community-protocol/constant-limits-bot_config_keys/) | Settings a bot may declare (`config`). |
| [`limits::BOT_CONFIG_VALUE_MAX`](/docs/reference/rust/zaun-community-protocol/constant-limits-bot_config_value_max/) | A setting's value or default, bytes. |
| [`limits::BOT_DESCRIPTION_MAX`](/docs/reference/rust/zaun-community-protocol/constant-limits-bot_description_max/) | A bot's `description`, scalars. |
| [`limits::BOT_HEADER_MAX`](/docs/reference/rust/zaun-community-protocol/constant-limits-bot_header_max/) | Bot package header, manifest and component sizes, bytes. |
| [`limits::BOT_LOCAL_NETWORK`](/docs/reference/rust/zaun-community-protocol/constant-limits-bot_local_network/) | `local_network` addresses a bot may ask for. |
| [`limits::BOT_MANIFEST_MAX`](/docs/reference/rust/zaun-community-protocol/constant-limits-bot_manifest_max/) | The manifest JSON inside a bot package, bytes. |
| [`limits::BOT_NETWORK_HOSTS`](/docs/reference/rust/zaun-community-protocol/constant-limits-bot_network_hosts/) | Network hosts a bot may ask for. |
| [`limits::BOT_STORAGE_MAX`](/docs/reference/rust/zaun-community-protocol/constant-limits-bot_storage_max/) | A bot's key-value storage quota, bytes. |
| [`limits::BOTS_PER_COMMUNITY`](/docs/reference/rust/zaun-community-protocol/constant-limits-bots_per_community/) | Bots per community. |
| [`limits::BULK_DELETE_MAX`](/docs/reference/rust/zaun-community-protocol/constant-limits-bulk_delete_max/) | Most message ids in one `messages.bulk_deleted` event. |
| [`limits::BUTTON_LABEL_MAX`](/docs/reference/rust/zaun-community-protocol/constant-limits-button_label_max/) | Button `label`, scalars. |
| [`limits::CAPABILITIES`](/docs/reference/rust/zaun-community-protocol/constant-limits-capabilities/) | `session.hello` capabilities: count and bytes each. |
| [`command::attachment::CAPTION_PREFIX`](/docs/reference/rust/zaun-community-protocol/constant-command-attachment-caption_prefix/) | What every Zaun file transfer's caption starts with; the attachment id follows. |
| [`limits::CHANNEL_NAME`](/docs/reference/rust/zaun-community-protocol/constant-limits-channel_name/) | Channel name length. |
| [`limits::CHANNEL_TOPIC_MAX`](/docs/reference/rust/zaun-community-protocol/constant-limits-channel_topic_max/) | Channel topic, maximum scalars. |
| [`limits::CHANNELS_PER_COMMUNITY`](/docs/reference/rust/zaun-community-protocol/constant-limits-channels_per_community/) | Channels per community, including categories. |
| [`limits::CHECKBOX_OPTIONS`](/docs/reference/rust/zaun-community-protocol/constant-limits-checkbox_options/) | Checkbox group options. |
| [`client::CLIENT_CAPABILITIES`](/docs/reference/rust/zaun-community-protocol/constant-client-client_capabilities/) | Capabilities this client offers in `session.hello`: fragment reassembly. |
| [`signed::CLOCK_SKEW_MS`](/docs/reference/rust/zaun-community-protocol/constant-signed-clock_skew_ms/) | Clock-skew allowance on delegation validity windows (rule 4), in milliseconds. |
| [`limits::COLOR_MAX`](/docs/reference/rust/zaun-community-protocol/constant-limits-color_max/) | Largest role colour, `0xFFFFFF`. |
| [`limits::COMMUNITY_DESCRIPTION_MAX`](/docs/reference/rust/zaun-community-protocol/constant-limits-community_description_max/) | Community description, maximum scalars. |
| [`limits::COMMUNITY_NAME`](/docs/reference/rust/zaun-community-protocol/constant-limits-community_name/) | Community name length (scalars). |
| [`limits::COMPONENT_CUSTOM_ID`](/docs/reference/rust/zaun-community-protocol/constant-limits-component_custom_id/) | Component `custom_id`, bytes. |
| [`limits::COMPONENT_ROW_BUTTONS`](/docs/reference/rust/zaun-community-protocol/constant-limits-component_row_buttons/) | Buttons per action row. |
| [`limits::COMPONENT_ROWS`](/docs/reference/rust/zaun-community-protocol/constant-limits-component_rows/) | Top-level action rows of a message without `IS_COMPONENTS_V2`. |
| [`limits::COMPONENTS_TOTAL`](/docs/reference/rust/zaun-community-protocol/constant-limits-components_total/) | Components in one message, counting nested ones. |
| [`framing::app_data::DATA_TAG`](/docs/reference/rust/zaun-community-protocol/constant-framing-app_data-data_tag/) | The content type of a frame message (`MsgContent` `type`). |
| [`limits::DAY_MS`](/docs/reference/rust/zaun-community-protocol/constant-limits-day_ms/) | One day in milliseconds. |
| [`client::DEFAULT_TEXT_BUDGET`](/docs/reference/rust/zaun-community-protocol/constant-client-default_text_budget/) | Default per-message text budget in UTF-8 bytes. The real value is fixed by the transport adapter from `simplex_client::limits`; this crate never depends on it. |
| [`limits::DISPLAY_NAME`](/docs/reference/rust/zaun-community-protocol/constant-limits-display_name/) | Member display name length. |
| [`permissions::DM_GRANTS`](/docs/reference/rust/zaun-community-protocol/constant-permissions-dm_grants/) | What both participants of a `dm` channel may always do. |
| [`permissions::DM_IF_GRANTED`](/docs/reference/rust/zaun-community-protocol/constant-permissions-dm_if_granted/) | What a participant may do in a `dm` channel only when its roles grant it in the community. |
| [`limits::DM_OPENS_PER_MINUTE`](/docs/reference/rust/zaun-community-protocol/constant-limits-dm_opens_per_minute/) | New DMs one bot may open per minute. |
| [`limits::DM_UNANSWERED_PER_HOUR`](/docs/reference/rust/zaun-community-protocol/constant-limits-dm_unanswered_per_hour/) | Messages a bot may write into a DM per hour while the member has never written in it. |
| [`keys::ED25519_PK_LEN`](/docs/reference/rust/zaun-community-protocol/constant-keys-ed25519_pk_len/) | Ed25519 public key length. |
| [`keys::ED25519_SIG_LEN`](/docs/reference/rust/zaun-community-protocol/constant-keys-ed25519_sig_len/) | Ed25519 signature length. |
| [`limits::EMBED_AUTHOR_NAME`](/docs/reference/rust/zaun-community-protocol/constant-limits-embed_author_name/) | Embed `author.name`, scalars. |
| [`limits::EMBED_DESCRIPTION`](/docs/reference/rust/zaun-community-protocol/constant-limits-embed_description/) | Embed `description`, scalars. |
| [`limits::EMBED_FIELD_NAME`](/docs/reference/rust/zaun-community-protocol/constant-limits-embed_field_name/) | Embed field `name`, scalars. |
| [`limits::EMBED_FIELD_VALUE`](/docs/reference/rust/zaun-community-protocol/constant-limits-embed_field_value/) | Embed field `value`, scalars. |
| [`limits::EMBED_FIELDS`](/docs/reference/rust/zaun-community-protocol/constant-limits-embed_fields/) | Fields per embed. |
| [`limits::EMBED_FOOTER_TEXT`](/docs/reference/rust/zaun-community-protocol/constant-limits-embed_footer_text/) | Embed `footer.text`, scalars. |
| [`limits::EMBED_TEXT_TOTAL`](/docs/reference/rust/zaun-community-protocol/constant-limits-embed_text_total/) | The text of all of a message's embeds together (titles, descriptions, field names and values, author names, footer texts), scalars. |
| [`limits::EMBED_TITLE`](/docs/reference/rust/zaun-community-protocol/constant-limits-embed_title/) | Embed `title`, scalars. |
| [`limits::EMBED_URL_MAX`](/docs/reference/rust/zaun-community-protocol/constant-limits-embed_url_max/) | Embed `url` and `author.url`, maximum bytes. |
| [`limits::EMBEDS_PER_MESSAGE`](/docs/reference/rust/zaun-community-protocol/constant-limits-embeds_per_message/) | Embeds per message. |
| [`limits::EMOJI_MAX_BYTES`](/docs/reference/rust/zaun-community-protocol/constant-limits-emoji_max_bytes/) | Emoji, maximum bytes. |
| [`signed::ENTRY_NAME_MAX`](/docs/reference/rust/zaun-community-protocol/constant-signed-entry_name_max/) | Bytes per chunk name. |
| [`command::object::flags::EPHEMERAL`](/docs/reference/rust/zaun-community-protocol/constant-command-object-flags-ephemeral/) | Only the invoker sees it; never stored. |
| [`client::EVENTS_BATCH_TYPE`](/docs/reference/rust/zaun-community-protocol/constant-client-events_batch_type/) | `type` of the coalesced event batch envelope. |
| [`envelope::EVENTS_TYPE`](/docs/reference/rust/zaun-community-protocol/constant-envelope-events_type/) | The `type` of a batch envelope: a frame type, not an event type. |
| [`permissions::EXPENSIVE_HISTORY_DEPTH`](/docs/reference/rust/zaun-community-protocol/constant-permissions-expensive_history_depth/) | `restrict_expensive`: a restricted member reads only the newest this-many sequences of a channel, `sequence > head − EXPENSIVE_HISTORY_DEPTH`. One full `message.history` page. |
| [`permissions::EXPENSIVE_MEMBER_PAGE`](/docs/reference/rust/zaun-community-protocol/constant-permissions-expensive_member_page/) | `restrict_expensive`: the most members one `member.list` page returns to a restricted member, who gets only the first page. |
| [`signed::EXPORT_FORMAT`](/docs/reference/rust/zaun-community-protocol/constant-signed-export_format/) | The bundle format this manifest describes. |
| [`framing::app_data::FALLBACK_TEXT`](/docs/reference/rust/zaun-community-protocol/constant-framing-app_data-fallback_text/) | What an app that does not know `DATA_TAG` shows. Fixed: it never carries frame content. |
| [`limits::FILE_UPLOAD_MAX`](/docs/reference/rust/zaun-community-protocol/constant-limits-file_upload_max/) | Files in one file upload. |
| [`signed::FORMAT_V1`](/docs/reference/rust/zaun-community-protocol/constant-signed-format_v1/) | The `format` byte of every v1 signed object. |
| [`framing::FRAG_ID_CHARS`](/docs/reference/rust/zaun-community-protocol/constant-framing-frag_id_chars/) | Length of an encoded `FragId` (8 bytes, base64url without padding). |
| [`framing::FRAGMENT_PREFIX`](/docs/reference/rust/zaun-community-protocol/constant-framing-fragment_prefix/) | Prefix of a fragment message. |
| [`limits::FRAGMENT_TIMEOUT_MS`](/docs/reference/rust/zaun-community-protocol/constant-limits-fragment_timeout_ms/) | Milliseconds from the first to the last fragment before a reassembly is discarded. |
| [`framing::app_data::FRAME_KEY`](/docs/reference/rust/zaun-community-protocol/constant-framing-app_data-frame_key/) | The data key holding the frame message text. |
| [`crypto::voice::FRAMES_PER_KEY`](/docs/reference/rust/zaun-community-protocol/constant-crypto-voice-frames_per_key/) | Frames one base key may seal before the sender must rekey (2^32: far beyond a session's length at 50 frames a second, and well inside AES-GCM's limits for distinct nonces). |
| [`command::object::bot_events::GROUPS`](/docs/reference/rust/zaun-community-protocol/constant-command-object-bot_events-groups/) | The groups a manifest may name, with their event types. |
| [`crypto::voice::HEADER_MAX`](/docs/reference/rust/zaun-community-protocol/constant-crypto-voice-header_max/) | Longest header: config byte, 8-byte KID, 8-byte CTR. |
| [`limits::ICE_FIELD_MAX`](/docs/reference/rust/zaun-community-protocol/constant-limits-ice_field_max/) | Longest ICE server URL, username or credential, in bytes. |
| [`limits::ICE_SERVERS_MAX`](/docs/reference/rust/zaun-community-protocol/constant-limits-ice_servers_max/) | Most ICE servers a host lists in `voice.join`. |
| [`limits::ICON_MAX`](/docs/reference/rust/zaun-community-protocol/constant-limits-icon_max/) | Descriptor icon, maximum bytes (PNG or WebP). |
| [`limits::IDEMPOTENCY_RETENTION_MS`](/docs/reference/rust/zaun-community-protocol/constant-limits-idempotency_retention_ms/) | Idempotency record retention lower bound in milliseconds. |
| [`limits::IN_FLIGHT_DEFAULT`](/docs/reference/rust/zaun-community-protocol/constant-limits-in_flight_default/) | Default in-flight window in SMP messages per member. |
| [`limits::IN_FLIGHT_MAX`](/docs/reference/rust/zaun-community-protocol/constant-limits-in_flight_max/) | Highest configurable in-flight window (half the 128-message SMP queue stays free). |
| [`limits::IN_FLIGHT_MIN`](/docs/reference/rust/zaun-community-protocol/constant-limits-in_flight_min/) | Lowest configurable in-flight window (the largest frame must fit). |
| [`limits::INTERACTION_ANSWER_MS`](/docs/reference/rust/zaun-community-protocol/constant-limits-interaction_answer_ms/) | Interaction answer deadline, ms. |
| [`limits::INTERACTION_FOLLOWUPS`](/docs/reference/rust/zaun-community-protocol/constant-limits-interaction_followups/) | Follow-ups per interaction. |
| [`limits::INTERACTION_LIFETIME_MS`](/docs/reference/rust/zaun-community-protocol/constant-limits-interaction_lifetime_ms/) | Follow-ups, edits and modal submits are accepted this long after the interaction, ms. |
| [`limits::INVITE_EXPIRY_MAX_MS`](/docs/reference/rust/zaun-community-protocol/constant-limits-invite_expiry_max_ms/) | Invite expiry upper bound in milliseconds (30 days). |
| [`client::member::INVITE_LINK_PREFIX`](/docs/reference/rust/zaun-community-protocol/constant-client-member-invite_link_prefix/) | The link scheme and path. |
| [`limits::INVITE_MAX_USES`](/docs/reference/rust/zaun-community-protocol/constant-limits-invite_max_uses/) | Invite `max_uses` upper bound (0 means unlimited). |
| [`command::object::flags::IS_COMPONENTS_V2`](/docs/reference/rust/zaun-community-protocol/constant-command-object-flags-is_components_v2/) | The message is laid out by components only. |
| [`crypto::voice::KEM_CIPHERTEXT_LEN`](/docs/reference/rust/zaun-community-protocol/constant-crypto-voice-kem_ciphertext_len/) | X-Wing ciphertext (HPKE `enc`) length. |
| [`crypto::voice::KEM_PUBLIC_LEN`](/docs/reference/rust/zaun-community-protocol/constant-crypto-voice-kem_public_len/) | X-Wing encapsulation (public) key length. |
| [`crypto::voice::KEY_PACKAGE_BYTES_LEN`](/docs/reference/rust/zaun-community-protocol/constant-crypto-voice-key_package_bytes_len/) | Canonical bytes of a key package (all fields are fixed width): 1 306 bytes. |
| [`crypto::voice::KEY_PACKAGE_WIRE_LEN`](/docs/reference/rust/zaun-community-protocol/constant-crypto-voice-key_package_wire_len/) | A key package on the wire: canonical bytes ‖ composite signature, 4 680 bytes. |
| [`crypto::LABEL`](/docs/reference/rust/zaun-community-protocol/constant-crypto-label/) | RFC 10073 `Label` for `id-MLDSA65-Ed25519-SHA512` (ASCII, 30 bytes); the ML-DSA context. |
| [`limits::LABEL_TEXT`](/docs/reference/rust/zaun-community-protocol/constant-limits-label_text/) | Label `label` and `description`, scalars. |
| [`limits::LAST_N`](/docs/reference/rust/zaun-community-protocol/constant-limits-last_n/) | `last_n` history bounds. |
| [`command::object::flags::LOADING`](/docs/reference/rust/zaun-community-protocol/constant-command-object-flags-loading/) | A deferred reply still loading; set only by the host. |
| [`permissions::LOCK_MASK`](/docs/reference/rust/zaun-community-protocol/constant-permissions-lock_mask/) | Bits the channel `locked` flag removes (step 7d). |
| [`limits::LOCKDOWN_MS`](/docs/reference/rust/zaun-community-protocol/constant-limits-lockdown_ms/) | Lockdown duration bounds in milliseconds per `enable` (60 s – 7 days). |
| [`signed::MANIFEST_ENTRIES_MAX`](/docs/reference/rust/zaun-community-protocol/constant-signed-manifest_entries_max/) | At most this many chunks. |
| [`command::bot::MASKED`](/docs/reference/rust/zaun-community-protocol/constant-command-bot-masked/) | How a secret value is shown. |
| [`limits::MAX_CANONICAL_FIELD`](/docs/reference/rust/zaun-community-protocol/constant-limits-max_canonical_field/) | Unlisted variable-length fields in canonical encodings. |
| [`limits::MAX_COMMAND`](/docs/reference/rust/zaun-community-protocol/constant-limits-max_command/) | Maximum command envelope, except `community.create` and `community.descriptor.publish`. |
| [`limits::MAX_FRAGMENTS`](/docs/reference/rust/zaun-community-protocol/constant-limits-max_fragments/) | Fragments per frame. |
| [`limits::MAX_FRAME`](/docs/reference/rust/zaun-community-protocol/constant-limits-max_frame/) | Maximum reassembled envelope in bytes. |
| [`envelope::MAX_JSON_INTEGER`](/docs/reference/rust/zaun-community-protocol/constant-envelope-max_json_integer/) | Largest integer a JSON number may carry here (`2^53 − 1`, the protocol). |
| [`limits::MAX_OPEN_REASSEMBLIES`](/docs/reference/rust/zaun-community-protocol/constant-limits-max_open_reassemblies/) | Open reassemblies per connection; a further one discards the oldest. |
| [`crypto::voice::MAX_RECIPIENTS`](/docs/reference/rust/zaun-community-protocol/constant-crypto-voice-max_recipients/) | Most recipients one sender-keys message names (a mesh of 32 participants). |
| [`limits::MEDIA_DESCRIPTION_MAX`](/docs/reference/rust/zaun-community-protocol/constant-limits-media_description_max/) | Media description, scalars. |
| [`limits::MEDIA_GALLERY_ITEMS`](/docs/reference/rust/zaun-community-protocol/constant-limits-media_gallery_items/) | Media gallery items. |
| [`limits::MENTION_MEMBERS`](/docs/reference/rust/zaun-community-protocol/constant-limits-mention_members/) | Member mentions per message. |
| [`limits::MENTION_ROLES`](/docs/reference/rust/zaun-community-protocol/constant-limits-mention_roles/) | Role mentions per message. |
| [`limits::MESSAGE_CONTENT`](/docs/reference/rust/zaun-community-protocol/constant-limits-message_content/) | Message content length. The content may be empty when the message has an attachment or an embed. |
| [`limits::MESSAGE_JSON_MAX`](/docs/reference/rust/zaun-community-protocol/constant-limits-message_json_max/) | A message's `content` and `embeds` together, as JSON bytes the host writes them (`message_json_len`), so that every message, message event and report fits a page. One `message.send |
| [`framing::MIN_BUDGET`](/docs/reference/rust/zaun-community-protocol/constant-framing-min_budget/) | The smallest accepted per-message budget: a fragment header plus one character at its largest escaped (six bytes, `escaped_len`). |
| [`keys::MLDSA65_PK_LEN`](/docs/reference/rust/zaun-community-protocol/constant-keys-mldsa65_pk_len/) | ML-DSA-65 public key length. |
| [`keys::MLDSA65_SIG_LEN`](/docs/reference/rust/zaun-community-protocol/constant-keys-mldsa65_sig_len/) | ML-DSA-65 signature length. |
| [`limits::MODAL_ITEMS`](/docs/reference/rust/zaun-community-protocol/constant-limits-modal_items/) | Top-level modal items. |
| [`limits::MODAL_TITLE`](/docs/reference/rust/zaun-community-protocol/constant-limits-modal_title/) | Modal `title`, scalars. |
| [`permissions::safety::NEWCOMER_FORBIDDEN`](/docs/reference/rust/zaun-community-protocol/constant-permissions-safety-newcomer_forbidden/) | Bits `newcomer_restrictions` must never contain: newcomers always see and read. |
| [`limits::NEWCOMER_WINDOW_MAX_S`](/docs/reference/rust/zaun-community-protocol/constant-limits-newcomer_window_max_s/) | Largest lockdown `newcomer_window_s`: 30 days, in seconds. |
| [`command::lockdown::NEWCOMER_WINDOW_MAX_S`](/docs/reference/rust/zaun-community-protocol/constant-command-lockdown-newcomer_window_max_s/) | Largest `newcomer_window_s`: 30 days. |
| [`limits::OVERRIDES_PER_CHANNEL`](/docs/reference/rust/zaun-community-protocol/constant-limits-overrides_per_channel/) | Overrides per channel. |
| [`signed::PACKAGE_FORMAT`](/docs/reference/rust/zaun-community-protocol/constant-signed-package_format/) | The package format this header describes. |
| [`signed::PACKAGE_MAGIC`](/docs/reference/rust/zaun-community-protocol/constant-signed-package_magic/) | The file's first four bytes. |
| [`signed::PACKAGE_VERSION`](/docs/reference/rust/zaun-community-protocol/constant-signed-package_version/) | The container version byte after the magic. |
| [`limits::PAGE_BYTES`](/docs/reference/rust/zaun-community-protocol/constant-limits-page_bytes/) | The items of one paged response (`message.history` messages, `sync.events` events, `report.list` reports; for `sync.resume`, the whole body), as JSON bytes: below `MAX_FRAME` by en |
| [`limits::PAGE_LARGE`](/docs/reference/rust/zaun-community-protocol/constant-limits-page_large/) | Page size: `member.list`, `sync.events`. |
| [`limits::PAGE_SMALL`](/docs/reference/rust/zaun-community-protocol/constant-limits-page_small/) | Page size: `message.history`, `audit.list`, `invite.list`, `invite.uses`, `member.bans`, `membership.pending`, `report.list`. |
| [`permissions::PENDING_ALLOWED`](/docs/reference/rust/zaun-community-protocol/constant-permissions-pending_allowed/) | Commands a `Pending` member may issue. `verification.*` (P2, reserved) is not listed. |
| [`limits::PENDING_EXPIRY_MAX_MS`](/docs/reference/rust/zaun-community-protocol/constant-limits-pending_expiry_max_ms/) | Pending expiry upper bound in milliseconds (30 days); default 7 days. |
| [`limits::PENDING_PER_COMMUNITY`](/docs/reference/rust/zaun-community-protocol/constant-limits-pending_per_community/) | Pending members per community. |
| [`crypto::PREFIX`](/docs/reference/rust/zaun-community-protocol/constant-crypto-prefix/) | RFC 10073 `Prefix` (ASCII, 32 bytes). |
| [`framing::PROTOCOL_PREFIX`](/docs/reference/rust/zaun-community-protocol/constant-framing-protocol_prefix/) | Prefix shared by every protocol message; text without it is not a protocol message. |
| [`limits::PROTOCOL_VERSION`](/docs/reference/rust/zaun-community-protocol/constant-limits-protocol_version/) | Protocol version defined by this crate. |
| [`keys::PUBLIC_KEY_LEN`](/docs/reference/rust/zaun-community-protocol/constant-keys-public_key_len/) | Encoded `PublicKey` length. |
| [`limits::RADIO_OPTIONS`](/docs/reference/rust/zaun-community-protocol/constant-limits-radio_options/) | Radio group options. |
| [`limits::REACTIONS_PER_MESSAGE`](/docs/reference/rust/zaun-community-protocol/constant-limits-reactions_per_message/) | Distinct reaction emoji per message. |
| [`limits::REASON_MAX`](/docs/reference/rust/zaun-community-protocol/constant-limits-reason_max/) | Moderation reason, maximum scalars. |
| [`crypto::voice::RECIPIENT_ENTRY_LEN`](/docs/reference/rust/zaun-community-protocol/constant-crypto-voice-recipient_entry_len/) | One recipient entry: member id ‖ voice session ‖ SHA3-256 of the wrapped key. |
| [`crypto::voice::REPLAY_WINDOW`](/docs/reference/rust/zaun-community-protocol/constant-crypto-voice-replay_window/) | Counters a receiver accepts behind the highest one seen (out-of-order delivery). |
| [`limits::REPORT_DESCRIPTION_MAX`](/docs/reference/rust/zaun-community-protocol/constant-limits-report_description_max/) | Report description, maximum scalars. |
| [`limits::REPORT_EVIDENCE_MAX`](/docs/reference/rust/zaun-community-protocol/constant-limits-report_evidence_max/) | Report evidence, maximum messages. |
| [`limits::REPORT_NOTE_MAX`](/docs/reference/rust/zaun-community-protocol/constant-limits-report_note_max/) | Report resolution `note`, maximum scalars. |
| [`limits::REPORT_SNAPSHOT_BYTES`](/docs/reference/rust/zaun-community-protocol/constant-limits-report_snapshot_bytes/) | The evidence snapshots (content and embeds as JSON) one rendered report carries; the first snapshot always goes, and `evidence_next` names where the rest continue. |
| [`limits::REQUEST_NOTE_MAX`](/docs/reference/rust/zaun-community-protocol/constant-limits-request_note_max/) | Membership request note, maximum scalars. |
| [`command::RESERVED_COMMANDS`](/docs/reference/rust/zaun-community-protocol/constant-command-reserved_commands/) | The reserved governance commands of the protocol: answered with `UNSUPPORTED_FEATURE`. |
| [`command::RESERVED_NAMESPACES`](/docs/reference/rust/zaun-community-protocol/constant-command-reserved_namespaces/) | Reserved `type` namespaces of the protocol (prefixes including the dot): answered with `UNSUPPORTED_COMMAND`; v1 clients ignore events in them. |
| [`envelope::RESPONSE_TYPE`](/docs/reference/rust/zaun-community-protocol/constant-envelope-response_type/) | The `type` of every response envelope. |
| [`limits::RESUME_CHANNELS`](/docs/reference/rust/zaun-community-protocol/constant-limits-resume_channels/) | `sync.resume`: channels per request. |
| [`limits::RESUME_EVENTS_PER_STREAM`](/docs/reference/rust/zaun-community-protocol/constant-limits-resume_events_per_stream/) | `sync.resume`: events per stream. |
| [`limits::ROLE_NAME`](/docs/reference/rust/zaun-community-protocol/constant-limits-role_name/) | Role name length. |
| [`limits::ROLES_PER_COMMUNITY`](/docs/reference/rust/zaun-community-protocol/constant-limits-roles_per_community/) | Roles per community, including `@everyone`. |
| [`limits::ROLES_PER_MEMBER`](/docs/reference/rust/zaun-community-protocol/constant-limits-roles_per_member/) | Roles per member. |
| [`limits::ROTATIONS_PAGE`](/docs/reference/rust/zaun-community-protocol/constant-limits-rotations_page/) | Page size: `community.rotations`. |
| [`crypto::SECRET_KEY_LEN`](/docs/reference/rust/zaun-community-protocol/constant-crypto-secret_key_len/) | Length of SecretKey: `mldsaSeed` (32) ‖ `edSK` (32). |
| [`limits::SECTION_TEXTS`](/docs/reference/rust/zaun-community-protocol/constant-limits-section_texts/) | Section text displays. |
| [`limits::SELECT_OPTION_TEXT`](/docs/reference/rust/zaun-community-protocol/constant-limits-select_option_text/) | Select option `label`, `value`, `description`, scalars. |
| [`limits::SELECT_OPTIONS`](/docs/reference/rust/zaun-community-protocol/constant-limits-select_options/) | Select options. |
| [`limits::SELECT_PLACEHOLDER_MAX`](/docs/reference/rust/zaun-community-protocol/constant-limits-select_placeholder_max/) | Select `placeholder`, scalars. |
| [`crypto::voice::SENDER_KEYS_BYTES_MAX`](/docs/reference/rust/zaun-community-protocol/constant-crypto-voice-sender_keys_bytes_max/) | Largest canonical sender-keys message: 2 090 bytes. |
| [`crypto::voice::SENDER_KEYS_FIXED_LEN`](/docs/reference/rust/zaun-community-protocol/constant-crypto-voice-sender_keys_fixed_len/) | Canonical bytes of a sender-keys message without its recipients. |
| [`crypto::voice::SENDER_KEYS_WIRE_MAX`](/docs/reference/rust/zaun-community-protocol/constant-crypto-voice-sender_keys_wire_max/) | Largest sender-keys message on the wire: `u32` length ‖ bytes ‖ signature, 5 468 bytes. |
| [`command::object::flags::SETTABLE`](/docs/reference/rust/zaun-community-protocol/constant-command-object-flags-settable/) | What a sender may set. |
| [`crypto::voice::SFRAME_CIPHER_SUITE`](/docs/reference/rust/zaun-community-protocol/constant-crypto-voice-sframe_cipher_suite/) | The SFrame cipher suite: `AES_256_GCM_SHA512_128`. |
| [`crypto::voice::SFRAME_OVERHEAD_MAX`](/docs/reference/rust/zaun-community-protocol/constant-crypto-voice-sframe_overhead_max/) | Most bytes SFrame adds to a frame: the longest header and the tag. |
| [`limits::SIGNAL_INTERVAL_MS`](/docs/reference/rust/zaun-community-protocol/constant-limits-signal_interval_ms/) | Minimum interval between signals per member per channel, in milliseconds. |
| [`keys::SIGNATURE_LEN`](/docs/reference/rust/zaun-community-protocol/constant-keys-signature_len/) | Encoded `Signature` length. |
| [`limits::SLOWMODE_MAX_S`](/docs/reference/rust/zaun-community-protocol/constant-limits-slowmode_max_s/) | Slowmode upper bound in seconds. |
| [`limits::SNAPSHOT_PAGE`](/docs/reference/rust/zaun-community-protocol/constant-limits-snapshot_page/) | `sync.snapshot` page. |
| [`crypto::voice::SUITE_V1`](/docs/reference/rust/zaun-community-protocol/constant-crypto-voice-suite_v1/) | The voice suite of protocol version 1: X-Wing KEM, HPKE (HKDF-SHA256, AES-256-GCM), SFrame `AES_256_GCM_SHA512_128`. Unknown suites are rejected (ADR-0011 agility rules). |
| [`signed::SUPPORTED_WORLDS`](/docs/reference/rust/zaun-community-protocol/constant-signed-supported_worlds/) | The `zaun:bot` worlds a host built from this crate runs; a package for any other is refused at install and update (it could never load). Kept equal to the bot runtime's list. |
| [`command::object::flags::SUPPRESS_EMBEDS`](/docs/reference/rust/zaun-community-protocol/constant-command-object-flags-suppress_embeds/) | Embeds are not shown. |
| [`command::object::flags::SUPPRESS_NOTIFICATIONS`](/docs/reference/rust/zaun-community-protocol/constant-command-object-flags-suppress_notifications/) | Mentions do not notify. |
| [`permissions::SUSPENDED_ALLOWED`](/docs/reference/rust/zaun-community-protocol/constant-permissions-suspended_allowed/) | Commands a `Suspended` member may issue: the same as `Pending`. |
| [`limits::SUSPENSION_MAX_MS`](/docs/reference/rust/zaun-community-protocol/constant-limits-suspension_max_ms/) | Suspension upper bound in milliseconds (90 days), or until restored. |
| [`permissions::TABLE`](/docs/reference/rust/zaun-community-protocol/constant-permissions-table/) | Every command of the table with its requirement, in specification order. |
| [`crypto::voice::TAG_LEN`](/docs/reference/rust/zaun-community-protocol/constant-crypto-voice-tag_len/) | AES-256-GCM tag length (HPKE and SFrame). |
| [`limits::TEXT_DISPLAY_TOTAL`](/docs/reference/rust/zaun-community-protocol/constant-limits-text_display_total/) | All text displays of one message or modal together, scalars. |
| [`limits::TEXT_INPUT_MAX`](/docs/reference/rust/zaun-community-protocol/constant-limits-text_input_max/) | Text input value and length bounds, scalars. |
| [`limits::TEXT_INPUT_PLACEHOLDER_MAX`](/docs/reference/rust/zaun-community-protocol/constant-limits-text_input_placeholder_max/) | Text input `placeholder`, scalars. |
| [`permissions::TIMEOUT_KEEP`](/docs/reference/rust/zaun-community-protocol/constant-permissions-timeout_keep/) | Bits a timed-out member keeps (step 7a). |
| [`limits::TIMEOUT_MAX_MS`](/docs/reference/rust/zaun-community-protocol/constant-limits-timeout_max_ms/) | Timeout upper bound in milliseconds (28 days). |
| [`limits::TYPING_COUNT_CAP`](/docs/reference/rust/zaun-community-protocol/constant-limits-typing_count_cap/) | The largest `count` of an anonymous `signal.typing`: 3 means "three or more", so a larger channel never learns exactly how many are typing. |
| [`permissions::UNBOUND_ALLOWED`](/docs/reference/rust/zaun-community-protocol/constant-permissions-unbound_allowed/) | Commands an unbound (negotiated) connection may send: `community.rotations` too, naming the community in the envelope's `community_id` (the chain is public and signed; a client nee |
| [`limits::UNBOUND_DEADLINE_MS`](/docs/reference/rust/zaun-community-protocol/constant-limits-unbound_deadline_ms/) | Unbound connection deadline (default) in milliseconds. |
| [`permissions::UNBOUND_ONLY`](/docs/reference/rust/zaun-community-protocol/constant-permissions-unbound_only/) | Commands that only make sense unbound; a bound connection gets `CONFLICT`. |
| [`signed::VERSION_MAX`](/docs/reference/rust/zaun-community-protocol/constant-signed-version_max/) | Bytes of `version`. |
| [`limits::VOICE_KEY_PACKAGE_MAX`](/docs/reference/rust/zaun-community-protocol/constant-limits-voice_key_package_max/) | Largest `key_package` of `voice.join`, decoded bytes (opaque to the host; the media layer's packages are 4 680 bytes). |
| [`limits::VOICE_MESH_MAX`](/docs/reference/rust/zaun-community-protocol/constant-limits-voice_mesh_max/) | The most participants a voice channel can have on any host (`mesh_max` ≤ this). Every participant's key package is in the `voice.join` response, which must fit in `MAX_FRAME` (9 ba |
| [`limits::VOICE_SENDER_KEYS_MAX`](/docs/reference/rust/zaun-community-protocol/constant-limits-voice_sender_keys_max/) | Largest `sender_keys` of `voice.keys`, decoded bytes: the sender's signed message for one epoch, the same for every recipient (the media layer's are at most 5 468 bytes). |
| [`limits::VOICE_SIGNAL_MAX`](/docs/reference/rust/zaun-community-protocol/constant-limits-voice_signal_max/) | Largest `data` of `voice.signal` (WebRTC SDP or ICE), decoded bytes. |
| [`limits::VOICE_USER_LIMIT`](/docs/reference/rust/zaun-community-protocol/constant-limits-voice_user_limit/) | `user_limit` of a voice channel. |
| [`limits::VOICE_WRAPPED_KEY_MAX`](/docs/reference/rust/zaun-community-protocol/constant-limits-voice_wrapped_key_max/) | Largest `wrapped` key of one `voice.keys` entry, decoded bytes (the media layer's are 1 168 bytes). |
| [`permissions::WAITING_MASK`](/docs/reference/rust/zaun-community-protocol/constant-permissions-waiting_mask/) | Bits the admission policy's waiting period withholds: posting, reacting and creating invitations. |
| [`framing::WHOLE_PREFIX`](/docs/reference/rust/zaun-community-protocol/constant-framing-whole_prefix/) | Prefix of a whole-envelope message. |
| [`signed::WORLD_MAX`](/docs/reference/rust/zaun-community-protocol/constant-signed-world_max/) | Bytes of `world`. |
| [`crypto::voice::WRAPPED_KEY_LEN`](/docs/reference/rust/zaun-community-protocol/constant-crypto-voice-wrapped_key_len/) | A wrapped sender key: `enc ‖ AES-256-GCM(base key) ‖ tag`, 1 168 bytes. |
## Enums
| Item | Summary |
|---|---|
| [`permissions::Access`](/docs/reference/rust/zaun-community-protocol/enum-permissions-access/) | Who may send the command at all, before any bit is checked. |
| [`command::object::ActivityType`](/docs/reference/rust/zaun-community-protocol/enum-command-object-activitytype/) | What the member is doing. |
| [`signed::AdmissionMode`](/docs/reference/rust/zaun-community-protocol/enum-signed-admissionmode/) | `AdmissionSummary.mode`. |
| [`command::object::AdmissionVia`](/docs/reference/rust/zaun-community-protocol/enum-command-object-admissionvia/) | `admission.via`. SPEC: a plain string (`"invite" \| "request"`), not `{t}`. |
| [`command::object::Availability`](/docs/reference/rust/zaun-community-protocol/enum-command-object-availability/) | `availability`. SPEC: a plain string, as written in the spec. |
| [`envelope::BatchError`](/docs/reference/rust/zaun-community-protocol/enum-envelope-batcherror/) | A batch that breaks the rules of the protocol Indices count from 0 in `body.events`. |
| [`command::BodyError`](/docs/reference/rust/zaun-community-protocol/enum-command-bodyerror/) | A body that cannot be accepted. Each variant maps to one error code of the protocol; the envelope layer adds `request_id`, the message text and the extra fields. |
| [`command::object::BotKind`](/docs/reference/rust/zaun-community-protocol/enum-command-object-botkind/) | `kind` of a bot. |
| [`command::object::BotState`](/docs/reference/rust/zaun-community-protocol/enum-command-object-botstate/) | `state` of an installed bot. |
| [`client::BuildError`](/docs/reference/rust/zaun-community-protocol/enum-client-builderror/) | An owner or member object (descriptor, delegation, registration, body) could not be built. |
| [`command::object::ButtonStyle`](/docs/reference/rust/zaun-community-protocol/enum-command-object-buttonstyle/) | Button `style`: 1 primary, 2 secondary, 3 success, 4 danger, 5 link. |
| [`model::ChannelKind`](/docs/reference/rust/zaun-community-protocol/enum-model-channelkind/) | The kind of a channel (permissions the protocol, the protocol). |
| [`command::object::ChoiceValue`](/docs/reference/rust/zaun-community-protocol/enum-command-object-choicevalue/) | A choice `value`: a string or a number. |
| [`client::ClientError`](/docs/reference/rust/zaun-community-protocol/enum-client-clienterror/) | A command could not be prepared or the session refuses to send it. |
| [`client::ClientEvent`](/docs/reference/rust/zaun-community-protocol/enum-client-clientevent/) | One outcome for the application. |
| [`command::Command`](/docs/reference/rust/zaun-community-protocol/enum-command-command/) | A decoded command body: one variant per command of the protocol |
| [`command::object::CommandType`](/docs/reference/rust/zaun-community-protocol/enum-command-object-commandtype/) | `type` of a command: 1 `CHAT_INPUT` (a slash command), 2 `USER`, 3 `MESSAGE` (context menus). |
| [`command::object::Component`](/docs/reference/rust/zaun-community-protocol/enum-command-object-component/) | One component. The variant is the wire `type` number. |
| [`permissions::ConflictReason`](/docs/reference/rust/zaun-community-protocol/enum-permissions-conflictreason/) | Why a state transition does not apply (`CONFLICT`). |
| [`crypto::Context`](/docs/reference/rust/zaun-community-protocol/enum-crypto-context/) | An RFC 10073 `ctx` value of this protocol. The verifier always supplies the context of the object type it expects; it is never read from the input. |
| [`crypto::ContextStatus`](/docs/reference/rust/zaun-community-protocol/enum-crypto-contextstatus/) | Whether a context is part of v1 conformance. |
| [`command::interaction::CreateData`](/docs/reference/rust/zaun-community-protocol/enum-command-interaction-createdata/) | `interaction.create` data, by type. |
| [`encoding::DecodeError`](/docs/reference/rust/zaun-community-protocol/enum-encoding-decodeerror/) | The input is not a canonical encoding. |
| [`command::object::DefaultValueKind`](/docs/reference/rust/zaun-community-protocol/enum-command-object-defaultvaluekind/) | `default_values` entry kind of an entity select. |
| [`permissions::DenialReason`](/docs/reference/rust/zaun-community-protocol/enum-permissions-denialreason/) | Why a permission check failed, when a specific rule caused it (permissions the protocol). |
| [`framing::DiscardReason`](/docs/reference/rust/zaun-community-protocol/enum-framing-discardreason/) | Why a reassembly (or a fragment that would start one) was discarded. A discard produces no response; the sender's retry repairs it. |
| [`signed::Discovery`](/docs/reference/rust/zaun-community-protocol/enum-signed-discovery/) | `discovery` (field 17). |
| [`model::DistributionMode`](/docs/reference/rust/zaun-community-protocol/enum-model-distributionmode/) | How accepted channel-stream events travel (ADR-0009, the protocol, Appendix A). |
| [`encoding::EncodeError`](/docs/reference/rust/zaun-community-protocol/enum-encoding-encodeerror/) | A value cannot be encoded canonically: it would not decode. |
| [`framing::EncodeError`](/docs/reference/rust/zaun-community-protocol/enum-framing-encodeerror/) | Why an envelope cannot be framed. |
| [`event::EphemeralOp`](/docs/reference/rust/zaun-community-protocol/enum-event-ephemeralop/) | `op` of `interaction.message`. |
| [`error_code::ErrorCode`](/docs/reference/rust/zaun-community-protocol/enum-error_code-errorcode/) | A response error code. Clients branch on this, never on the message text. |
| [`event::Event`](/docs/reference/rust/zaun-community-protocol/enum-event-event/) | A decoded event body: one variant per event of the the protocol catalogue. |
| [`envelope::EventError`](/docs/reference/rust/zaun-community-protocol/enum-envelope-eventerror/) | An event envelope that breaks the rules of the protocol |
| [`client::ExpectedHost`](/docs/reference/rust/zaun-community-protocol/enum-client-expectedhost/) | The host the client expects to reach. The welcome's host key must match. |
| [`event::FailReason`](/docs/reference/rust/zaun-community-protocol/enum-event-failreason/) | Why an interaction failed. |
| [`permissions::GateDenial`](/docs/reference/rust/zaun-community-protocol/enum-permissions-gatedenial/) | Why the gate refused a command. |
| [`model::HistoryAccess`](/docs/reference/rust/zaun-community-protocol/enum-model-historyaccess/) | How much channel history a member may read (ADR-0014, the protocol). Stamped on each message at send time. |
| [`command::object::IcePolicy`](/docs/reference/rust/zaun-community-protocol/enum-command-object-icepolicy/) | Which ICE candidates clients may use. |
| [`envelope::IdempotencyKey`](/docs/reference/rust/zaun-community-protocol/enum-envelope-idempotencykey/) | The key an idempotency record is stored under. `C` is the host's opaque connection id, used only for unbound connections. |
| [`framing::Inbound`](/docs/reference/rust/zaun-community-protocol/enum-framing-inbound/) | What an inbound transport text is. |
| [`command::object::InteractionData`](/docs/reference/rust/zaun-community-protocol/enum-command-object-interactiondata/) | `data` of an interaction, by type. |
| [`command::object::InteractionType`](/docs/reference/rust/zaun-community-protocol/enum-command-object-interactiontype/) | `type` of an interaction (Discord's numbers; `PING` is not used). |
| [`permissions::Invalid`](/docs/reference/rust/zaun-community-protocol/enum-permissions-invalid/) | A malformed request (`BAD_REQUEST`). |
| [`permissions::invites::InviteCreation`](/docs/reference/rust/zaun-community-protocol/enum-permissions-invites-invitecreation/) | The admission policy's `invite_creation` rule. |
| [`command::object::InviteCreation`](/docs/reference/rust/zaun-community-protocol/enum-command-object-invitecreation/) | `invite_creation`. |
| [`keys::KeyEncodingError`](/docs/reference/rust/zaun-community-protocol/enum-keys-keyencodingerror/) | The encoding is not a known suite or has the wrong length. |
| [`client::member::LinkError`](/docs/reference/rust/zaun-community-protocol/enum-client-member-linkerror/) | A link that is not a valid invitation. Carries no part of the input. |
| [`command::object::LockdownView`](/docs/reference/rust/zaun-community-protocol/enum-command-object-lockdownview/) | A lockdown as the viewer may see it. The full form is tried first. On disable or expiry, `moderation.lockdown.updated` carries the inactive public form to every member, `MANAGE_SAF |
| [`model::MembershipState`](/docs/reference/rust/zaun-community-protocol/enum-model-membershipstate/) | A member's lifecycle state. Independent of roles. |
| [`command::signal::NoResponse`](/docs/reference/rust/zaun-community-protocol/enum-command-signal-noresponse/) | A signal has no response. Uninhabited. |
| [`command::object::OptionType`](/docs/reference/rust/zaun-community-protocol/enum-command-object-optiontype/) | `type` of an option (Discord's numbers 1–11). |
| [`command::object::OptionValueKind`](/docs/reference/rust/zaun-community-protocol/enum-command-object-optionvaluekind/) | An option value as the invoker gave it: a string, number, boolean or id. |
| [`command::object::Outcome`](/docs/reference/rust/zaun-community-protocol/enum-command-object-outcome/) | `outcome`. |
| [`envelope::Outcome`](/docs/reference/rust/zaun-community-protocol/enum-envelope-outcome/) | The result carried by a response. |
| [`permissions::overrides::OverrideSubject`](/docs/reference/rust/zaun-community-protocol/enum-permissions-overrides-overridesubject/) | The target of an override as the hierarchy sees it. |
| [`permissions::OverrideTarget`](/docs/reference/rust/zaun-community-protocol/enum-permissions-overridetarget/) | Whom an override applies to (permissions the protocol). |
| [`command::object::OverrideTarget`](/docs/reference/rust/zaun-community-protocol/enum-command-object-overridetarget/) | The subject of an override: `{"t":"role","c":RoleId}` or `{"t":"member","c":MemberId}`. |
| [`permissions::overrides::OverrideWrite`](/docs/reference/rust/zaun-community-protocol/enum-permissions-overrides-overridewrite/) | What the host does with a validated override. |
| [`signed::PackageError`](/docs/reference/rust/zaun-community-protocol/enum-signed-packageerror/) | A `.zbot` file that does not verify. |
| [`event::Parsed`](/docs/reference/rust/zaun-community-protocol/enum-event-parsed/) | The result of decoding an event: known, or an unknown `type` that the client ignores while still advancing the stream's cursor by its `sequence`. Events in reserved namespaces are |
| [`json::Patch`](/docs/reference/rust/zaun-community-protocol/enum-json-patch/) | A field that distinguishes "absent" from "null" in update commands (`channel.update` with `"topic": null` clears the topic; no `topic` leaves it). |
| [`command::object::PolicyLevel`](/docs/reference/rust/zaun-community-protocol/enum-command-object-policylevel/) | `level`. |
| [`command::object::PolicyView`](/docs/reference/rust/zaun-community-protocol/enum-command-object-policyview/) | The full policy or the public summary, by the viewer's permissions (`admission.policy.updated` body, the protocol). The full form is tried first. |
| [`command::signal::PresenceStatus`](/docs/reference/rust/zaun-community-protocol/enum-command-signal-presencestatus/) | Presence status, in the the protocol tagged form. A client sends `online`, `idle`, `dnd` or `invisible` (`offline` from a client means `invisible`); others only ever see `online`, |
| [`client::ProtocolError`](/docs/reference/rust/zaun-community-protocol/enum-client-protocolerror/) | Input ignored safely. |
| [`signed::Purpose`](/docs/reference/rust/zaun-community-protocol/enum-signed-purpose/) | Why a member key is registered (field 2). Other values are reserved and rejected. |
| [`framing::Pushed`](/docs/reference/rust/zaun-community-protocol/enum-framing-pushed/) | The result of pushing one fragment. |
| [`envelope::RateCategory`](/docs/reference/rust/zaun-community-protocol/enum-envelope-ratecategory/) | `RATE_LIMITED` category. |
| [`envelope::RateScope`](/docs/reference/rust/zaun-community-protocol/enum-envelope-ratescope/) | `RATE_LIMITED` scope. |
| [`envelope::Reason`](/docs/reference/rust/zaun-community-protocol/enum-envelope-reason/) | `FORBIDDEN` and `CONFLICT` reasons. |
| [`permissions::Refusal`](/docs/reference/rust/zaun-community-protocol/enum-permissions-refusal/) | Every way a pure check can refuse a command. |
| [`signed::RegistrationError`](/docs/reference/rust/zaun-community-protocol/enum-signed-registrationerror/) | A `MemberKeyRegistration` is not acceptable to the host. |
| [`event::RemovalReason`](/docs/reference/rust/zaun-community-protocol/enum-event-removalreason/) | `reason: {t: "kicked" \| "banned" \| "left" \| "rejected" \| "expired"}`. |
| [`envelope::Replay`](/docs/reference/rust/zaun-community-protocol/enum-envelope-replay/) | What to do with a command whose key matches a stored record. |
| [`command::object::ReportCategory`](/docs/reference/rust/zaun-community-protocol/enum-command-object-reportcategory/) | `category`. |
| [`command::object::ReportStatus`](/docs/reference/rust/zaun-community-protocol/enum-command-object-reportstatus/) | `status`: a plain string, exactly `"open"\|"reviewing"\|"resolved"`. |
| [`command::object::ReportTarget`](/docs/reference/rust/zaun-community-protocol/enum-command-object-reporttarget/) | `target: {t: "member"\|"message", c}`. |
| [`command::interaction::ResponseData`](/docs/reference/rust/zaun-community-protocol/enum-command-interaction-responsedata/) | Response data, by type. |
| [`command::interaction::ResponseType`](/docs/reference/rust/zaun-community-protocol/enum-command-interaction-responsetype/) | Interaction response types (Discord's callback numbers). |
| [`command::object::Restriction`](/docs/reference/rust/zaun-community-protocol/enum-command-object-restriction/) | One lockdown restriction. |
| [`signed::RotationError`](/docs/reference/rust/zaun-community-protocol/enum-signed-rotationerror/) | The rotation chain does not verify. `index` is 1-based. |
| [`permissions::Scope`](/docs/reference/rust/zaun-community-protocol/enum-permissions-scope/) | Where the required bits are evaluated. |
| [`signed::SessionProofError`](/docs/reference/rust/zaun-community-protocol/enum-signed-sessionprooferror/) | A `HostSessionProof` is not acceptable to the client. |
| [`client::SessionState`](/docs/reference/rust/zaun-community-protocol/enum-client-sessionstate/) | Where the session is in its lifecycle. |
| [`signed::SignedError`](/docs/reference/rust/zaun-community-protocol/enum-signed-signederror/) | Signing, verifying, encoding or decoding one signed object failed. |
| [`crypto::SignError`](/docs/reference/rust/zaun-community-protocol/enum-crypto-signerror/) | Signing failed. |
| [`command::sync::SnapshotItem`](/docs/reference/rust/zaun-community-protocol/enum-command-sync-snapshotitem/) | One snapshot item; the variant follows the requested part. |
| [`command::sync::SnapshotPart`](/docs/reference/rust/zaun-community-protocol/enum-command-sync-snapshotpart/) | `part`. SPEC: a plain string, as in the the protocol request. |
| [`command::object::Stream`](/docs/reference/rust/zaun-community-protocol/enum-command-object-stream/) | An event stream. SPEC: a plain string, as in the the protocol `stream` field and the the protocol example (`"stream": "channel"`), not `{t}`. |
| [`envelope::Stream`](/docs/reference/rust/zaun-community-protocol/enum-envelope-stream/) | An event stream; also the `stream` of `RESYNC_REQUIRED`. |
| [`keys::Suite`](/docs/reference/rust/zaun-community-protocol/enum-keys-suite/) | A signature suite. `0x00` and `0x02`–`0xFF` are rejected. |
| [`command::object::TextInputStyle`](/docs/reference/rust/zaun-community-protocol/enum-command-object-textinputstyle/) | Text input `style`: 1 short, 2 paragraph. |
| [`permissions::Top`](/docs/reference/rust/zaun-community-protocol/enum-permissions-top/) | A member's top position. The owner is above every role. |
| [`command::TypeClass`](/docs/reference/rust/zaun-community-protocol/enum-command-typeclass/) | What a command `type` string is to a v1 host. |
| [`model::TypingMode`](/docs/reference/rust/zaun-community-protocol/enum-model-typingmode/) | Who sees that someone is typing in a channel (`typing`, the protocol). A plain JSON string, as the specification writes it. |
| [`command::object::UploadFailure`](/docs/reference/rust/zaun-community-protocol/enum-command-object-uploadfailure/) | `failure` of an upload: why the host does not hold it. |
| [`signed::ValidityError`](/docs/reference/rust/zaun-community-protocol/enum-signed-validityerror/) | A (descriptor, delegation) pair is not valid. |
| [`signed::VerificationLevel`](/docs/reference/rust/zaun-community-protocol/enum-signed-verificationlevel/) | `AdmissionSummary.level`: verification level None … Highest (`governance.md`). |
| [`crypto::VerifyError`](/docs/reference/rust/zaun-community-protocol/enum-crypto-verifyerror/) | Verification failed. Callers map every variant to `INVALID_SIGNATURE`; the variants exist for tests and diagnostics only. |
| [`event::VisibilityReason`](/docs/reference/rust/zaun-community-protocol/enum-event-visibilityreason/) | A visibility change. SPEC: a plain string (`"access_gained"`), as written. |
| [`crypto::voice::VoiceError`](/docs/reference/rust/zaun-community-protocol/enum-crypto-voice-voiceerror/) | A voice key or frame operation failed. |
| [`event::VoiceLeftReason`](/docs/reference/rust/zaun-community-protocol/enum-event-voiceleftreason/) | Why a participant left a voice channel. |
| [`client::WelcomeError`](/docs/reference/rust/zaun-community-protocol/enum-client-welcomeerror/) | Why a `session.welcome` was rejected. |
## Functions
| Item | Summary |
|---|---|
| [`permissions::act_on`](/docs/reference/rust/zaun-community-protocol/function-permissions-act_on/) | H1 then H2, with H2 skipped when the actor targets themself and `self_ok` is set. |
| [`permissions::safety::admission_policy_update`](/docs/reference/rust/zaun-community-protocol/function-permissions-safety-admission_policy_update/) | `admission.policy.update` of `newcomer_restrictions`: valid, and H3 on the bits added or removed (`old XOR new ⊆ cp`; only the owner exempt, see `h3_owner_only`). |
| [`permissions::overrides::adopt_parent`](/docs/reference/rust/zaun-community-protocol/function-permissions-overrides-adopt_parent/) | Setting `sync_with_parent = true`: checked as an override edit from the channel's own overrides to the parent's, for every target in either. `subject` maps a target to its hierarch |
| [`permissions::all_in`](/docs/reference/rust/zaun-community-protocol/function-permissions-all_in/) | The grants of an owner or administrator in a channel. |
| [`command::object::bot_events::allowed`](/docs/reference/rust/zaun-community-protocol/function-command-object-bot_events-allowed/) | Whether the capabilities allow events of `kind`: member events need `members`, presence needs `presence`, DM events need `dms`; everything else is visible to any member anyway. |
| [`permissions::applicable`](/docs/reference/rust/zaun-community-protocol/function-permissions-applicable/) | The channel bits that apply to a channel kind. |
| [`permissions::members::approve`](/docs/reference/rust/zaun-community-protocol/function-permissions-members-approve/) | `membership.approve`. A `Pending` target has no roles, so no H2; but the approver must be able to assign every default role applied at approval. Ending a `Probation` early needs H1 |
| [`permissions::base`](/docs/reference/rust/zaun-community-protocol/function-permissions-base/) | `base(m)` for a non-owner (steps 1–2): `@everyone` OR the member's roles; `ALL` with `ADMINISTRATOR`; otherwise masked by `KNOWN`. |
| [`permissions::roles::can_assign`](/docs/reference/rust/zaun-community-protocol/function-permissions-roles-can_assign/) | Whether `actor` could assign `role` right now: the check behind invitation default roles and approval (permissions the protocol, the protocol). `cp` must hold `MANAGE_ROLES` unless |
| [`permissions::roles::can_grant`](/docs/reference/rust/zaun-community-protocol/function-permissions-roles-can_grant/) | Hierarchy over a role being granted, without `MANAGE_ROLES`: not `@everyone`, H4, and its known bits held (H3). Used by `membership.approve`. |
| [`command::attachment::caption`](/docs/reference/rust/zaun-community-protocol/function-command-attachment-caption/) | The caption of the SimpleX file that carries attachment `id`, either way. |
| [`permissions::channel_grants`](/docs/reference/rust/zaun-community-protocol/function-permissions-channel_grants/) | `grants(m, ch)` (steps 3–6) for a non-administrator whose base is `base`. |
| [`command::object::check_commands`](/docs/reference/rust/zaun-community-protocol/function-command-object-check_commands/) | Every command's rules, the per-type counts and unique names; at most 8 000 scalars of text per command. |
| [`command::object::check_embeds`](/docs/reference/rust/zaun-community-protocol/function-command-object-check_embeds/) | The state-free rules of a message's embeds: at most 10, each valid and showing something, at most 6 000 scalars of text in all. With `attachments`, every picture an embed shows mus |
| [`command::object::check_message_components`](/docs/reference/rust/zaun-community-protocol/function-command-object-check_message_components/) | A message's components: at most five action rows without `IS_COMPONENTS_V2`, the V2 layout kinds with it; at most 40 in all, unique `id`s and `custom_id`s. |
| [`command::object::check_modal`](/docs/reference/rust/zaun-community-protocol/function-command-object-check_modal/) | A modal (`MODAL` response): `custom_id`, `title` 1–45 and 1–5 labels or text displays. |
| [`command::object::check_pictures`](/docs/reference/rust/zaun-community-protocol/function-command-object-check_pictures/) | Every picture an embed shows (`image`, `thumbnail`, `author.icon`, `footer.icon`) is one of the message's `attachments`, so it travels the attachment path like any file and nobody |
| [`envelope::check_version`](/docs/reference/rust/zaun-community-protocol/function-envelope-check_version/) | Checks an inbound envelope's `v` against the connection's negotiated version. |
| [`command::bot::chosen`](/docs/reference/rust/zaun-community-protocol/function-command-bot-chosen/) | Full grants from a choice and the manifest's request. |
| [`signed::claimed_genesis`](/docs/reference/rust/zaun-community-protocol/function-signed-claimed_genesis/) | The **claimed** genesis key: the first rotation's `old_root`, or the descriptor's `root_public_key` when the chain is empty. |
| [`command::classify`](/docs/reference/rust/zaun-community-protocol/function-command-classify/) | Classifies a command `type`. Exact, case-sensitive matching. |
| [`framing::classify`](/docs/reference/rust/zaun-community-protocol/function-framing-classify/) | Classifies one inbound text message. The `zaun:1f:` prefix is tested before `zaun:1:` (they differ at the 7th byte, so the order is only for clarity). |
| [`envelope::command_limit`](/docs/reference/rust/zaun-community-protocol/function-envelope-command_limit/) | The size limit of a command envelope of type `kind`: `MAX_COMMAND`, except `community.create` and `community.descriptor.publish`, which may use the whole `max_frame`. |
| [`permissions::commands`](/docs/reference/rust/zaun-community-protocol/function-permissions-commands/) | Every command name of the table. |
| [`permissions::community_dependencies`](/docs/reference/rust/zaun-community-protocol/function-permissions-community_dependencies/) | Implicit dependencies at community level: no attachment, embed or mass mention without `SEND_MESSAGES`, no voice bit without `CONNECT`. There is no `VIEW_CHANNEL` gate here: whethe |
| [`crypto::community_id`](/docs/reference/rust/zaun-community-protocol/function-crypto-community_id/) | `CommunityId = SHA3-256("zaun/community-id/v1" ‖ 0x00 ‖ genesis root key)`, over the 1 985-byte encoding including the suite byte. Always the **genesis** key. |
| [`signed::compare_versions`](/docs/reference/rust/zaun-community-protocol/function-signed-compare_versions/) | Semantic Versioning precedence of two versions; `None` when either is invalid. An update must be `Ordering::Greater` than the installed version. |
| [`command::object::component_attachments`](/docs/reference/rust/zaun-community-protocol/function-command-object-component_attachments/) | Every attachment the components show (thumbnails, gallery pictures, files), with the field naming it; each must be an attachment of the same message. |
| [`command::object::config_key_ok`](/docs/reference/rust/zaun-community-protocol/function-command-object-config_key_ok/) | A `config` key: `a-za-z0-9_{0,63}`. |
| [`crypto::content_hash`](/docs/reference/rust/zaun-community-protocol/function-crypto-content_hash/) | `SHA3-256(bytes)`: how signed objects are identified, deduplicated and chained (never by signature bytes, the protocol), for example a `delegation_hash`. |
| [`client::owner::create_body`](/docs/reference/rust/zaun-community-protocol/function-client-owner-create_body/) | The `community.create` body: the genesis pair, the owner's member key and its registration (purpose 1) for the host's current `host_challenge` (from the welcome). |
| [`framing::app_data::data`](/docs/reference/rust/zaun-community-protocol/function-framing-app_data-data/) | The application data that carries the frame message `frame`. |
| [`b64::decode`](/docs/reference/rust/zaun-community-protocol/function-b64-decode/) | Decodes canonical base64url without padding. |
| [`b64::decode_array`](/docs/reference/rust/zaun-community-protocol/function-b64-decode_array/) | Decodes exactly `N` bytes. |
| [`client::decode_response`](/docs/reference/rust/zaun-community-protocol/function-client-decode_response/) | Decodes a successful response body as the response type of command `B`. |
| [`client::owner::delegate`](/docs/reference/rust/zaun-community-protocol/function-client-owner-delegate/) | Signs a delegation of every v1 scope to `host`, valid from `now_ms`. |
| [`permissions::dependencies`](/docs/reference/rust/zaun-community-protocol/function-permissions-dependencies/) | Implicit dependencies (step 6) at channel level: no channel bit without `VIEW_CHANNEL`, then `community_dependencies`. |
| [`crypto::voice::derive_key_salt`](/docs/reference/rust/zaun-community-protocol/function-crypto-voice-derive_key_salt/) | RFC 9605 the protocol `derive_key_salt` for suite `0x0005`. |
| [`b64::bytes::deserialize`](/docs/reference/rust/zaun-community-protocol/function-b64-bytes-deserialize/) | Deserializes strict base64url. |
| [`json::u64_decimal::deserialize`](/docs/reference/rust/zaun-community-protocol/function-json-u64_decimal-deserialize/) | Deserializes a canonical decimal string. |
| [`b64::encode`](/docs/reference/rust/zaun-community-protocol/function-b64-encode/) | Encodes `bytes` as base64url without padding. |
| [`framing::encode`](/docs/reference/rust/zaun-community-protocol/function-framing-encode/) | Frames the compact envelope JSON `json`. |
| [`b64::encoded_len`](/docs/reference/rust/zaun-community-protocol/function-b64-encoded_len/) | The length of the unpadded encoding of `n` bytes. |
| [`framing::escaped_len`](/docs/reference/rust/zaun-community-protocol/function-framing-escaped_len/) | The bytes `text` takes written inside a JSON string, as a frame message travels in its application data: `"` and `\` take two, the control characters JSON writes as `\b`, `\t`, `\n |
| [`ids::fill_random`](/docs/reference/rust/zaun-community-protocol/function-ids-fill_random/) | Fills `buf` from the operating system CSPRNG. |
| [`command::object::find_interactive`](/docs/reference/rust/zaun-community-protocol/function-command-object-find_interactive/) | The enabled interactive component (button with a `custom_id`, or a select) with `custom_id` among a message's components: what a `MESSAGE_COMPONENT` interaction may name. |
| [`framing::app_data::frame`](/docs/reference/rust/zaun-community-protocol/function-framing-app_data-frame/) | The frame message text in application data of content type `tag`, or `None` when it is not a Zaun frame. Keys other than `FRAME_KEY` are ignored, for later additions. |
| [`encoding::from_bytes`](/docs/reference/rust/zaun-community-protocol/function-encoding-from_bytes/) | Decodes a top-level value, rejecting trailing bytes. |
| [`permissions::gate`](/docs/reference/rust/zaun-community-protocol/function-permissions-gate/) | The gate for a connection bound to a member in `state`. `Probation` and `Active` pass every bound command, which is then subject to its permissions. |
| [`permissions::gate_unbound`](/docs/reference/rust/zaun-community-protocol/function-permissions-gate_unbound/) | The gate for an unbound connection. |
| [`client::member::generate_member_key`](/docs/reference/rust/zaun-community-protocol/function-client-member-generate_member_key/) | Generates a fresh member key. Use one per community. |
| [`client::owner::generate_root_key`](/docs/reference/rust/zaun-community-protocol/function-client-owner-generate_root_key/) | Generates a fresh root key: the community's identity. Store it sealed; it cannot be recovered (ADR-0011). |
| [`client::owner::genesis`](/docs/reference/rust/zaun-community-protocol/function-client-owner-genesis/) | Builds and signs the genesis pair: delegation epoch 1 to `host` (no expiry, ADR-0005), descriptor revision 1 naming it, with `owner_member_key` as the owner binding. |
| [`command::object::bot_events::group_of`](/docs/reference/rust/zaun-community-protocol/function-command-object-bot_events-group_of/) | The group an event type belongs to, if any. |
| [`permissions::h1`](/docs/reference/rust/zaun-community-protocol/function-permissions-h1/) | H1: nobody acts on the owner, except the owner on themself. |
| [`permissions::h2`](/docs/reference/rust/zaun-community-protocol/function-permissions-h2/) | H2: acting on another member requires `top(T) < top(A)`; equal positions block and `ADMINISTRATOR` does not lift it. The owner passes. |
| [`permissions::h3`](/docs/reference/rust/zaun-community-protocol/function-permissions-h3/) | H3: every changed bit must be held (`changed ⊆ held`, `held` being `cp` or `chp`). |
| [`permissions::h3_owner_only`](/docs/reference/rust/zaun-community-protocol/function-permissions-h3_owner_only/) | H3 where only the owner is exempt: restriction masks (`newcomer_restrictions`, a lockdown's mask), for which permissions.md the protocol says "owner exempt" and the specification i |
| [`permissions::h4`](/docs/reference/rust/zaun-community-protocol/function-permissions-h4/) | H4: a role is manageable only strictly below the actor's top; the owner is exempt. |
| [`crypto::host_id`](/docs/reference/rust/zaun-community-protocol/function-crypto-host_id/) | `HostId = SHA3-256("zaun/host-id/v1" ‖ 0x00 ‖ host public key)`. |
| [`command::object::host_pattern_ok`](/docs/reference/rust/zaun-community-protocol/function-command-object-host_pattern_ok/) | A DNS name, optionally with one leading `*.` label: letters, digits and `-`, at least two labels, ≤ 253 bytes, lower case. |
| [`permissions::invites::invite_create`](/docs/reference/rust/zaun-community-protocol/function-permissions-invites-invite_create/) | `invite.create` beyond `CREATE_INVITE` itself (checked by the table in the right scope): the `invite_creation` rule, default roles the actor could assign, stricter-only admission o |
| [`envelope::is_mutating`](/docs/reference/rust/zaun-community-protocol/function-envelope-is_mutating/) | Whether a command `type` is mutating, hence idempotent and recorded: every command except `session.hello`, `*.get`, `*.list`, `message.history`, `audit.list`, `member.bans`, `membe |
| [`envelope::is_recorded`](/docs/reference/rust/zaun-community-protocol/function-envelope-is_recorded/) | Whether `response` is stored in the idempotency record; see `ResponseEnvelope::is_recorded`. |
| [`json::is_zero_u32`](/docs/reference/rust/zaun-community-protocol/function-json-is_zero_u32/) | `skip_serializing_if` for a `u32` that is absent when 0 (message `flags`, the protocol). |
| [`permissions::members::kick_or_ban`](/docs/reference/rust/zaun-community-protocol/function-permissions-members-kick_or_ban/) | `member.kick` and `member.ban`: not self (use `community.leave`); H1; H2. |
| [`crypto::voice::kid_for`](/docs/reference/rust/zaun-community-protocol/function-crypto-voice-kid_for/) | The KID of a sender's epoch: the first 3 bytes of `SHA3-256("zaun/v1/voice-kid" ‖ session)` above the 32-bit epoch. |
| [`command::object::bot_events::known`](/docs/reference/rust/zaun-community-protocol/function-command-object-bot_events-known/) | Whether `name` is something a manifest's `events` may list. |
| [`command::object::local_address_ok`](/docs/reference/rust/zaun-community-protocol/function-command-object-local_address_ok/) | A `local_network` entry: `host:port` exactly, where host is `localhost`, an IPv4 literal, a bracketed IPv6 literal or a lowercase DNS name, and port 1-65535 without a leading zero. |
| [`permissions::safety::lockdown_disable`](/docs/reference/rust/zaun-community-protocol/function-permissions-safety-lockdown_disable/) | `moderation.lockdown.disable`: `top(A) ≥` the enabling actor's recorded top (owner exempt), so a lower moderator cannot lift a higher one's lockdown, and H3 on the bits the lockdow |
| [`permissions::safety::lockdown_enable`](/docs/reference/rust/zaun-community-protocol/function-permissions-safety-lockdown_enable/) | `moderation.lockdown.enable` (also renewal and replacement): duration within 60 s – 7 days and H3 on the new lockdown's mask (only the owner exempt). Enabling while one is active r |
| [`command::max_envelope`](/docs/reference/rust/zaun-community-protocol/function-command-max_envelope/) | The largest command envelope for `type_` in bytes: `max_frame` for `community.create` and `community.descriptor.publish`, else 65 536. |
| [`permissions::roles::member_role_change`](/docs/reference/rust/zaun-community-protocol/function-permissions-roles-member_role_change/) | `member.roles.update` for one role `role` on `target`: H1; H2 unless self; H4 on the role; when assigning, `role.permissions ⊆ cp` (H3). `@everyone` is never listed. |
| [`command::object::message_json_len`](/docs/reference/rust/zaun-community-protocol/function-command-object-message_json_len/) | The bytes of a message's `content` and `embeds` as JSON, counted against `MESSAGE_JSON_MAX`. |
| [`command::object::message_json_len_with`](/docs/reference/rust/zaun-community-protocol/function-command-object-message_json_len_with/) | `message_json_len` plus the message's components, which count against the same `MESSAGE_JSON_MAX`. |
| [`crypto::message_prime`](/docs/reference/rust/zaun-community-protocol/function-crypto-message_prime/) | `M' = Prefix ‖ Label ‖ len(ctx) u8 ‖ ctx ‖ SHA-512(M)`, or `None` when `ctx` exceeds 255 bytes. |
| [`command::object::modal_inputs`](/docs/reference/rust/zaun-community-protocol/function-command-object-modal_inputs/) | The input components of a modal (everything inside its labels), in order. |
| [`permissions::members::moderate_content`](/docs/reference/rust/zaun-community-protocol/function-permissions-members-moderate_content/) | Deleting another member's message or removing their reaction: H1 only, no H2. |
| [`client::member::moved`](/docs/reference/rust/zaun-community-protocol/function-client-member-moved/) | Checks a `community.descriptor_updated` event against the client's stored state and says whether the community moved to another host. `chain` is the rotation chain the client holds |
| [`envelope::negotiate`](/docs/reference/rust/zaun-community-protocol/function-envelope-negotiate/) | Chooses the highest version in both ranges (`session.hello`, the protocol). |
| [`client::owner::next_revision`](/docs/reference/rust/zaun-community-protocol/function-client-owner-next_revision/) | A copy of `current` with the next revision and `issued_at = now_ms`, for the owner to edit and pass to `publish_body`. |
| [`permissions::members::nickname`](/docs/reference/rust/zaun-community-protocol/function-permissions-members-nickname/) | `member.update` of a nickname: one's own needs only `CHANGE_NICKNAME` (table); another's needs H1 and H2. |
| [`permissions::no_new_unknown`](/docs/reference/rust/zaun-community-protocol/function-permissions-no_new_unknown/) | the protocol: a command may not set an unknown bit that `old` did not already hold. |
| [`permissions::overrides::override_edit`](/docs/reference/rust/zaun-community-protocol/function-permissions-overrides-override_edit/) | One override edit in `channel.permissions.update` (or `channel.create` with initial overrides). `chp` is the actor's effective permissions in that channel; `old`/`new` are `(allow, |
| [`json::u64_decimal::parse`](/docs/reference/rust/zaun-community-protocol/function-json-u64_decimal-parse/) | Parses a canonical decimal. |
| [`command::attachment::parse_caption`](/docs/reference/rust/zaun-community-protocol/function-command-attachment-parse_caption/) | The attachment a caption names, when it is a Zaun caption. |
| [`envelope::parse_command`](/docs/reference/rust/zaun-community-protocol/function-envelope-parse_command/) | Parses a whole or reassembled command envelope `text`. |
| [`signed::parse_package`](/docs/reference/rust/zaun-community-protocol/function-signed-parse_package/) | Splits a `.zbot` file into its parts, checking every limit and that nothing trails. |
| [`client::owner::publish_body`](/docs/reference/rust/zaun-community-protocol/function-client-owner-publish_body/) | Signs `descriptor` with `root` (its current root key) and builds the `community.descriptor.publish` body. A given `delegation` is referenced by the descriptor (epoch and hash) and |
| [`crypto::publisher_id`](/docs/reference/rust/zaun-community-protocol/function-crypto-publisher_id/) | `PublisherId = SHA3-256("zaun/publisher-id/v1" ‖ 0x00 ‖ publisher key)`. |
| [`client::member::reauth_body`](/docs/reference/rust/zaun-community-protocol/function-client-member-reauth_body/) | The `migration.reauth` body: a `MemberReauth` signed with the member's existing key. Send it with `target.community_id` as the envelope `community_id`. |
| [`client::member::redeem_body`](/docs/reference/rust/zaun-community-protocol/function-client-member-redeem_body/) | The `invite.redeem` body: the link's secret, the member key and its registration (purpose 2) for the link's community and host. Send it with the link's community as the envelope `c |
| [`permissions::invites::redeemable_roles`](/docs/reference/rust/zaun-community-protocol/function-permissions-invites-redeemable_roles/) | At redemption, the default roles the issuer could still assign now; the rest are dropped, never granted (permissions the protocol, the protocol). A deleted role is simply absent fr |
| [`client::member::registration`](/docs/reference/rust/zaun-community-protocol/function-client-member-registration/) | Signs a `MemberKeyRegistration` with the member key itself. |
| [`permissions::members::reject`](/docs/reference/rust/zaun-community-protocol/function-permissions-members-reject/) | `membership.reject`: the target is `Pending`. |
| [`envelope::replay`](/docs/reference/rust/zaun-community-protocol/function-envelope-replay/) | Compares a retried command with the stored record for its key. |
| [`client::member::request_body`](/docs/reference/rust/zaun-community-protocol/function-client-member-request_body/) | The `membership.request` body with a purpose-3 registration. Send it with `target.community_id` as the envelope `community_id`. |
| [`permissions::required`](/docs/reference/rust/zaun-community-protocol/function-permissions-required/) | The requirement of a command by wire name; `None` for a name the table does not know (the engine answers `UNSUPPORTED_COMMAND`). |
| [`client::owner::resign_delegation`](/docs/reference/rust/zaun-community-protocol/function-client-owner-resign_delegation/) | Re-signs an existing delegation under a new root key. The bytes, hence the `delegation_hash` and epoch, are unchanged. |
| [`permissions::members::restore`](/docs/reference/rust/zaun-community-protocol/function-permissions-members-restore/) | `membership.restore`: not self; H1; H2; the target is `Suspended`. |
| [`permissions::roles::role_create`](/docs/reference/rust/zaun-community-protocol/function-permissions-roles-role_create/) | `role.create`: H3 on the new role's bits. Returns the new role's position; the engine shifts every role at or above it up by one. |
| [`permissions::roles::role_delete`](/docs/reference/rust/zaun-community-protocol/function-permissions-roles-role_delete/) | `role.delete`: not `@everyone`; H4. |
| [`permissions::roles::role_reorder`](/docs/reference/rust/zaun-community-protocol/function-permissions-roles-role_reorder/) | `role.reorder`: `roles` is the community's role table, `moves` the request's `(role_id, new_position)` pairs. Every role whose position changes must be below the actor before and a |
| [`permissions::roles::role_update`](/docs/reference/rust/zaun-community-protocol/function-permissions-roles-role_update/) | `role.update`: H4 on the role, H3 on `old XOR new`. `@everyone` may change only its permissions (`other_fields` is true when the body changes anything else). |
| [`client::owner::rotate_root`](/docs/reference/rust/zaun-community-protocol/function-client-owner-rotate_root/) | Signs the rotation from the current root `old` to `new`: `rotation_seq` follows the descriptor's latest rotation, and both keys sign. |
| [`client::owner::rotated_revision`](/docs/reference/rust/zaun-community-protocol/function-client-owner-rotated_revision/) | The next revision after `rotation`: the new root key and `rotations = rotation`. Sign it with the **new** key via `publish_body`, together with resign_delegation: the delegation is |
| [`b64::bytes::serialize`](/docs/reference/rust/zaun-community-protocol/function-b64-bytes-serialize/) | Serializes as base64url. |
| [`json::u64_decimal::serialize`](/docs/reference/rust/zaun-community-protocol/function-json-u64_decimal-serialize/) | Serializes as a decimal string. |
| [`crypto::sign`](/docs/reference/rust/zaun-community-protocol/function-crypto-sign/) | Signs `message` (the canonical bytes `B`) with context `ctx`, hedged: ML-DSA draws 32 fresh bytes from the OS CSPRNG (FIPS 204 Algorithm 2 with the context prefix built here). |
| [`crypto::sign_deterministic`](/docs/reference/rust/zaun-community-protocol/function-crypto-sign_deterministic/) | Deterministic signing (FIPS 204 deterministic variant). **Golden test vectors only**; real signatures use `sign`. |
| [`permissions::members::suspend`](/docs/reference/rust/zaun-community-protocol/function-permissions-members-suspend/) | `membership.suspend`: not self; H1; H2; the target is `Probation` or `Active`. |
| [`limits::text_within`](/docs/reference/rust/zaun-community-protocol/function-limits-text_within/) | Whether `text` has between `min` and `max` Unicode scalar values and at most 4× `max` bytes. |
| [`permissions::members::timeout`](/docs/reference/rust/zaun-community-protocol/function-permissions-members-timeout/) | `member.timeout` (set or clear): H1; H2; never the owner; never a target holding `ADMINISTRATOR`; `until ≤ now + 28 days`. |
| [`encoding::to_bytes`](/docs/reference/rust/zaun-community-protocol/function-encoding-to_bytes/) | Encodes a top-level value. |
| [`signed::valid_app_id`](/docs/reference/rust/zaun-community-protocol/function-signed-valid_app_id/) | Lowercase reverse-DNS: `a-z0-9-+(\.a-z0-9-+)+`, 3–64 bytes. |
| [`signed::valid_version`](/docs/reference/rust/zaun-community-protocol/function-signed-valid_version/) | Semantic Versioning 2.0.0 without build metadata, ≤ 64 bytes. |
| [`signed::valid_world`](/docs/reference/rust/zaun-community-protocol/function-signed-valid_world/) | `zaun:bot/bot@`, ≤ 64 bytes. |
| [`signed::validate_descriptor`](/docs/reference/rust/zaun-community-protocol/function-signed-validate_descriptor/) | Rule 1 and the descriptor parts of rule 5: `chain` is the full rotation chain from the genesis key (`community.rotations`), `accepted` the verifier's stored state, if any. |
| [`permissions::safety::validate_newcomer_restrictions`](/docs/reference/rust/zaun-community-protocol/function-permissions-safety-validate_newcomer_restrictions/) | Validates a new `newcomer_restrictions` mask: no `VIEW_CHANNEL` or `READ_MESSAGE_HISTORY`, no newly set unknown bit. |
| [`permissions::overrides::validate_override`](/docs/reference/rust/zaun-community-protocol/function-permissions-overrides-validate_override/) | Validates a new override value against the stored one (`old`, if any): `allow & deny == 0`; no known bit outside `CHANNEL_SCOPED`; no unknown bit that `old` did not already hold. U |
| [`signed::validate_pair`](/docs/reference/rust/zaun-community-protocol/function-signed-validate_pair/) | Whether a (descriptor, delegation) pair is valid at `now_ms`. `chain` is the full rotation chain from the genesis key; `accepted` is the verifier's stored state for the community, |
| [`crypto::verify`](/docs/reference/rust/zaun-community-protocol/function-crypto-verify/) | Verifies `sig` over `message` with context `ctx` against `pk`. |
| [`signed::verify_chain`](/docs/reference/rust/zaun-community-protocol/function-signed-verify_chain/) | Verifies a rotation chain from the genesis key: `genesis` must derive `community_id`; for rotation `i` (1-based, list order) `sig_old` verifies under `Kᵢ₋₁` **before** decoding, th |
| [`signed::verify_package`](/docs/reference/rust/zaun-community-protocol/function-signed-verify_package/) | Verifies the signature under the header's publisher key (`min_suite` 1) before anything else, then both hashes and the manifest's `app_id` and `version`. An all-zero signature is a |
| [`crypto::verify_raw`](/docs/reference/rust/zaun-community-protocol/function-crypto-verify_raw/) | RFC 10073 `id-MLDSA65-Ed25519-SHA512` verification over raw components (no suite byte): `pk = mldsaPK ‖ edPK` (1 984 B), `sig = mldsaSig ‖ edSig` (3 373 B), any `ctx` ≤ 255 B. Both |
| [`command::object::bot_events::wants`](/docs/reference/rust/zaun-community-protocol/function-command-object-bot_events-wants/) | Whether a bot subscribed to `events` (and holding `caps`) gets events of `kind`. |
| [`permissions::with_dependants`](/docs/reference/rust/zaun-community-protocol/function-permissions-with_dependants/) | Every bit that `dependencies` would also drop once `mask` is removed: used to attribute a lost dependant to the restriction that removed its prerequisite. |
| [`signed::write_package`](/docs/reference/rust/zaun-community-protocol/function-signed-write_package/) | Writes a `.zbot` file from a signed header and its parts. The caller computed the header's hashes from these exact `manifest` and `component` bytes. |
| [`signed::write_unsigned_package`](/docs/reference/rust/zaun-community-protocol/function-signed-write_unsigned_package/) | Writes an unsigned development `.zbot` file (all-zero signature, the protocol). |
## Structs
| Item | Summary |
|---|---|
| [`signed::AcceptedState`](/docs/reference/rust/zaun-community-protocol/struct-signed-acceptedstate/) | What a verifier stores per community for anti-rollback (rule 5). |
| [`command::sync::Ack`](/docs/reference/rust/zaun-community-protocol/struct-command-sync-ack/) | `sync.ack`: the highest contiguous sequence applied per stream. Not idempotency-recorded; lower values are ignored by the host. |
| [`command::object::ActionRow`](/docs/reference/rust/zaun-community-protocol/struct-command-object-actionrow/) | Type 1. |
| [`permissions::ActiveLockdown`](/docs/reference/rust/zaun-community-protocol/struct-permissions-activelockdown/) | The lockdown currently in force, as lockdown management sees it. |
| [`command::object::Activity`](/docs/reference/rust/zaun-community-protocol/struct-command-object-activity/) | An activity. |
| [`command::object::Admission`](/docs/reference/rust/zaun-community-protocol/struct-command-object-admission/) | How a member was admitted. |
| [`command::object::AdmissionOverrides`](/docs/reference/rust/zaun-community-protocol/struct-command-object-admissionoverrides/) | `invite.create.admission_overrides`: stricter-only admission settings. |
| [`command::object::AdmissionPolicy`](/docs/reference/rust/zaun-community-protocol/struct-command-object-admissionpolicy/) | The full admission policy. Visible to `MANAGE_SAFETY` holders. |
| [`signed::AdmissionSummary`](/docs/reference/rust/zaun-community-protocol/struct-signed-admissionsummary/) | `AdmissionSummary = mode u8 ‖ level u8`: the owner's public claim; the host's policy is authoritative for enforcement. |
| [`command::invite::Admitted`](/docs/reference/rust/zaun-community-protocol/struct-command-invite-admitted/) | `invite.redeem` and `membership.request` response. |
| [`command::object::ApplicationCommand`](/docs/reference/rust/zaun-community-protocol/struct-command-object-applicationcommand/) | An application command. |
| [`command::membership::Approve`](/docs/reference/rust/zaun-community-protocol/struct-command-membership-approve/) | `membership.approve`. |
| [`command::object::Attachment`](/docs/reference/rust/zaun-community-protocol/struct-command-object-attachment/) | An attachment record: what a message carries, and what `attachment.download` and `attachment.updated` answer. |
| [`ids::AttachmentId`](/docs/reference/rust/zaun-community-protocol/struct-ids-attachmentid/) | An attachment. |
| [`command::object::AuditChange`](/docs/reference/rust/zaun-community-protocol/struct-command-object-auditchange/) | `changes: {field, old, new}`. SPEC: value types are never given; raw JSON. |
| [`command::object::AuditEntry`](/docs/reference/rust/zaun-community-protocol/struct-command-object-auditentry/) | An audit entry. |
| [`ids::AuditId`](/docs/reference/rust/zaun-community-protocol/struct-ids-auditid/) | An audit-log entry. |
| [`command::object::AuditTarget`](/docs/reference/rust/zaun-community-protocol/struct-command-object-audittarget/) | `target: {t, c}` of an audit entry. |
| [`b64::B64Error`](/docs/reference/rust/zaun-community-protocol/struct-b64-b64error/) | The input is not canonical base64url without padding. |
| [`command::object::Ban`](/docs/reference/rust/zaun-community-protocol/struct-command-object-ban/) | One entry of `member.bans`. |
| [`ids::BanId`](/docs/reference/rust/zaun-community-protocol/struct-ids-banid/) | A ban record. |
| [`command::member::BanMember`](/docs/reference/rust/zaun-community-protocol/struct-command-member-banmember/) | `member.ban`. |
| [`command::member::Banned`](/docs/reference/rust/zaun-community-protocol/struct-command-member-banned/) | `member.ban` response. |
| [`command::member::BanPage`](/docs/reference/rust/zaun-community-protocol/struct-command-member-banpage/) | `member.bans` response. |
| [`command::member::Bans`](/docs/reference/rust/zaun-community-protocol/struct-command-member-bans/) | `member.bans`. |
| [`command::object::Binding`](/docs/reference/rust/zaun-community-protocol/struct-command-object-binding/) | `session.welcome.binding`. |
| [`envelope::BodyHash`](/docs/reference/rust/zaun-community-protocol/struct-envelope-bodyhash/) | SHA3-256 of a command's `body` JSON text **exactly as received**: reformatting the same JSON gives a different hash, which is why retries must resend byte-identical bodies. |
| [`command::object::BotCard`](/docs/reference/rust/zaun-community-protocol/struct-command-object-botcard/) | The public description of an installed bot, visible to every member. |
| [`ids::BotId`](/docs/reference/rust/zaun-community-protocol/struct-ids-botid/) | An installed bot. |
| [`signed::BotPackage`](/docs/reference/rust/zaun-community-protocol/struct-signed-botpackage/) | The signed header of a bot package, signed by the publisher key inside it. |
| [`event::BotRemoved`](/docs/reference/rust/zaun-community-protocol/struct-event-botremoved/) | `bot.removed`: `{bot_id, member_id}`. |
| [`command::bot::Bots`](/docs/reference/rust/zaun-community-protocol/struct-command-bot-bots/) | `bot.list` response. |
| [`command::object::Button`](/docs/reference/rust/zaun-community-protocol/struct-command-object-button/) | Type 2. |
| [`command::object::Capabilities`](/docs/reference/rust/zaun-community-protocol/struct-command-object-capabilities/) | What a bot may do beyond its permission bits. Every field defaults to "no". |
| [`signed::ChainHead`](/docs/reference/rust/zaun-community-protocol/struct-signed-chainhead/) | Every root key of a verified chain, `K₀` (genesis) to `Kₙ` (current). Only `super::verify_chain` creates one. |
| [`ids::Challenge`](/docs/reference/rust/zaun-community-protocol/struct-ids-challenge/) | A host-issued challenge that a signed proof must echo. |
| [`permissions::Channel`](/docs/reference/rust/zaun-community-protocol/struct-permissions-channel/) | The channel context of a channel-level resolution. |
| [`command::object::Channel`](/docs/reference/rust/zaun-community-protocol/struct-command-object-channel/) | A channel or category as members see it. |
| [`command::object::ChannelAfter`](/docs/reference/rust/zaun-community-protocol/struct-command-object-channelafter/) | `{channel_id, after}` (`sync.resume`, the protocol). |
| [`event::ChannelCreated`](/docs/reference/rust/zaun-community-protocol/struct-event-channelcreated/) | `channel.created`: the channel object plus `reason?: "access_gained"`. |
| [`command::object::ChannelCursor`](/docs/reference/rust/zaun-community-protocol/struct-command-object-channelcursor/) | `{channel_id, seq}` (`sync.ack`, the protocol). |
| [`event::ChannelDeleted`](/docs/reference/rust/zaun-community-protocol/struct-event-channeldeleted/) | `channel.deleted`: `{channel_id, reason?: "access_lost"}`. |
| [`command::sync::ChannelEvents`](/docs/reference/rust/zaun-community-protocol/struct-command-sync-channelevents/) | One channel of `sync.resume.channels`. |
| [`command::object::ChannelFloor`](/docs/reference/rust/zaun-community-protocol/struct-command-object-channelfloor/) | `{channel_id, floor}` (`sync.resume.floors`, the protocol). |
| [`command::object::ChannelHead`](/docs/reference/rust/zaun-community-protocol/struct-command-object-channelhead/) | `{channel_id, head_seq, floor}` (`sync.resume.new`, the protocol). |
| [`ids::ChannelId`](/docs/reference/rust/zaun-community-protocol/struct-ids-channelid/) | A channel or category. |
| [`command::object::ChannelPosition`](/docs/reference/rust/zaun-community-protocol/struct-command-object-channelposition/) | One entry of `channel.reorder` and `channel.reordered`. |
| [`command::dm::Channels`](/docs/reference/rust/zaun-community-protocol/struct-command-dm-channels/) | `dm.list` response: the actor's open DMs. |
| [`event::ChannelsReordered`](/docs/reference/rust/zaun-community-protocol/struct-event-channelsreordered/) | `channel.reordered`: `positions` (only channels the member can see). |
| [`command::object::Checkbox`](/docs/reference/rust/zaun-community-protocol/struct-command-object-checkbox/) | Type 23. Never required; use a one-option checkbox group for that. |
| [`command::object::CheckboxGroup`](/docs/reference/rust/zaun-community-protocol/struct-command-object-checkboxgroup/) | Type 22. |
| [`command::object::Choice`](/docs/reference/rust/zaun-community-protocol/struct-command-object-choice/) | A predefined choice of an option, or an autocomplete result. |
| [`command::dm::Close`](/docs/reference/rust/zaun-community-protocol/struct-command-dm-close/) | `dm.close`: hides the DM for the actor. |
| [`envelope::CommandEnvelope`](/docs/reference/rust/zaun-community-protocol/struct-envelope-commandenvelope/) | `{ "v", "type", "request_id", "community_id", "channel_id"?, "body" }`. |
| [`ids::CommandId`](/docs/reference/rust/zaun-community-protocol/struct-ids-commandid/) | An application command of a bot. |
| [`command::object::CommandOption`](/docs/reference/rust/zaun-community-protocol/struct-command-object-commandoption/) | An option of a command or subcommand. |
| [`command::app::Commands`](/docs/reference/rust/zaun-community-protocol/struct-command-app-commands/) | Response of both: commands with ids (and `bot_id` in `command.list`). |
| [`event::CommandsUpdated`](/docs/reference/rust/zaun-community-protocol/struct-event-commandsupdated/) | `command.updated`: one bot's whole command list (`[]` while disabled or removed). |
| [`signed::CommunityDescriptor`](/docs/reference/rust/zaun-community-protocol/struct-signed-communitydescriptor/) | The community's public, owner-signed statement. Signed by the current root key. |
| [`ids::CommunityId`](/docs/reference/rust/zaun-community-protocol/struct-ids-communityid/) | `SHA3-256("zaun/community-id/v1" ‖ 0x00 ‖ genesis root public key)`. |
| [`command::object::CommunityProfile`](/docs/reference/rust/zaun-community-protocol/struct-command-object-communityprofile/) | The host-managed community profile. |
| [`command::sync::CommunitySnapshot`](/docs/reference/rust/zaun-community-protocol/struct-command-sync-communitysnapshot/) | The single item of `part: "community"`. |
| [`command::object::ConfigKey`](/docs/reference/rust/zaun-community-protocol/struct-command-object-configkey/) | One setting a bot declares in its manifest's `config` table; the owner sets its value. |
| [`command::bot::Configure`](/docs/reference/rust/zaun-community-protocol/struct-command-bot-configure/) | `bot.configure`: the owner sets or clears values of the settings the bot's manifest declares. With neither, it only reads them. |
| [`command::bot::Configured`](/docs/reference/rust/zaun-community-protocol/struct-command-bot-configured/) | `bot.configure` response: the values the owner set, secrets shown as `"••••"`. |
| [`command::object::Container`](/docs/reference/rust/zaun-community-protocol/struct-command-object-container/) | Type 17. |
| [`permissions::Context`](/docs/reference/rust/zaun-community-protocol/struct-permissions-context/) | Community-wide inputs shared by every resolution in one request. |
| [`command::channel::Create`](/docs/reference/rust/zaun-community-protocol/struct-command-channel-create/) | `channel.create`. |
| [`command::community::Create`](/docs/reference/rust/zaun-community-protocol/struct-command-community-create/) | `community.create`. The envelope's `community_id` names the target. |
| [`command::interaction::Create`](/docs/reference/rust/zaun-community-protocol/struct-command-interaction-create/) | `interaction.create`. |
| [`command::invite::Create`](/docs/reference/rust/zaun-community-protocol/struct-command-invite-create/) | `invite.create`. |
| [`command::report::Create`](/docs/reference/rust/zaun-community-protocol/struct-command-report-create/) | `report.create`. |
| [`command::role::Create`](/docs/reference/rust/zaun-community-protocol/struct-command-role-create/) | `role.create`. |
| [`command::community::Created`](/docs/reference/rust/zaun-community-protocol/struct-command-community-created/) | `community.create` response. |
| [`command::interaction::Created`](/docs/reference/rust/zaun-community-protocol/struct-command-interaction-created/) | `interaction.create` response. |
| [`command::invite::Created`](/docs/reference/rust/zaun-community-protocol/struct-command-invite-created/) | `invite.create` response. `link` embeds the secret and is shown once. |
| [`command::report::Created`](/docs/reference/rust/zaun-community-protocol/struct-command-report-created/) | `report.create` response. |
| [`client::Cursor`](/docs/reference/rust/zaun-community-protocol/struct-client-cursor/) | One stream's position: the highest contiguous sequence applied, and events held aside. |
| [`command::object::Cursors`](/docs/reference/rust/zaun-community-protocol/struct-command-object-cursors/) | The cursors a binding command returns (`community.create`, `invite.redeem`, `membership.request`). |
| [`client::CursorTable`](/docs/reference/rust/zaun-community-protocol/struct-client-cursortable/) | The member cursor and one cursor per channel. |
| [`command::object::DefaultValue`](/docs/reference/rust/zaun-community-protocol/struct-command-object-defaultvalue/) | A preselected entity of a user, role, mentionable or channel select. |
| [`signed::DelegationRef`](/docs/reference/rust/zaun-community-protocol/struct-signed-delegationref/) | `DelegationRef = epoch u64 ‖ delegation_hash bytes32`, where `delegation_hash` is `SHA3-256` of the delegation's canonical bytes (not its signature). |
| [`command::channel::Delete`](/docs/reference/rust/zaun-community-protocol/struct-command-channel-delete/) | `channel.delete`. |
| [`command::message::Delete`](/docs/reference/rust/zaun-community-protocol/struct-command-message-delete/) | `message.delete`. |
| [`command::role::Delete`](/docs/reference/rust/zaun-community-protocol/struct-command-role-delete/) | `role.delete`. |
| [`permissions::Denial`](/docs/reference/rust/zaun-community-protocol/struct-permissions-denial/) | A failed permission or hierarchy check. |
| [`client::owner::DescriptorContent`](/docs/reference/rust/zaun-community-protocol/struct-client-owner-descriptorcontent/) | The owner-editable, public fields of a descriptor. |
| [`ids::DescriptorHash`](/docs/reference/rust/zaun-community-protocol/struct-ids-descriptorhash/) | `SHA3-256` of a signed descriptor's bytes. The descriptor names its delegation's hash, so this identifies the descriptor/delegation pair. |
| [`command::community::DescriptorPublish`](/docs/reference/rust/zaun-community-protocol/struct-command-community-descriptorpublish/) | `community.descriptor.publish`. Owner only; larger envelope limit. |
| [`event::DescriptorUpdated`](/docs/reference/rust/zaun-community-protocol/struct-event-descriptorupdated/) | `community.descriptor_updated`: signed `descriptor` and `delegation`. |
| [`command::bot::Disable`](/docs/reference/rust/zaun-community-protocol/struct-command-bot-disable/) | `bot.disable`. |
| [`command::lockdown::Disable`](/docs/reference/rust/zaun-community-protocol/struct-command-lockdown-disable/) | `moderation.lockdown.disable` (`{}`). |
| [`event::DmClosed`](/docs/reference/rust/zaun-community-protocol/struct-event-dmclosed/) | `dm.closed`: to the closer's own stream. |
| [`command::attachment::Download`](/docs/reference/rust/zaun-community-protocol/struct-command-attachment-download/) | `attachment.download`: asks the host to send an attachment's file. |
| [`command::message::Edit`](/docs/reference/rust/zaun-community-protocol/struct-command-message-edit/) | `message.edit`. Author only. |
| [`command::object::Embed`](/docs/reference/rust/zaun-community-protocol/struct-command-object-embed/) | An embed. Every text is optional, but an embed shows something: a title, a description, an author, a footer, a picture or a field (`color`, `timestamp` and `url` alone do not count |
| [`command::object::EmbedAuthor`](/docs/reference/rust/zaun-community-protocol/struct-command-object-embedauthor/) | `author: {name, url?, icon?}` of an embed. |
| [`command::object::EmbedField`](/docs/reference/rust/zaun-community-protocol/struct-command-object-embedfield/) | `fields: {name, value, inline}` of an embed. |
| [`command::object::EmbedFooter`](/docs/reference/rust/zaun-community-protocol/struct-command-object-embedfooter/) | `footer: {text, icon?}` of an embed. |
| [`command::object::Empty`](/docs/reference/rust/zaun-community-protocol/struct-command-object-empty/) | An empty body or response, `{}`. Unknown fields are ignored. |
| [`command::bot::Enable`](/docs/reference/rust/zaun-community-protocol/struct-command-bot-enable/) | `bot.enable` (distinct type so the command table can name it). |
| [`command::lockdown::Enable`](/docs/reference/rust/zaun-community-protocol/struct-command-lockdown-enable/) | `moderation.lockdown.enable`; responds with the full `Lockdown`. |
| [`framing::EncodedFrame`](/docs/reference/rust/zaun-community-protocol/struct-framing-encodedframe/) | The transport messages of one frame, in sending order. |
| [`command::object::EntitySelect`](/docs/reference/rust/zaun-community-protocol/struct-command-object-entityselect/) | Types 5–8. |
| [`envelope::ErrorBody`](/docs/reference/rust/zaun-community-protocol/struct-envelope-errorbody/) | An error object: `code`, `message`, and the code's extra fields placed next to `code`. Build it with the constructors (one per `ErrorCode`, see `errors.rs`); they use fixed message |
| [`envelope::ErrorExtras`](/docs/reference/rust/zaun-community-protocol/struct-envelope-errorextras/) | The extra fields of the protocol Each applies to the codes named on it. |
| [`envelope::EventEnvelope`](/docs/reference/rust/zaun-community-protocol/struct-envelope-eventenvelope/) | `{ "v", "type", "community_id", "channel_id"?, "stream", "sequence"?, "timestamp", "actor_id", "body" }`. Deserialisation validates with `EventEnvelope::validate`. |
| [`command::sync::Events`](/docs/reference/rust/zaun-community-protocol/struct-command-sync-events/) | `sync.events`. |
| [`envelope::EventsBatch`](/docs/reference/rust/zaun-community-protocol/struct-envelope-eventsbatch/) | A validated `events` batch. Its events are processed in order, exactly as individual events; the batch itself has no stream, sequence or timestamp. |
| [`command::sync::EventsPage`](/docs/reference/rust/zaun-community-protocol/struct-command-sync-eventspage/) | `sync.events` response, also the `member` part of `sync.resume`. |
| [`command::object::Evidence`](/docs/reference/rust/zaun-community-protocol/struct-command-object-evidence/) | One evidence item. |
| [`signed::ExportManifest`](/docs/reference/rust/zaun-community-protocol/struct-signed-exportmanifest/) | Signed by the exporting host's key (and, in a later version, the root key when the owner exports). The key is inside the bytes: an importer trusts it only once it matches a host de |
| [`command::object::FileComponent`](/docs/reference/rust/zaun-community-protocol/struct-command-object-filecomponent/) | Type 13. |
| [`command::object::FileUpload`](/docs/reference/rust/zaun-community-protocol/struct-command-object-fileupload/) | Type 19. |
| [`command::interaction::Followup`](/docs/reference/rust/zaun-community-protocol/struct-command-interaction-followup/) | `interaction.followup` and `interaction.original.edit`. |
| [`framing::FragId`](/docs/reference/rust/zaun-community-protocol/struct-framing-fragid/) | A fragment id: 8 random bytes, unique per sender per connection among open reassemblies. |
| [`framing::Fragment`](/docs/reference/rust/zaun-community-protocol/struct-framing-fragment/) | One fragment message, borrowing its chunk from the received text. |
| [`crypto::voice::FrameOpener`](/docs/reference/rust/zaun-community-protocol/struct-crypto-voice-frameopener/) | Opens one sender's frames for one KID, rejecting replays. |
| [`crypto::voice::FrameSealer`](/docs/reference/rust/zaun-community-protocol/struct-crypto-voice-framesealer/) | Seals this participant's frames under one base key and KID. The counter starts at zero and never repeats; after `FRAMES_PER_KEY` frames it refuses and the sender rekeys. |
| [`client::Gap`](/docs/reference/rust/zaun-community-protocol/struct-client-gap/) | A detected gap in a sequenced stream. |
| [`client::owner::Genesis`](/docs/reference/rust/zaun-community-protocol/struct-client-owner-genesis/) | A signed genesis descriptor (revision 1) and the delegation it references (epoch 1). |
| [`command::community::Get`](/docs/reference/rust/zaun-community-protocol/struct-command-community-get/) | `community.get` (`{}`). |
| [`command::lockdown::Get`](/docs/reference/rust/zaun-community-protocol/struct-command-lockdown-get/) | `moderation.lockdown.get` (`{}`). |
| [`command::member::Get`](/docs/reference/rust/zaun-community-protocol/struct-command-member-get/) | `member.get`. |
| [`command::report::Get`](/docs/reference/rust/zaun-community-protocol/struct-command-report-get/) | `report.get`. |
| [`command::lockdown::GetResponse`](/docs/reference/rust/zaun-community-protocol/struct-command-lockdown-getresponse/) | `moderation.lockdown.get` response: `{ "lockdown": object \| null }`, the full form for `MANAGE_SAFETY` holders, otherwise the public form; `null` when none is active. |
| [`command::bot::Grant`](/docs/reference/rust/zaun-community-protocol/struct-command-bot-grant/) | `bot.grant`: the new effective grants, replacing the old. |
| [`command::bot::GrantChoice`](/docs/reference/rust/zaun-community-protocol/struct-command-bot-grantchoice/) | Optional grant choices of `bot.install`: absent means everything the manifest asks for, within the operator's ceiling. |
| [`command::object::Grants`](/docs/reference/rust/zaun-community-protocol/struct-command-object-grants/) | A bot's grants: permission bits (its managed role) and capabilities. |
| [`crypto::voice::GroupKeys`](/docs/reference/rust/zaun-community-protocol/struct-crypto-voice-groupkeys/) | A participant's key state for one voice session. |
| [`crypto::voice::Header`](/docs/reference/rust/zaun-community-protocol/struct-crypto-voice-header/) | An SFrame header (RFC 9605 the protocol). |
| [`command::session::Hello`](/docs/reference/rust/zaun-community-protocol/struct-command-session-hello/) | `session.hello`. |
| [`command::message::History`](/docs/reference/rust/zaun-community-protocol/struct-command-message-history/) | `message.history`. |
| [`command::message::HistoryPage`](/docs/reference/rust/zaun-community-protocol/struct-command-message-historypage/) | `message.history` response. |
| [`command::session::HostAttachments`](/docs/reference/rust/zaun-community-protocol/struct-command-session-hostattachments/) | `session.welcome.attachments`. |
| [`signed::HostDelegation`](/docs/reference/rust/zaun-community-protocol/struct-signed-hostdelegation/) | The root key's authorisation of one host to operate the community. |
| [`ids::HostId`](/docs/reference/rust/zaun-community-protocol/struct-ids-hostid/) | `SHA3-256("zaun/host-id/v1" ‖ 0x00 ‖ host public key)`. |
| [`client::owner::HostInfo`](/docs/reference/rust/zaun-community-protocol/struct-client-owner-hostinfo/) | What an owner needs about a host to delegate to it. |
| [`signed::HostSessionProof`](/docs/reference/rust/zaun-community-protocol/struct-signed-hostsessionproof/) | The host's proof of key possession in `session.welcome`. Signed by the host key. |
| [`command::object::IceServer`](/docs/reference/rust/zaun-community-protocol/struct-command-object-iceserver/) | One ICE server, in the shape of WebRTC's `RTCIceServer`. |
| [`command::community::Icon`](/docs/reference/rust/zaun-community-protocol/struct-command-community-icon/) | `community.icon.get` response; the client checks `SHA3-256(icon)` against the descriptor. |
| [`command::community::IconGet`](/docs/reference/rust/zaun-community-protocol/struct-command-community-iconget/) | `community.icon.get` (`{}`). |
| [`command::community::Info`](/docs/reference/rust/zaun-community-protocol/struct-command-community-info/) | `community.get` response. |
| [`command::bot::Install`](/docs/reference/rust/zaun-community-protocol/struct-command-bot-install/) | `bot.install`. |
| [`command::object::Interaction`](/docs/reference/rust/zaun-community-protocol/struct-command-object-interaction/) | An interaction as delivered to its bot (`interaction.created`). |
| [`event::InteractionAutocomplete`](/docs/reference/rust/zaun-community-protocol/struct-event-interactionautocomplete/) | `interaction.autocomplete`: suggestions, to the invoker only. |
| [`event::InteractionFailed`](/docs/reference/rust/zaun-community-protocol/struct-event-interactionfailed/) | `interaction.failed`, to the invoker only. |
| [`ids::InteractionId`](/docs/reference/rust/zaun-community-protocol/struct-ids-interactionid/) | An interaction: one use of a command, component or modal. |
| [`event::InteractionMessage`](/docs/reference/rust/zaun-community-protocol/struct-event-interactionmessage/) | `interaction.message`: an ephemeral message, to the invoker only. |
| [`command::object::InteractionMetadata`](/docs/reference/rust/zaun-community-protocol/struct-command-object-interactionmetadata/) | `interaction_metadata` of a message that answers an interaction. |
| [`event::InteractionModal`](/docs/reference/rust/zaun-community-protocol/struct-event-interactionmodal/) | `interaction.modal`: open a modal, to the invoker only. |
| [`ids::InviteId`](/docs/reference/rust/zaun-community-protocol/struct-ids-inviteid/) | An invitation (public handle; the secret is `InviteSecret`). |
| [`command::object::InviteLink`](/docs/reference/rust/zaun-community-protocol/struct-command-object-invitelink/) | A `zaun://join/…` link. It embeds the `crate::ids::InviteSecret`, so `Debug` is redacted; the text is reachable only through `InviteLink::expose`. |
| [`client::member::InvitePayload`](/docs/reference/rust/zaun-community-protocol/struct-client-member-invitepayload/) | The canonical `InvitePayload`. Unsigned: after connecting, the welcome must show a descriptor deriving `community_id`, a delegation naming `host_id`, and a host proof — which `Invi |
| [`permissions::invites::InviteRequest`](/docs/reference/rust/zaun-community-protocol/struct-permissions-invites-inviterequest/) | The parts of an `invite.create` body the checks need. |
| [`ids::InviteSecret`](/docs/reference/rust/zaun-community-protocol/struct-ids-invitesecret/) | An invitation secret: 32 random bytes, shown once. Never logged: `Debug` is redacted and it has no `Display`. Zeroized on drop. |
| [`command::object::InviteSummary`](/docs/reference/rust/zaun-community-protocol/struct-command-object-invitesummary/) | One entry of `invite.list`. Never carries the secret. |
| [`command::object::InviteUse`](/docs/reference/rust/zaun-community-protocol/struct-command-object-inviteuse/) | One entry of `invite.uses`. |
| [`command::voice::Join`](/docs/reference/rust/zaun-community-protocol/struct-command-voice-join/) | `voice.join`: enter a voice channel (leaving any other one). |
| [`command::voice::Joined`](/docs/reference/rust/zaun-community-protocol/struct-command-voice-joined/) | The `voice.join` response. |
| [`command::object::JoinRate`](/docs/reference/rust/zaun-community-protocol/struct-command-object-joinrate/) | `join_rate: {per_hour}`. |
| [`command::voice::KeyFor`](/docs/reference/rust/zaun-community-protocol/struct-command-voice-keyfor/) | One entry of `voice.keys`. |
| [`crypto::voice::KeyPackage`](/docs/reference/rust/zaun-community-protocol/struct-crypto-voice-keypackage/) | A participant's voice key for one session in one voice channel. |
| [`command::voice::Keys`](/docs/reference/rust/zaun-community-protocol/struct-command-voice-keys/) | `voice.keys`: the sender's media key for `epoch`, wrapped for each other participant. A whole mesh always fits in one command, so an epoch is never split. |
| [`command::member::Kick`](/docs/reference/rust/zaun-community-protocol/struct-command-member-kick/) | `member.kick`. |
| [`command::object::Label`](/docs/reference/rust/zaun-community-protocol/struct-command-object-label/) | Type 18. |
| [`command::community::Leave`](/docs/reference/rust/zaun-community-protocol/struct-command-community-leave/) | `community.leave` (`{}`). The owner cannot leave (engine: `CONFLICT`). |
| [`command::voice::Leave`](/docs/reference/rust/zaun-community-protocol/struct-command-voice-leave/) | `voice.leave`: leave the voice channel the member is in. |
| [`command::app::List`](/docs/reference/rust/zaun-community-protocol/struct-command-app-list/) | `command.list`. |
| [`command::audit::List`](/docs/reference/rust/zaun-community-protocol/struct-command-audit-list/) | `audit.list`. |
| [`command::bot::List`](/docs/reference/rust/zaun-community-protocol/struct-command-bot-list/) | `bot.list`. |
| [`command::dm::List`](/docs/reference/rust/zaun-community-protocol/struct-command-dm-list/) | `dm.list`. |
| [`command::invite::List`](/docs/reference/rust/zaun-community-protocol/struct-command-invite-list/) | `invite.list`. |
| [`command::member::List`](/docs/reference/rust/zaun-community-protocol/struct-command-member-list/) | `member.list`. |
| [`command::presence::List`](/docs/reference/rust/zaun-community-protocol/struct-command-presence-list/) | `presence.list`: the presences of the community's connected, visible members. |
| [`command::report::List`](/docs/reference/rust/zaun-community-protocol/struct-command-report-list/) | `report.list`. |
| [`permissions::Lockdown`](/docs/reference/rust/zaun-community-protocol/struct-permissions-lockdown/) | The community's lockdown row. |
| [`command::object::Lockdown`](/docs/reference/rust/zaun-community-protocol/struct-command-object-lockdown/) | The full lockdown record, for `MANAGE_SAFETY` holders: `{ lockdown_id, restrictions, forced_slowmode_s?, newcomer_window_s?, expires_at, reason?, actor_id }`. |
| [`ids::LockdownId`](/docs/reference/rust/zaun-community-protocol/struct-ids-lockdownid/) | An emergency lockdown. |
| [`command::object::LockdownPublic`](/docs/reference/rust/zaun-community-protocol/struct-command-object-lockdownpublic/) | The public form, for members without `MANAGE_SAFETY`: `{active, restrictions_affecting_you, expires_at}`. With no active lockdown (disabled or expired) it is `{active: false, restr |
| [`permissions::LockdownRestrictions`](/docs/reference/rust/zaun-community-protocol/struct-permissions-lockdownrestrictions/) | The restrictions a lockdown names. |
| [`command::object::Manifest`](/docs/reference/rust/zaun-community-protocol/struct-command-object-manifest/) | The manifest inside a bot package. |
| [`signed::ManifestEntry`](/docs/reference/rust/zaun-community-protocol/struct-signed-manifestentry/) | One chunk: what it is, its length and its `SHA3-256`. |
| [`command::object::ManifestLimits`](/docs/reference/rust/zaun-community-protocol/struct-command-object-manifestlimits/) | Resource limits a manifest asks for; the host may lower them. |
| [`command::object::MediaGallery`](/docs/reference/rust/zaun-community-protocol/struct-command-object-mediagallery/) | Type 12. |
| [`command::object::MediaItem`](/docs/reference/rust/zaun-community-protocol/struct-command-object-mediaitem/) | One picture of a media gallery. |
| [`command::object::Member`](/docs/reference/rust/zaun-community-protocol/struct-command-object-member/) | A member as visible to the viewer. Optional fields depend on the viewer's permissions; the host filters them. |
| [`ids::MemberId`](/docs/reference/rust/zaun-community-protocol/struct-ids-memberid/) | A community-scoped member identity, host-assigned. |
| [`signed::MemberKeyRegistration`](/docs/reference/rust/zaun-community-protocol/struct-signed-memberkeyregistration/) | Proves that the client holds the private key of the member key it registers. Signed by that key. |
| [`event::MemberLeft`](/docs/reference/rust/zaun-community-protocol/struct-event-memberleft/) | `member.left`: `{member_id}`. |
| [`signed::MemberReauth`](/docs/reference/rust/zaun-community-protocol/struct-signed-memberreauth/) | Signed by the member key. Binds the challenge to the community, the new host and the delegation epoch it operates under, so a proof made for one host or epoch is useless at another |
| [`event::MemberRemoved`](/docs/reference/rust/zaun-community-protocol/struct-event-memberremoved/) | `member.removed`: `{reason}`, to the subject only; then the session ends. |
| [`event::MemberRolesUpdated`](/docs/reference/rust/zaun-community-protocol/struct-event-memberrolesupdated/) | `member.roles_updated`: `{member_id, role_ids}`. |
| [`event::MembershipUpdated`](/docs/reference/rust/zaun-community-protocol/struct-event-membershipupdated/) | `membership.updated`: `{member_id, state, until?}`. |
| [`event::MemberTimedOut`](/docs/reference/rust/zaun-community-protocol/struct-event-membertimedout/) | `member.timed_out`: `{member_id, until}`. |
| [`command::object::Mentions`](/docs/reference/rust/zaun-community-protocol/struct-command-object-mentions/) | `mentions: {everyone, members, roles}`. |
| [`command::object::Message`](/docs/reference/rust/zaun-community-protocol/struct-command-object-message/) | A stored message as returned by `message.history`. |
| [`command::object::MessageBody`](/docs/reference/rust/zaun-community-protocol/struct-command-object-messagebody/) | Content, embeds, components, attachments, mentions and flags of a bot's message. |
| [`event::MessageCreated`](/docs/reference/rust/zaun-community-protocol/struct-event-messagecreated/) | `message.created`. |
| [`event::MessageDeleted`](/docs/reference/rust/zaun-community-protocol/struct-event-messagedeleted/) | `message.deleted`: `{message_id}`. |
| [`ids::MessageId`](/docs/reference/rust/zaun-community-protocol/struct-ids-messageid/) | A message. |
| [`event::MessagesBulkDeleted`](/docs/reference/rust/zaun-community-protocol/struct-event-messagesbulkdeleted/) | `messages.bulk_deleted`: `{message_ids}` (≤ 1 000). |
| [`event::MessageUpdated`](/docs/reference/rust/zaun-community-protocol/struct-event-messageupdated/) | `message.updated`: `{message_id, content, embeds?, components?, flags?, mentions?, edited_at}`. |
| [`command::voice::Moderate`](/docs/reference/rust/zaun-community-protocol/struct-command-voice-moderate/) | `voice.moderate`: server mute or deafen, move or disconnect another member. |
| [`client::member::Moved`](/docs/reference/rust/zaun-community-protocol/struct-client-member-moved/) | A verified move: the new pair (store its state) and how to reach the new host. |
| [`command::object::NewProfile`](/docs/reference/rust/zaun-community-protocol/struct-command-object-newprofile/) | `profile: {display_name}` of a joining or creating member. |
| [`ids::Nonce`](/docs/reference/rust/zaun-community-protocol/struct-ids-nonce/) | A single-use value in signed objects. |
| [`command::object::Opaque`](/docs/reference/rust/zaun-community-protocol/struct-command-object-opaque/) | Opaque bytes, base64url on the wire (key packages, wrapped keys, signalling data). |
| [`command::dm::Open`](/docs/reference/rust/zaun-community-protocol/struct-command-dm-open/) | `dm.open`: the DM with `member_id`, created when there is none (idempotent per pair). |
| [`command::object::OptionValue`](/docs/reference/rust/zaun-community-protocol/struct-command-object-optionvalue/) | One option of an invoked command. |
| [`command::interaction::OriginalDelete`](/docs/reference/rust/zaun-community-protocol/struct-command-interaction-originaldelete/) | `interaction.original.delete`. |
| [`command::interaction::OriginalEdit`](/docs/reference/rust/zaun-community-protocol/struct-command-interaction-originaledit/) | `interaction.original.edit`: absent fields stay unchanged. |
| [`permissions::Override`](/docs/reference/rust/zaun-community-protocol/struct-permissions-override/) | A permission override on one channel or category (permissions the protocol). |
| [`command::object::Override`](/docs/reference/rust/zaun-community-protocol/struct-command-object-override/) | A permission override on a channel or category (permissions the protocol). |
| [`crypto::voice::PackageExpectation`](/docs/reference/rust/zaun-community-protocol/struct-crypto-voice-packageexpectation/) | What a receiver expects of a peer's key package. |
| [`command::audit::Page`](/docs/reference/rust/zaun-community-protocol/struct-command-audit-page/) | `audit.list` response. |
| [`command::invite::Page`](/docs/reference/rust/zaun-community-protocol/struct-command-invite-page/) | `invite.list` response. |
| [`command::member::Page`](/docs/reference/rust/zaun-community-protocol/struct-command-member-page/) | `member.list` response. |
| [`command::report::Page`](/docs/reference/rust/zaun-community-protocol/struct-command-report-page/) | `report.list` response: `reports`, `next?`. |
| [`command::sync::PageCursor`](/docs/reference/rust/zaun-community-protocol/struct-command-sync-pagecursor/) | A snapshot page cursor: a 16-byte role or channel id. |
| [`signed::ParsedPackage`](/docs/reference/rust/zaun-community-protocol/struct-signed-parsedpackage/) | The parts of a `.zbot` file, not yet verified. |
| [`permissions::Party`](/docs/reference/rust/zaun-community-protocol/struct-permissions-party/) | An actor or target member as the hierarchy sees it. Build it with `Resolver::party`. |
| [`command::membership::Pending`](/docs/reference/rust/zaun-community-protocol/struct-command-membership-pending/) | `membership.pending`. |
| [`command::membership::PendingPage`](/docs/reference/rust/zaun-community-protocol/struct-command-membership-pendingpage/) | `membership.pending` response. |
| [`bits::Permissions`](/docs/reference/rust/zaun-community-protocol/struct-bits-permissions/) | A permission set. JSON: a canonical decimal string. SQLite: `i64` by bit-cast. |
| [`command::channel::PermissionsUpdate`](/docs/reference/rust/zaun-community-protocol/struct-command-channel-permissionsupdate/) | `channel.permissions.update`. |
| [`command::membership::PolicyGet`](/docs/reference/rust/zaun-community-protocol/struct-command-membership-policyget/) | `admission.policy.get` (`{}`). |
| [`command::membership::PolicyResponse`](/docs/reference/rust/zaun-community-protocol/struct-command-membership-policyresponse/) | `admission.policy.get` response: `policy` (full, `MANAGE_SAFETY`) or `summary`. |
| [`command::object::PolicySummary`](/docs/reference/rust/zaun-community-protocol/struct-command-object-policysummary/) | The public summary: `{level, requires_approval, invite_creation, open}`. Hosts MUST send `open`. |
| [`command::membership::PolicyUpdate`](/docs/reference/rust/zaun-community-protocol/struct-command-membership-policyupdate/) | `admission.policy.update`: any policy field. Every field is non-nullable. |
| [`command::membership::PolicyUpdated`](/docs/reference/rust/zaun-community-protocol/struct-command-membership-policyupdated/) | `admission.policy.update` response. |
| [`command::signal::Presence`](/docs/reference/rust/zaun-community-protocol/struct-command-signal-presence/) | `signal.presence`: `{ status?, activity?, viewing? }`, at least one of `status` and `viewing`. |
| [`command::presence::Presences`](/docs/reference/rust/zaun-community-protocol/struct-command-presence-presences/) | `presence.list` response: one entry per member not `offline` (members missing from the list are offline). |
| [`event::PresenceSignal`](/docs/reference/rust/zaun-community-protocol/struct-event-presencesignal/) | `signal.presence` live event. |
| [`command::community::ProfileResponse`](/docs/reference/rust/zaun-community-protocol/struct-command-community-profileresponse/) | `community.update` response. |
| [`keys::PublicKey`](/docs/reference/rust/zaun-community-protocol/struct-keys-publickey/) | A composite public key, 1 985 bytes. |
| [`command::community::Published`](/docs/reference/rust/zaun-community-protocol/struct-command-community-published/) | `community.descriptor.publish` response. |
| [`ids::PublisherId`](/docs/reference/rust/zaun-community-protocol/struct-ids-publisherid/) | `SHA3-256("zaun/publisher-id/v1" ‖ 0x00 ‖ publisher public key)`. |
| [`command::object::RadioGroup`](/docs/reference/rust/zaun-community-protocol/struct-command-object-radiogroup/) | Type 21. |
| [`command::message::ReactionAdd`](/docs/reference/rust/zaun-community-protocol/struct-command-message-reactionadd/) | `reaction.add`. |
| [`event::ReactionChanged`](/docs/reference/rust/zaun-community-protocol/struct-event-reactionchanged/) | `reaction.added` and `reaction.removed`: `{message_id, emoji, member_id}`. |
| [`command::object::ReactionCount`](/docs/reference/rust/zaun-community-protocol/struct-command-object-reactioncount/) | `reactions: {emoji, count, me}`. |
| [`command::message::ReactionRemove`](/docs/reference/rust/zaun-community-protocol/struct-command-message-reactionremove/) | `reaction.remove`. |
| [`encoding::Reader`](/docs/reference/rust/zaun-community-protocol/struct-encoding-reader/) | Reads canonical encodings from a byte slice. Lengths and counts are checked against the field's limit and the remaining input before anything is allocated. |
| [`framing::Reassembler`](/docs/reference/rust/zaun-community-protocol/struct-framing-reassembler/) | Per-connection reassembly state machine. |
| [`command::migration::Reauth`](/docs/reference/rust/zaun-community-protocol/struct-command-migration-reauth/) | `migration.reauth`: on an unbound connection to the host that took the community over, a member proves its existing member key and the connection binds to the same `MemberId`. Resp |
| [`signed::ReauthExpectation`](/docs/reference/rust/zaun-community-protocol/struct-signed-reauthexpectation/) | What the host expects of a reauthentication: the envelope's community, this host, the epoch it operates under and the connection's current challenge. |
| [`client::member::ReauthTarget`](/docs/reference/rust/zaun-community-protocol/struct-client-member-reauthtarget/) | Where a member re-authenticates: the community, the new host, the delegation epoch its verified welcome proved, and that welcome's challenge. |
| [`client::ReceivedEvent`](/docs/reference/rust/zaun-community-protocol/struct-client-receivedevent/) | A received event: the envelope (sequence, timestamp, actor) and its decoded body. |
| [`crypto::voice::RecipientEntry`](/docs/reference/rust/zaun-community-protocol/struct-crypto-voice-recipiententry/) | One recipient of a sender's epoch key. |
| [`command::invite::Redeem`](/docs/reference/rust/zaun-community-protocol/struct-command-invite-redeem/) | `invite.redeem`. Unbound; the envelope's `community_id` names the target. |
| [`command::bot::Register`](/docs/reference/rust/zaun-community-protocol/struct-command-bot-register/) | `bot.register`: mark an existing member as an external bot. |
| [`signed::RegistrationExpectation`](/docs/reference/rust/zaun-community-protocol/struct-signed-registrationexpectation/) | What the host expects of a registration: the command's fields and the connection's current challenge. |
| [`client::member::RegistrationTarget`](/docs/reference/rust/zaun-community-protocol/struct-client-member-registrationtarget/) | Where a registration is made: the community, the host and the welcome's challenge. |
| [`command::membership::Reject`](/docs/reference/rust/zaun-community-protocol/struct-command-membership-reject/) | `membership.reject`. |
| [`envelope::Rejection`](/docs/reference/rust/zaun-community-protocol/struct-envelope-rejection/) | A command the host rejects before dispatch; send `Rejection::into_response` back. |
| [`crypto::voice::Rekey`](/docs/reference/rust/zaun-community-protocol/struct-crypto-voice-rekey/) | What a rekey sends: one signed sender-keys message for everyone and one wrapped key each. |
| [`crypto::voice::RekeyTarget`](/docs/reference/rust/zaun-community-protocol/struct-crypto-voice-rekeytarget/) | One recipient's share of a `Rekey`. |
| [`command::bot::Remove`](/docs/reference/rust/zaun-community-protocol/struct-command-bot-remove/) | `bot.remove`. |
| [`command::channel::Reorder`](/docs/reference/rust/zaun-community-protocol/struct-command-channel-reorder/) | `channel.reorder`. |
| [`command::role::Reorder`](/docs/reference/rust/zaun-community-protocol/struct-command-role-reorder/) | `role.reorder`. |
| [`command::interaction::Replied`](/docs/reference/rust/zaun-community-protocol/struct-command-interaction-replied/) | `interaction.respond` and `interaction.followup` response. |
| [`command::object::Report`](/docs/reference/rust/zaun-community-protocol/struct-command-object-report/) | A report. Only for `MANAGE_REPORTS` holders and, without other reporters' data, the reporter. |
| [`ids::ReportId`](/docs/reference/rust/zaun-community-protocol/struct-ids-reportid/) | A member report. |
| [`command::membership::Request`](/docs/reference/rust/zaun-community-protocol/struct-command-membership-request/) | `membership.request`. Unbound; responds with `super::invite::Admitted`. The target community is the envelope's `community_id`, as for `invite.redeem`. |
| [`ids::RequestId`](/docs/reference/rust/zaun-community-protocol/struct-ids-requestid/) | Correlates a command with its response; client-assigned. |
| [`permissions::Requirement`](/docs/reference/rust/zaun-community-protocol/struct-permissions-requirement/) | What a command requires (permissions the protocol, the protocol). |
| [`command::object::Resolution`](/docs/reference/rust/zaun-community-protocol/struct-command-object-resolution/) | `resolution: {outcome, note?, actor_id, at}`. |
| [`command::report::Resolve`](/docs/reference/rust/zaun-community-protocol/struct-command-report-resolve/) | `report.resolve`: `note?` is ≤ 512 scalars. |
| [`permissions::Resolved`](/docs/reference/rust/zaun-community-protocol/struct-permissions-resolved/) | One resolved permission set (`cp` or `chp`). |
| [`command::object::Resolved`](/docs/reference/rust/zaun-community-protocol/struct-command-object-resolved/) | Objects an interaction refers to, resolved by the host. |
| [`permissions::Resolver`](/docs/reference/rust/zaun-community-protocol/struct-permissions-resolver/) | Per-member state computed once; then `Resolver::community` and `Resolver::channel` are cheap enough to call for every channel of a snapshot. |
| [`command::interaction::Respond`](/docs/reference/rust/zaun-community-protocol/struct-command-interaction-respond/) | `interaction.respond`. |
| [`client::Response`](/docs/reference/rust/zaun-community-protocol/struct-client-response/) | A final response. `Debug` hides the body, which may embed a secret (an invitation link). |
| [`envelope::ResponseEnvelope`](/docs/reference/rust/zaun-community-protocol/struct-envelope-responseenvelope/) | `{ "v", "type": "response", "request_id", "ok", "body" \| "error" }`. |
| [`command::membership::Restore`](/docs/reference/rust/zaun-community-protocol/struct-command-membership-restore/) | `membership.restore`. |
| [`command::sync::Resume`](/docs/reference/rust/zaun-community-protocol/struct-command-sync-resume/) | `sync.resume`. |
| [`command::sync::Resumed`](/docs/reference/rust/zaun-community-protocol/struct-command-sync-resumed/) | `sync.resume` response. |
| [`command::object::Resync`](/docs/reference/rust/zaun-community-protocol/struct-command-object-resync/) | `{stream, channel_id?}` of `sync.resume.resync` and `RESYNC_REQUIRED`. |
| [`command::object::Retention`](/docs/reference/rust/zaun-community-protocol/struct-command-object-retention/) | Message retention of a channel. |
| [`client::RetryPolicy`](/docs/reference/rust/zaun-community-protocol/struct-client-retrypolicy/) | Exponential backoff: `initial_ms`, then ×`factor`, capped at `cap_ms`; give up once `give_up_ms` have passed since the first send. |
| [`command::report::Review`](/docs/reference/rust/zaun-community-protocol/struct-command-report-review/) | `report.review`: `open` → `reviewing`. |
| [`command::invite::Revoke`](/docs/reference/rust/zaun-community-protocol/struct-command-invite-revoke/) | `invite.revoke`. |
| [`ids::RngError`](/docs/reference/rust/zaun-community-protocol/struct-ids-rngerror/) | The operating system's CSPRNG failed. |
| [`permissions::Role`](/docs/reference/rust/zaun-community-protocol/struct-permissions-role/) | A role as the resolver sees it (permissions the protocol). |
| [`command::object::Role`](/docs/reference/rust/zaun-community-protocol/struct-command-object-role/) | A role. Visible to every member. |
| [`event::RoleDeleted`](/docs/reference/rust/zaun-community-protocol/struct-event-roledeleted/) | `role.deleted`: `{role_id}`. |
| [`ids::RoleId`](/docs/reference/rust/zaun-community-protocol/struct-ids-roleid/) | A role. `RoleId::EVERYONE` is the reserved all-zero id. |
| [`command::object::RolePosition`](/docs/reference/rust/zaun-community-protocol/struct-command-object-roleposition/) | One entry of `role.reorder` and `role.reordered`. |
| [`event::RolesReordered`](/docs/reference/rust/zaun-community-protocol/struct-event-rolesreordered/) | `role.reordered`: `positions`. SPEC: the `role.reorder` entry is reused. |
| [`command::member::RolesUpdate`](/docs/reference/rust/zaun-community-protocol/struct-command-member-rolesupdate/) | `member.roles.update`. |
| [`signed::RootRotation`](/docs/reference/rust/zaun-community-protocol/struct-signed-rootrotation/) | The replacement of the community's root key, signed by the old **and** the new key. |
| [`command::community::RotationPage`](/docs/reference/rust/zaun-community-protocol/struct-command-community-rotationpage/) | `community.rotations` response. |
| [`command::community::Rotations`](/docs/reference/rust/zaun-community-protocol/struct-command-community-rotations/) | `community.rotations`. |
| [`signed::Scopes`](/docs/reference/rust/zaun-community-protocol/struct-signed-scopes/) | Delegation scopes (field 6). Unknown bits are kept for re-encoding, are ignored and grant nothing. |
| [`crypto::SecretKey`](/docs/reference/rust/zaun-community-protocol/struct-crypto-secretkey/) | A suite-1 composite private key: `mldsaSeed` (FIPS 204 ξ, 32 B) ‖ `edSK` (32 B). |
| [`command::object::Section`](/docs/reference/rust/zaun-community-protocol/struct-command-object-section/) | Type 9. |
| [`command::object::SelectOption`](/docs/reference/rust/zaun-community-protocol/struct-command-object-selectoption/) | One option of a string select, radio group or checkbox group. |
| [`command::message::Send`](/docs/reference/rust/zaun-community-protocol/struct-command-message-send/) | `message.send`. |
| [`crypto::voice::SenderKey`](/docs/reference/rust/zaun-community-protocol/struct-crypto-voice-senderkey/) | An SFrame base key (32 bytes). Zeroized on drop, never printed, never on the wire unwrapped. |
| [`crypto::voice::SenderKeys`](/docs/reference/rust/zaun-community-protocol/struct-crypto-voice-senderkeys/) | The signed statement of one sender's epoch (see the module table). |
| [`crypto::voice::SenderKeysExpectation`](/docs/reference/rust/zaun-community-protocol/struct-crypto-voice-senderkeysexpectation/) | What a recipient expects of a sender-keys message. |
| [`command::message::Sent`](/docs/reference/rust/zaun-community-protocol/struct-command-message-sent/) | `message.send` response. |
| [`command::object::Separator`](/docs/reference/rust/zaun-community-protocol/struct-command-object-separator/) | Type 14. |
| [`command::message::Sequenced`](/docs/reference/rust/zaun-community-protocol/struct-command-message-sequenced/) | `message.edit` and `message.delete` response: the event's `channel_seq`. |
| [`client::Session`](/docs/reference/rust/zaun-community-protocol/struct-client-session/) | A sans-IO client session. See the module documentation. |
| [`client::SessionConfig`](/docs/reference/rust/zaun-community-protocol/struct-client-sessionconfig/) | Everything a `super::Session` needs besides the transport. |
| [`command::app::Set`](/docs/reference/rust/zaun-community-protocol/struct-command-app-set/) | `command.set`: a bot replaces its whole command list. |
| [`command::dm::Settings`](/docs/reference/rust/zaun-community-protocol/struct-command-dm-settings/) | The member's settings (`member.settings.get` / `.update` response). |
| [`command::dm::SettingsGet`](/docs/reference/rust/zaun-community-protocol/struct-command-dm-settingsget/) | `member.settings.get`. |
| [`command::dm::SettingsUpdate`](/docs/reference/rust/zaun-community-protocol/struct-command-dm-settingsupdate/) | `member.settings.update`: absent fields stay. |
| [`crypto::Sha3Hasher`](/docs/reference/rust/zaun-community-protocol/struct-crypto-sha3hasher/) | An incremental `content_hash`, for attachment files read in pieces. |
| [`command::voice::Signal`](/docs/reference/rust/zaun-community-protocol/struct-command-voice-signal/) | `voice.signal`: WebRTC signalling for one other participant of the same channel. |
| [`keys::Signature`](/docs/reference/rust/zaun-community-protocol/struct-keys-signature/) | A composite signature, 3 374 bytes. |
| [`signed::Signed`](/docs/reference/rust/zaun-community-protocol/struct-signed-signed/) | A signed object whose signature has been made or verified, with its exact bytes. |
| [`json::SignedJson`](/docs/reference/rust/zaun-community-protocol/struct-json-signedjson/) | A signed object as it travels in JSON: the canonical bytes `B` and the composite signature, both base64url. Receivers verify `sig` over `bytes` with the context of the object type |
| [`crypto::voice::SignedKeyPackage`](/docs/reference/rust/zaun-community-protocol/struct-crypto-voice-signedkeypackage/) | A key package whose signature was made here or verified. |
| [`signed::SignedRootRotation`](/docs/reference/rust/zaun-community-protocol/struct-signed-signedrootrotation/) | A rotation with both signatures, unverified (verify with `super::verify_chain`). |
| [`command::object::SignedRotation`](/docs/reference/rust/zaun-community-protocol/struct-command-object-signedrotation/) | A `SignedRootRotation` in JSON: `{bytes, sig_old, sig_new}`, all base64url. Kept undecoded, like `crate::json::SignedJson`; the `signed` module verifies it. |
| [`crypto::voice::SignedSenderKeys`](/docs/reference/rust/zaun-community-protocol/struct-crypto-voice-signedsenderkeys/) | A sender-keys message whose signature was made here or verified. |
| [`command::sync::Snapshot`](/docs/reference/rust/zaun-community-protocol/struct-command-sync-snapshot/) | `sync.snapshot`. |
| [`command::sync::SnapshotPage`](/docs/reference/rust/zaun-community-protocol/struct-command-sync-snapshotpage/) | `sync.snapshot` response. |
| [`command::presence::StatusSet`](/docs/reference/rust/zaun-community-protocol/struct-command-presence-statusset/) | `member.status.set`: replaces the actor's custom status. A body with neither `text` nor `emoji` clears it. |
| [`permissions::Steps`](/docs/reference/rust/zaun-community-protocol/struct-permissions-steps/) | The masks each step 7 restriction removed, in application order. |
| [`command::object::StringSelect`](/docs/reference/rust/zaun-community-protocol/struct-command-object-stringselect/) | Type 3. |
| [`permissions::Subject`](/docs/reference/rust/zaun-community-protocol/struct-permissions-subject/) | The member whose permissions are resolved. |
| [`command::object::SubmittedInput`](/docs/reference/rust/zaun-community-protocol/struct-command-object-submittedinput/) | One submitted modal input. |
| [`command::membership::Suspend`](/docs/reference/rust/zaun-community-protocol/struct-command-membership-suspend/) | `membership.suspend`. `until` is absolute; the 90-day bound is checked by `Command::validate_at`. |
| [`command::bot::Target`](/docs/reference/rust/zaun-community-protocol/struct-command-bot-target/) | `bot.enable`, `bot.disable`, `bot.get`. |
| [`command::object::TextDisplay`](/docs/reference/rust/zaun-community-protocol/struct-command-object-textdisplay/) | Type 10. |
| [`command::object::TextInput`](/docs/reference/rust/zaun-community-protocol/struct-command-object-textinput/) | Type 4. |
| [`command::object::Thumbnail`](/docs/reference/rust/zaun-community-protocol/struct-command-object-thumbnail/) | Type 11. |
| [`command::member::Timeout`](/docs/reference/rust/zaun-community-protocol/struct-command-member-timeout/) | `member.timeout`. `until` is absolute; the 28-day bound needs the host clock, so it is checked by `Command::validate_at`. |
| [`command::signal::Typing`](/docs/reference/rust/zaun-community-protocol/struct-command-signal-typing/) | `signal.typing { channel_id }`. |
| [`event::TypingSignal`](/docs/reference/rust/zaun-community-protocol/struct-event-typingsignal/) | `signal.typing` live event: `{channel_id, member_ids}` in a `named` channel, `{channel_id, count}` in an `anonymous` one (who is typing is never sent there). |
| [`command::member::Unban`](/docs/reference/rust/zaun-community-protocol/struct-command-member-unban/) | `member.unban`. |
| [`command::bot::Update`](/docs/reference/rust/zaun-community-protocol/struct-command-bot-update/) | `bot.update`. |
| [`command::channel::Update`](/docs/reference/rust/zaun-community-protocol/struct-command-channel-update/) | `channel.update`: any of the fields; `null` clears only `topic` and `parent_id`. |
| [`command::community::Update`](/docs/reference/rust/zaun-community-protocol/struct-command-community-update/) | `community.update`: host-managed profile fields only. |
| [`command::member::Update`](/docs/reference/rust/zaun-community-protocol/struct-command-member-update/) | `member.update`: a display-name change. |
| [`command::role::Update`](/docs/reference/rust/zaun-community-protocol/struct-command-role-update/) | `role.update`: any of the `role.create` fields. |
| [`command::voice::Update`](/docs/reference/rust/zaun-community-protocol/struct-command-voice-update/) | `voice.update`: the member's own mute and deafen. |
| [`command::attachment::Upload`](/docs/reference/rust/zaun-community-protocol/struct-command-attachment-upload/) | `attachment.upload`: declares a file the member is about to send. |
| [`command::attachment::Uploading`](/docs/reference/rust/zaun-community-protocol/struct-command-attachment-uploading/) | `attachment.upload` response. |
| [`command::invite::UsePage`](/docs/reference/rust/zaun-community-protocol/struct-command-invite-usepage/) | `invite.uses` response. |
| [`command::invite::Uses`](/docs/reference/rust/zaun-community-protocol/struct-command-invite-uses/) | `invite.uses`. Page size 1–100. |
| [`signed::ValidDescriptor`](/docs/reference/rust/zaun-community-protocol/struct-signed-validdescriptor/) | A descriptor that passed rule 1 and the descriptor parts of rule 5. |
| [`signed::ValidPair`](/docs/reference/rust/zaun-community-protocol/struct-signed-validpair/) | A (descriptor, delegation) pair valid at the time it was checked, with the state to store. Only `validate_pair` creates one. |
| [`signed::VerifiedPackage`](/docs/reference/rust/zaun-community-protocol/struct-signed-verifiedpackage/) | A package whose signature (unless unsigned was allowed), hashes and manifest ids were checked. |
| [`client::VerifiedWelcome`](/docs/reference/rust/zaun-community-protocol/struct-client-verifiedwelcome/) | A welcome that passed every check. Everything in it comes from verified signed objects or was compared with them. |
| [`envelope::VersionRange`](/docs/reference/rust/zaun-community-protocol/struct-envelope-versionrange/) | An inclusive protocol version range (`session.hello.versions`, `UNSUPPORTED_VERSION`). |
| [`command::session::Versions`](/docs/reference/rust/zaun-community-protocol/struct-command-session-versions/) | `{min, max}` protocol versions. |
| [`crypto::voice::VoiceIdentity`](/docs/reference/rust/zaun-community-protocol/struct-crypto-voice-voiceidentity/) | A voice session's X-Wing key pair. The secret is the 32-byte X-Wing seed, zeroized on drop and never printed. It lives only as long as the voice session; it is never stored. |
| [`event::VoiceJoined`](/docs/reference/rust/zaun-community-protocol/struct-event-voicejoined/) | `voice.joined`: a member entered a voice channel. Its `key_package` is present only for the channel's other participants. |
| [`event::VoiceKeys`](/docs/reference/rust/zaun-community-protocol/struct-event-voicekeys/) | `voice.keys`: another participant's media key for `epoch`: its signed sender-keys message and the key wrapped for this participant only (never another's). |
| [`event::VoiceLeft`](/docs/reference/rust/zaun-community-protocol/struct-event-voiceleft/) | `voice.left`: a member left a voice channel. The member itself receives it too. |
| [`command::object::VoiceParticipant`](/docs/reference/rust/zaun-community-protocol/struct-command-object-voiceparticipant/) | One member in a voice channel. |
| [`crypto::voice::VoicePublicKey`](/docs/reference/rust/zaun-community-protocol/struct-crypto-voice-voicepublickey/) | An X-Wing encapsulation key (ML-KEM-768 ‖ X25519, 1 216 bytes), validated on parse. |
| [`ids::VoiceSessionId`](/docs/reference/rust/zaun-community-protocol/struct-ids-voicesessionid/) | One stay of a member in a voice channel, host-assigned at `voice.join`. |
| [`crypto::voice::VoiceSessionId`](/docs/reference/rust/zaun-community-protocol/struct-crypto-voice-voicesessionid/) | One participation in a voice channel. A member draws a fresh one on every join, so KIDs and epochs never repeat across joins. |
| [`event::VoiceSignal`](/docs/reference/rust/zaun-community-protocol/struct-event-voicesignal/) | `voice.signal`: WebRTC signalling from another participant, to this one only. |
| [`event::VoiceUpdated`](/docs/reference/rust/zaun-community-protocol/struct-event-voiceupdated/) | `voice.updated`: a participant's mute, deafen or `can_speak` changed. |
| [`command::session::Welcome`](/docs/reference/rust/zaun-community-protocol/struct-command-session-welcome/) | `session.welcome`. |
| [`crypto::voice::WrapContext`](/docs/reference/rust/zaun-community-protocol/struct-crypto-voice-wrapcontext/) | Who wraps, for which channel and epoch: bound into the HPKE `info`. |
| [`crypto::voice::WrappedKey`](/docs/reference/rust/zaun-community-protocol/struct-crypto-voice-wrappedkey/) | A base key wrapped to one recipient: X-Wing `enc` ‖ AES-256-GCM ciphertext ‖ tag. |
| [`encoding::Writer`](/docs/reference/rust/zaun-community-protocol/struct-encoding-writer/) | Appends canonical encodings to a buffer. Variable fields take their limit and fail above it, mirroring `super::Reader`. |
## Traits
| Item | Summary |
|---|---|
| [`command::Body`](/docs/reference/rust/zaun-community-protocol/trait-command-body/) | A command body type: its wire name and response body type. |
| [`command::BodyVisitor`](/docs/reference/rust/zaun-community-protocol/trait-command-bodyvisitor/) | Something done with a command body of a type known only at run time (`Command::visit`). |
| [`encoding::Decode`](/docs/reference/rust/zaun-community-protocol/trait-encoding-decode/) | A type with a canonical decoding. |
| [`encoding::Encode`](/docs/reference/rust/zaun-community-protocol/trait-encoding-encode/) | A type with a canonical encoding (fixed-size or self-limiting). |
| [`signed::SignedObject`](/docs/reference/rust/zaun-community-protocol/trait-signed-signedobject/) | A signed object type: its canonical encoding (format byte first) and its context. |
| [`command::Validate`](/docs/reference/rust/zaun-community-protocol/trait-command-validate/) | State-free checks of one body. |
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/constant-mention-everyone/
---
# Constant mention::EVERYONE
> The text that shows `@everyone`.
`zaun_bot::mention::EVERYONE` · Constant
```rust
pub const EVERYONE: &str = "@everyone";
```
The text that shows `@everyone`.
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/mention/constant.EVERYONE.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/constant-mention-max_members/
---
# Constant mention::MAX_MEMBERS
> Most members one message may mention (spec the protocol).
`zaun_bot::mention::MAX_MEMBERS` · Constant
```rust
pub const MAX_MEMBERS: usize = 50;
```
Most members one message may mention (spec the protocol).
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/mention/constant.MAX_MEMBERS.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/constant-mention-max_roles/
---
# Constant mention::MAX_ROLES
> Most roles one message may mention (spec the protocol).
`zaun_bot::mention::MAX_ROLES` · Constant
```rust
pub const MAX_ROLES: usize = 20;
```
Most roles one message may mention (spec the protocol).
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/mention/constant.MAX_ROLES.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/enum-audio-audioformat/
---
# Enum audio::AudioFormat
> How the bot's audio is encoded.
`zaun_bot::audio::AudioFormat` · Enum
```rust
pub enum AudioFormat { … }
```
How the bot's audio is encoded.
## Variants
### `Opus`
Opus packets (2.5-120 ms each, at most 1000 bytes), sent as they are.
### `Pcm(PcmFormat)`
Signed 16-bit PCM, encoded to Opus by the host: `UNSUPPORTED` on hosts without an
Opus encoder.
## Trait implementations
`Clone`, `Copy`, `Debug`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/audio/enum.AudioFormat.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/enum-bindings-zaun-bot-http-httperror/
---
# Enum bindings::zaun::bot::http::HttpError
> Enum HttpError in zaun_bot.
`zaun_bot::bindings::zaun::bot::http::HttpError` · Enum
```rust
pub enum HttpError { … }
```
## Variants
### `NotGranted(String)`
The host (or `host:port`) is not in the bot's `network` or `local_network` grant,
or not in the operator's ceiling.
### `RefusedAddress`
The name resolved to a loopback, private, link-local or reserved address, and the
address is not a `local_network` grant.
### `InvalidUrl`
Malformed, or not `https://` (`http://` only for `local_network` addresses).
### `Timeout`
### `TooLarge`
### `Transport(String)`
## Trait implementations
`Clone`, `Debug`, `Display`, `Error`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/http/enum.HttpError.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/enum-bindings-zaun-bot-log-level/
---
# Enum bindings::zaun::bot::log::Level
> Enum Level in zaun_bot.
`zaun_bot::bindings::zaun::bot::log::Level` · Enum
```rust
pub enum Level { … }
```
## Variants
### `Trace`
### `Debug`
### `Info`
### `Warn`
### `Error`
## Trait implementations
`Clone`, `Copy`, `Debug`, `Eq`, `Ord`, `PartialEq`, `PartialOrd`, `StructuralPartialEq`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/log/enum.Level.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/enum-bindings-zaun-bot-types-buttonstyle/
---
# Enum bindings::zaun::bot::types::ButtonStyle
> components Button styles 1-5; premium (6) is not supported.
`zaun_bot::bindings::zaun::bot::types::ButtonStyle` · Enum
```rust
pub enum ButtonStyle { … }
```
---- components -----------------------------------------------------------
Button styles 1-5; premium (6) is not supported.
## Variants
### `Primary`
### `Secondary`
### `Success`
### `Danger`
### `Link`
## Trait implementations
`Clone`, `Copy`, `Debug`, `Eq`, `Ord`, `PartialEq`, `PartialOrd`, `StructuralPartialEq`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/types/enum.ButtonStyle.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/enum-bindings-zaun-bot-types-commandentry/
---
# Enum bindings::zaun::bot::types::CommandEntry
> Enum CommandEntry in zaun_bot.
`zaun_bot::bindings::zaun::bot::types::CommandEntry` · Enum
```rust
pub enum CommandEntry { … }
```
## Variants
### `ValueOption(CommandOption)`
### `SubCommand(SubCommand)`
### `Group(SubCommandGroup)`
## Trait implementations
`Clone`, `Debug`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/types/enum.CommandEntry.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/enum-bindings-zaun-bot-types-commandkind/
---
# Enum bindings::zaun::bot::types::CommandKind
> application commands Type 1, 2, 3.
`zaun_bot::bindings::zaun::bot::types::CommandKind` · Enum
```rust
pub enum CommandKind { … }
```
---- application commands -------------------------------------------------
Type 1, 2, 3.
## Variants
### `ChatInput`
### `User`
### `Message`
## Trait implementations
`Clone`, `Copy`, `Debug`, `Eq`, `Ord`, `PartialEq`, `PartialOrd`, `StructuralPartialEq`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/types/enum.CommandKind.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/enum-bindings-zaun-bot-types-component/
---
# Enum bindings::zaun::bot::types::Component
> A top-level message component. Without `components-v2` only `action-row` is allowed.
`zaun_bot::bindings::zaun::bot::types::Component` · Enum
```rust
pub enum Component { … }
```
A top-level message component. Without `components-v2` only `action-row` is allowed.
## Variants
### `ActionRow(ActionRow)`
### `TextDisplay(TextDisplay)`
### `Section(Section)`
### `MediaGallery(MediaGallery)`
### `File(File)`
### `Separator(Separator)`
### `Container(Container)`
## Trait implementations
`Clone`, `Debug`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/types/enum.Component.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/enum-bindings-zaun-bot-types-containerchild/
---
# Enum bindings::zaun::bot::types::ContainerChild
> Enum ContainerChild in zaun_bot.
`zaun_bot::bindings::zaun::bot::types::ContainerChild` · Enum
```rust
pub enum ContainerChild { … }
```
## Variants
### `ActionRow(ActionRow)`
### `TextDisplay(TextDisplay)`
### `Section(Section)`
### `MediaGallery(MediaGallery)`
### `File(File)`
### `Separator(Separator)`
## Trait implementations
`Clone`, `Debug`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/types/enum.ContainerChild.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/enum-bindings-zaun-bot-types-defaultvaluekind/
---
# Enum bindings::zaun::bot::types::DefaultValueKind
> Enum DefaultValueKind in zaun_bot.
`zaun_bot::bindings::zaun::bot::types::DefaultValueKind` · Enum
```rust
pub enum DefaultValueKind { … }
```
## Variants
### `User`
### `Role`
### `Channel`
## Trait implementations
`Clone`, `Copy`, `Debug`, `Eq`, `Ord`, `PartialEq`, `PartialOrd`, `StructuralPartialEq`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/types/enum.DefaultValueKind.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/enum-bindings-zaun-bot-types-entitykind/
---
# Enum bindings::zaun::bot::types::EntityKind
> Types 5 (user), 6 (role), 7 (mentionable), 8 (channel).
`zaun_bot::bindings::zaun::bot::types::EntityKind` · Enum
```rust
pub enum EntityKind { … }
```
Types 5 (user), 6 (role), 7 (mentionable), 8 (channel).
## Variants
### `User`
### `Role`
### `Mentionable`
### `Channel`
## Trait implementations
`Clone`, `Copy`, `Debug`, `Eq`, `Ord`, `PartialEq`, `PartialOrd`, `StructuralPartialEq`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/types/enum.EntityKind.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/enum-bindings-zaun-bot-types-interactiondata/
---
# Enum bindings::zaun::bot::types::InteractionData
> Enum InteractionData in zaun_bot.
`zaun_bot::bindings::zaun::bot::types::InteractionData` · Enum
```rust
pub enum InteractionData { … }
```
## Variants
### `Command(CommandData)`
### `Component(ComponentData)`
### `Autocomplete(CommandData)`
### `ModalSubmit(ModalData)`
## Trait implementations
`Clone`, `Debug`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/types/enum.InteractionData.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/enum-bindings-zaun-bot-types-labelchild/
---
# Enum bindings::zaun::bot::types::LabelChild
> Enum LabelChild in zaun_bot.
`zaun_bot::bindings::zaun::bot::types::LabelChild` · Enum
```rust
pub enum LabelChild { … }
```
## Variants
### `TextInput(TextInput)`
### `StringSelect(StringSelect)`
### `EntitySelect(EntitySelect)`
### `FileUpload(FileUpload)`
### `RadioGroup(RadioGroup)`
### `CheckboxGroup(CheckboxGroup)`
### `Checkbox(Checkbox)`
## Trait implementations
`Clone`, `Debug`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/types/enum.LabelChild.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/enum-bindings-zaun-bot-types-modalitem/
---
# Enum bindings::zaun::bot::types::ModalItem
> Enum ModalItem in zaun_bot.
`zaun_bot::bindings::zaun::bot::types::ModalItem` · Enum
```rust
pub enum ModalItem { … }
```
## Variants
### `Label(Label)`
### `TextDisplay(TextDisplay)`
## Trait implementations
`Clone`, `Debug`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/types/enum.ModalItem.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/enum-bindings-zaun-bot-types-optionkind/
---
# Enum bindings::zaun::bot::types::OptionKind
> Option types 3-11 (1 and 2 are sub-commands and groups).
`zaun_bot::bindings::zaun::bot::types::OptionKind` · Enum
```rust
pub enum OptionKind { … }
```
Option types 3-11 (1 and 2 are sub-commands and groups).
## Variants
### `String`
### `Integer`
### `Boolean`
### `User`
### `Channel`
### `Role`
### `Mentionable`
### `Number`
### `Attachment`
## Trait implementations
`Clone`, `Copy`, `Debug`, `Eq`, `Ord`, `PartialEq`, `PartialOrd`, `StructuralPartialEq`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/types/enum.OptionKind.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/enum-bindings-zaun-bot-types-optionvalue/
---
# Enum bindings::zaun::bot::types::OptionValue
> interactions
`zaun_bot::bindings::zaun::bot::types::OptionValue` · Enum
```rust
pub enum OptionValue { … }
```
---- interactions ---------------------------------------------------------
## Variants
### `Text(String)`
### `Integer(i64)`
### `Boolean(bool)`
### `Number(f64)`
### `Id(Id)`
## Trait implementations
`Clone`, `Debug`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/types/enum.OptionValue.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/enum-bindings-zaun-bot-types-response/
---
# Enum bindings::zaun::bot::types::Response
> Callback types 4-9 (8, the autocomplete result, is the return value of `on-autocomplete`).
`zaun_bot::bindings::zaun::bot::types::Response` · Enum
```rust
pub enum Response { … }
```
Callback types 4-9 (8, the autocomplete result, is the return value of
`on-autocomplete`).
## Variants
### `Message(MessageBody)`
4: `CHANNEL_MESSAGE_WITH_SOURCE`.
### `DeferredMessage(bool)`
5: `DEFERRED_CHANNEL_MESSAGE_WITH_SOURCE`; `true` = ephemeral.
### `DeferredUpdate`
6: `DEFERRED_UPDATE_MESSAGE`.
### `UpdateMessage(MessageBody)`
7: `UPDATE_MESSAGE`.
### `Modal(Modal)`
9: `MODAL`.
## Trait implementations
`Clone`, `Debug`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/types/enum.Response.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/enum-bindings-zaun-bot-types-rowitem/
---
# Enum bindings::zaun::bot::types::RowItem
> Enum RowItem in zaun_bot.
`zaun_bot::bindings::zaun::bot::types::RowItem` · Enum
```rust
pub enum RowItem { … }
```
## Variants
### `Button(Button)`
### `StringSelect(StringSelect)`
### `EntitySelect(EntitySelect)`
## Trait implementations
`Clone`, `Debug`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/types/enum.RowItem.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/enum-bindings-zaun-bot-types-sectionaccessory/
---
# Enum bindings::zaun::bot::types::SectionAccessory
> Enum SectionAccessory in zaun_bot.
`zaun_bot::bindings::zaun::bot::types::SectionAccessory` · Enum
```rust
pub enum SectionAccessory { … }
```
## Variants
### `Button(Button)`
### `Thumbnail(Thumbnail)`
## Trait implementations
`Clone`, `Debug`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/types/enum.SectionAccessory.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/enum-bindings-zaun-bot-types-separatorspacing/
---
# Enum bindings::zaun::bot::types::SeparatorSpacing
> Enum SeparatorSpacing in zaun_bot.
`zaun_bot::bindings::zaun::bot::types::SeparatorSpacing` · Enum
```rust
pub enum SeparatorSpacing { … }
```
## Variants
### `Small`
### `Large`
## Trait implementations
`Clone`, `Copy`, `Debug`, `Eq`, `Ord`, `PartialEq`, `PartialOrd`, `StructuralPartialEq`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/types/enum.SeparatorSpacing.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/enum-bindings-zaun-bot-types-textinputstyle/
---
# Enum bindings::zaun::bot::types::TextInputStyle
> modals
`zaun_bot::bindings::zaun::bot::types::TextInputStyle` · Enum
```rust
pub enum TextInputStyle { … }
```
---- modals ---------------------------------------------------------------
## Variants
### `Short`
### `Paragraph`
## Trait implementations
`Clone`, `Copy`, `Debug`, `Eq`, `Ord`, `PartialEq`, `PartialOrd`, `StructuralPartialEq`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/types/enum.TextInputStyle.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/enum-bindings-zaun-bot-voice-source/
---
# Enum bindings::zaun::bot::voice::Source
> Where a track's audio comes from.
`zaun_bot::bindings::zaun::bot::voice::Source` · Enum
```rust
pub enum Source { … }
```
Where a track's audio comes from.
## Variants
### `Url(String)`
An `https://` Ogg Opus or WebM Opus file or stream (WebM where the host demuxes it;
elsewhere a `track-error`), fetched by the host under the bot's
`network` grant (the server learns the host's address) and played as it arrives.
`http://` and `https://` URLs to a `local_network` address are fetched the same
way, without leaving the host's machine or network.
### `Ogg(Vec)`
Ogg Opus bytes the bot already holds (≤ 16 MiB).
### `Pushed`
Opus packets the bot pushes with `push`, until `end-stream`.
## Trait implementations
`Clone`, `Debug`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/voice/enum.Source.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/enum-prelude-choicevalue/
---
# Enum prelude::ChoiceValue
> Enum ChoiceValue in zaun_bot.
`zaun_bot::prelude::ChoiceValue` · Enum
```rust
pub enum ChoiceValue { … }
```
## Variants
### `Text(String)`
### `Integer(i64)`
### `Number(f64)`
## Trait implementations
`Clone`, `Debug`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/types/enum.ChoiceValue.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/enum-prelude-event/
---
# 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
`zaun_bot::prelude::Event` · Enum
```rust
pub enum 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 event's JSON body.
## Variants
### `Ready(Ready)`
Always delivered first, once the bot's connection is up.
### `MessageCreated(MessageEvent)`
### `MessageUpdated(MessageEvent)`
### `MessageDeleted(MessageDeleted)`
### `MessagesBulkDeleted(MessagesDeleted)`
### `ReactionAdded(Reaction)`
### `ReactionRemoved(Reaction)`
### `MemberJoined(Member)`
Group `members` (capability `members`).
### `MemberUpdated(Member)`
### `MemberLeft(Id)`
### `MemberRemoved(String)`
The bot itself was removed; `reason` is `kicked`, `banned`, ...
### `MemberRolesUpdated(MemberRoles)`
### `MemberTimedOut(MemberTimeout)`
### `ChannelCreated(Channel)`
### `ChannelUpdated(Channel)`
### `ChannelDeleted(Id)`
### `RoleCreated(Role)`
### `RoleUpdated(Role)`
### `RoleDeleted(Id)`
### `TypingStarted(Typing)`
### `PresenceUpdated(Presence)`
Group `presence` (capability `presence`).
### `CommunityUpdated(CommunityProfile)`
### `CommandUpdated(Id)`
A bot's command list changed; the bot's id.
### `DmCreated(Channel)`
Group `dms` (capability `dms`): a DM with the bot was opened, or the bot closed one.
### `DmClosed(Id)`
### `Other(RawEvent)`
## Trait implementations
`Clone`, `Debug`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/types/enum.Event.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/enum-presence-activitytype/
---
# Enum presence::ActivityType
> "Playing {name}", "Streaming {name}", "Listening to {name}", "Watching {name}", "Competing in {name}", or free text (`custom`).
`zaun_bot::presence::ActivityType` · Enum
```rust
pub enum ActivityType { … }
```
"Playing {name}", "Streaming {name}", "Listening to {name}", "Watching {name}",
"Competing in {name}", or free text (`custom`).
## Variants
### `Playing`
### `Streaming`
### `Listening`
### `Watching`
### `Competing`
### `Custom`
## Trait implementations
`Clone`, `Copy`, `Debug`, `Eq`, `Ord`, `PartialEq`, `PartialOrd`, `StructuralPartialEq`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/types/enum.ActivityType.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/enum-presence-status/
---
# Enum presence::Status
> `invisible` looks offline to everyone.
`zaun_bot::presence::Status` · Enum
```rust
pub enum Status { … }
```
`invisible` looks offline to everyone.
## Variants
### `Online`
### `Idle`
### `Dnd`
### `Invisible`
## Trait implementations
`Clone`, `Copy`, `Debug`, `Eq`, `Ord`, `PartialEq`, `PartialOrd`, `StructuralPartialEq`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/presence/enum.Status.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/enum-select/
---
# Enum Select
> Builds a select menu: string options or members, roles, mentionables or channels.
`zaun_bot::Select` · Enum
```rust
pub enum Select { … }
```
Builds a select menu: string options or members, roles, mentionables or channels.
## Variants
### `Strings(StringSelect)`
Type 3.
### `Entities(EntitySelect)`
Types 5–8.
## Methods
### `strings`
```rust
pub fn strings>(custom_id: impl Into, options: &[(&str, &str)]) -> Self
```
A string select with these `(label, value)` options (≤ 25).
### `entities`
```rust
pub fn entities>(kind: EntityKind, custom_id: impl Into) -> Self
```
A member, role, mentionable or channel select.
### `placeholder`
```rust
pub fn placeholder>(self, text: impl Into) -> Self
```
Placeholder text (≤ 150).
### `range`
```rust
pub fn range(self, min: u8, max: u8) -> Self
```
How many values may be picked (0–25).
## Trait implementations
`Clone`, `Debug`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/select/enum.Select.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/enum-voice-loopmode/
---
# 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`).
`zaun_bot::voice::LoopMode` · Enum
```rust
pub enum LoopMode { … }
```
What happens when a track ends: go on (`off`), play it again (`track`), or put it at
the end of the queue (`queue`).
## Variants
### `Off`
### `Track`
### `Queue`
## Trait implementations
`Clone`, `Copy`, `Debug`, `Eq`, `Ord`, `PartialEq`, `PartialOrd`, `StructuralPartialEq`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/voice/enum.LoopMode.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/enum-voice-playerstatus/
---
# Enum voice::PlayerStatus
> Enum PlayerStatus in zaun_bot.
`zaun_bot::voice::PlayerStatus` · Enum
```rust
pub enum PlayerStatus { … }
```
## Variants
### `Idle`
### `Playing`
### `Paused`
### `AutoPaused`
## Trait implementations
`Clone`, `Copy`, `Debug`, `Eq`, `Ord`, `PartialEq`, `PartialOrd`, `StructuralPartialEq`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/voice/enum.PlayerStatus.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/enum-voice-voiceevent/
---
# Enum voice::VoiceEvent
> What happened, for `on-voice-event`.
`zaun_bot::voice::VoiceEvent` · Enum
```rust
pub enum VoiceEvent { … }
```
What happened, for `on-voice-event`.
## Variants
### `TrackStart(Option)`
A track started (its title).
### `TrackEnd(Option)`
A track ended: played out, skipped, stopped or failed.
### `TrackError(String)`
A track could not be read (the text names no URL).
### `MemberJoined(Id)`
A member joined the bot's voice channel.
### `MemberLeft(Id)`
A member left it.
### `Ended(Option)`
The bot's stay ended (left, moved, disconnected, the host or relay went away).
### `QueueEnded`
The last track played out with nothing queued (and no loop): the player is idle.
Not sent after `stop` or `leave`.
### `AudioLow(u32)`
The `audio` stream's buffer fell below its low-water mark: write more. The audio
still buffered, in ms. Sent again only after a write.
### `AudioClosed`
The `audio` stream closed: drained after `close`, closed at once, or the stay ended.
## Trait implementations
`Clone`, `Debug`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/voice/enum.VoiceEvent.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-audio-buffered_ms/
---
# Function bindings::zaun::bot::audio::buffered_ms
> The audio written and not yet played, in ms (0 without a stream).
`zaun_bot::bindings::zaun::bot::audio::buffered_ms` · Function
```rust
pub fn buffered_ms() -> u32
```
The audio written and not yet played, in ms (0 without a stream).
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/audio/fn.buffered_ms.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-audio-clear/
---
# Function bindings::zaun::bot::audio::clear
> Drops everything buffered at once, keeping the stream open (to interrupt speech).
`zaun_bot::bindings::zaun::bot::audio::clear` · Function
```rust
pub fn clear() -> Result<(), HostError>
```
Drops everything buffered at once, keeping the stream open (to interrupt speech).
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/audio/fn.clear.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-audio-close/
---
# 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.
`zaun_bot::bindings::zaun::bot::audio::close` · Function
```rust
pub fn close(drain: bool)
```
Closes the stream: once the buffer has played (`drain`), or at once. The player
resumes. Nothing happens without a stream.
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/audio/fn.close.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-audio-open/
---
# 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
`zaun_bot::bindings::zaun::bot::audio::open` · Function
```rust
pub fn open(options: &StreamOptions) -> Result<(), HostError>
```
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; `BAD_REQUEST` for a rate, channel count or low-water mark out of range.
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/audio/fn.open.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-audio-write_opus/
---
# Function bindings::zaun::bot::audio::write_opus
> Opus packets, for an `opus` stream. Returns the audio buffered, in ms; `BUSY` past 3 s.
`zaun_bot::bindings::zaun::bot::audio::write_opus` · Function
```rust
pub fn write_opus(packets: &[Vec]) -> Result
```
Opus packets, for an `opus` stream. Returns the audio buffered, in ms; `BUSY` past 3 s.
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/audio/fn.write_opus.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-audio-write_pcm/
---
# 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.
`zaun_bot::bindings::zaun::bot::audio::write_pcm` · Function
```rust
pub fn write_pcm(samples: &[i16]) -> Result
```
Interleaved samples, for a `pcm` stream; any count (the host frames them). Returns the
audio buffered, in ms; `BUSY` past 3 s.
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/audio/fn.write_pcm.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-commands-set/
---
# Function bindings::zaun::bot::commands::set
> Function set in zaun_bot.
`zaun_bot::bindings::zaun::bot::commands::set` · Function
```rust
pub fn set(commands: &[ApplicationCommand]) -> Result, HostError>
```
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/commands/fn.set.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-community-add_role/
---
# Function bindings::zaun::bot::community::add_role
> `member.roles.update`.
`zaun_bot::bindings::zaun::bot::community::add_role` · Function
```rust
pub fn add_role(member_id: &str, role_id: &str) -> Result<(), HostError>
```
`member.roles.update`.
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/community/fn.add_role.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-community-get_channel/
---
# Function bindings::zaun::bot::community::get_channel
> Function get_channel in zaun_bot.
`zaun_bot::bindings::zaun::bot::community::get_channel` · Function
```rust
pub fn get_channel(channel_id: &str) -> Result
```
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/community/fn.get_channel.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-community-get_member/
---
# Function bindings::zaun::bot::community::get_member
> Needs capability `members` for members the bot has not seen.
`zaun_bot::bindings::zaun::bot::community::get_member` · Function
```rust
pub fn get_member(member_id: &str) -> Result
```
Needs capability `members` for members the bot has not seen.
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/community/fn.get_member.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-community-get_role/
---
# Function bindings::zaun::bot::community::get_role
> Function get_role in zaun_bot.
`zaun_bot::bindings::zaun::bot::community::get_role` · Function
```rust
pub fn get_role(role_id: &str) -> Result
```
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/community/fn.get_role.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-community-kick/
---
# Function bindings::zaun::bot::community::kick
> `member.kick`.
`zaun_bot::bindings::zaun::bot::community::kick` · Function
```rust
pub fn kick(member_id: &str, reason: Option<&str>) -> Result<(), HostError>
```
`member.kick`.
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/community/fn.kick.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-community-list_channels/
---
# Function bindings::zaun::bot::community::list_channels
> Function list_channels in zaun_bot.
`zaun_bot::bindings::zaun::bot::community::list_channels` · Function
```rust
pub fn list_channels() -> Result, HostError>
```
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/community/fn.list_channels.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-community-list_members/
---
# Function bindings::zaun::bot::community::list_members
> Function list_members in zaun_bot.
`zaun_bot::bindings::zaun::bot::community::list_members` · Function
```rust
pub fn list_members(after: Option<&str>, limit: u32) -> Result, HostError>
```
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/community/fn.list_members.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-community-list_roles/
---
# Function bindings::zaun::bot::community::list_roles
> Function list_roles in zaun_bot.
`zaun_bot::bindings::zaun::bot::community::list_roles` · Function
```rust
pub fn list_roles() -> Result, HostError>
```
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/community/fn.list_roles.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-community-remove_role/
---
# Function bindings::zaun::bot::community::remove_role
> Function remove_role in zaun_bot.
`zaun_bot::bindings::zaun::bot::community::remove_role` · Function
```rust
pub fn remove_role(member_id: &str, role_id: &str) -> Result<(), HostError>
```
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/community/fn.remove_role.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-community-timeout/
---
# Function bindings::zaun::bot::community::timeout
> `member.timeout`; `none` clears.
`zaun_bot::bindings::zaun::bot::community::timeout` · Function
```rust
pub fn timeout(member_id: &str, until: Option, reason: Option<&str>) -> Result<(), HostError>
```
`member.timeout`; `none` clears.
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/community/fn.timeout.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-dms-close/
---
# Function bindings::zaun::bot::dms::close
> `dm.close`: hides it from the bot's list.
`zaun_bot::bindings::zaun::bot::dms::close` · Function
```rust
pub fn close(channel_id: &str) -> Result<(), HostError>
```
`dm.close`: hides it from the bot's list.
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/dms/fn.close.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-dms-list_open/
---
# Function bindings::zaun::bot::dms::list_open
> `dm.list`: the DMs the bot has open.
`zaun_bot::bindings::zaun::bot::dms::list_open` · Function
```rust
pub fn list_open() -> Result, HostError>
```
`dm.list`: the DMs the bot has open.
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/dms/fn.list_open.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-dms-open/
---
# Function bindings::zaun::bot::dms::open
> `dm.open`: the DM with `member-id`, created when there is none.
`zaun_bot::bindings::zaun::bot::dms::open` · Function
```rust
pub fn open(member_id: &str) -> Result
```
`dm.open`: the DM with `member-id`, created when there is none.
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/dms/fn.open.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-http-fetch/
---
# Function bindings::zaun::bot::http::fetch
> Function fetch in zaun_bot.
`zaun_bot::bindings::zaun::bot::http::fetch` · Function
```rust
pub fn fetch(req: &Request) -> Result
```
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/http/fn.fetch.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-interactions-delete_original/
---
# Function bindings::zaun::bot::interactions::delete_original
> Deletes the original response.
`zaun_bot::bindings::zaun::bot::interactions::delete_original` · Function
```rust
pub fn delete_original(interaction_id: &str) -> Result<(), HostError>
```
Deletes the original response.
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/interactions/fn.delete_original.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-interactions-edit_original/
---
# Function bindings::zaun::bot::interactions::edit_original
> Edits the original response (ends a deferred "thinking" state).
`zaun_bot::bindings::zaun::bot::interactions::edit_original` · Function
```rust
pub fn edit_original(interaction_id: &str, body: &MessageBody) -> Result<(), HostError>
```
Edits the original response (ends a deferred "thinking" state).
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/interactions/fn.edit_original.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-interactions-followup/
---
# Function bindings::zaun::bot::interactions::followup
> A follow-up message, within 15 minutes; at most 10.
`zaun_bot::bindings::zaun::bot::interactions::followup` · Function
```rust
pub fn followup(interaction_id: &str, body: &MessageBody) -> Result, HostError>
```
A follow-up message, within 15 minutes; at most 10.
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/interactions/fn.followup.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-interactions-respond/
---
# 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.
`zaun_bot::bindings::zaun::bot::interactions::respond` · Function
```rust
pub fn respond(interaction_id: &str, response: &Response) -> Result , HostError>
```
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.
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/interactions/fn.respond.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-log-write/
---
# Function bindings::zaun::bot::log::write
> Function write in zaun_bot.
`zaun_bot::bindings::zaun::bot::log::write` · Function
```rust
pub fn write(level: Level, message: &str)
```
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/log/fn.write.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-messages-delete/
---
# Function bindings::zaun::bot::messages::delete
> `message.delete`.
`zaun_bot::bindings::zaun::bot::messages::delete` · Function
```rust
pub fn delete(channel_id: &str, message_id: &str) -> Result<(), HostError>
```
`message.delete`.
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/messages/fn.delete.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-messages-dm/
---
# 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.
`zaun_bot::bindings::zaun::bot::messages::dm` · Function
```rust
pub fn dm(member_id: &str, body: &MessageBody) -> Result<(Id, Id), HostError>
```
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.
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/messages/fn.dm.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-messages-edit/
---
# Function bindings::zaun::bot::messages::edit
> `message.edit` of one of the bot's messages.
`zaun_bot::bindings::zaun::bot::messages::edit` · Function
```rust
pub fn edit(channel_id: &str, message_id: &str, body: &MessageBody) -> Result<(), HostError>
```
`message.edit` of one of the bot's messages.
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/messages/fn.edit.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-messages-history/
---
# Function bindings::zaun::bot::messages::history
> `message.history`: up to `limit` (1-100) messages before `before`.
`zaun_bot::bindings::zaun::bot::messages::history` · Function
```rust
pub fn history(channel_id: &str, before: Option, limit: u32) -> Result, HostError>
```
`message.history`: up to `limit` (1-100) messages before `before`.
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/messages/fn.history.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-messages-react/
---
# Function bindings::zaun::bot::messages::react
> `reaction.add`.
`zaun_bot::bindings::zaun::bot::messages::react` · Function
```rust
pub fn react(channel_id: &str, message_id: &str, emoji: &str) -> Result<(), HostError>
```
`reaction.add`.
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/messages/fn.react.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-messages-send/
---
# Function bindings::zaun::bot::messages::send
> `message.send`. Returns the new message id.
`zaun_bot::bindings::zaun::bot::messages::send` · Function
```rust
pub fn send(channel_id: &str, body: &MessageBody, reply_to: Option<&str>) -> Result
```
`message.send`. Returns the new message id.
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/messages/fn.send.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-messages-unreact/
---
# Function bindings::zaun::bot::messages::unreact
> `reaction.remove` of the bot's own reaction.
`zaun_bot::bindings::zaun::bot::messages::unreact` · Function
```rust
pub fn unreact(channel_id: &str, message_id: &str, emoji: &str) -> Result<(), HostError>
```
`reaction.remove` of the bot's own reaction.
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/messages/fn.unreact.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-messages-upload/
---
# 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`.
`zaun_bot::bindings::zaun::bot::messages::upload` · Function
```rust
pub fn upload(channel_id: &str, name: &str, mime: &str, bytes: &[u8]) -> Result
```
Uploads a file for the bot's next message (capability `attachments`). Returns the
attachment id to put in `message-body.attachments`.
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/messages/fn.upload.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-presence-set/
---
# 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
`zaun_bot::bindings::zaun::bot::presence::set` · Function
```rust
pub fn set(status: Status, activity: Option<&Activity>)
```
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 bot is `online` without an activity when it starts.
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/presence/fn.set.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-presence-set_status_text/
---
# 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.
`zaun_bot::bindings::zaun::bot::presence::set_status_text` · Function
```rust
pub fn set_status_text(text: Option<&str>, emoji: Option<&str>, expires_at: Option) -> Result<(), HostError>
```
Sets the custom status text and emoji (`member.status.set`), kept until `expires-at`
(or changed); `none` for both clears it.
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/presence/fn.set_status_text.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-storage-delete/
---
# Function bindings::zaun::bot::storage::delete
> Function delete in zaun_bot.
`zaun_bot::bindings::zaun::bot::storage::delete` · Function
```rust
pub fn delete(key: &str) -> Result<(), HostError>
```
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/storage/fn.delete.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-storage-get/
---
# Function bindings::zaun::bot::storage::get
> Function get in zaun_bot.
`zaun_bot::bindings::zaun::bot::storage::get` · Function
```rust
pub fn get(key: &str) -> Result>, HostError>
```
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/storage/fn.get.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-storage-list_keys/
---
# Function bindings::zaun::bot::storage::list_keys
> Keys starting with `prefix`, in order, after `after`, at most `limit` (≤ 1000).
`zaun_bot::bindings::zaun::bot::storage::list_keys` · Function
```rust
pub fn list_keys(prefix: &str, after: Option<&str>, limit: u32) -> Result, HostError>
```
Keys starting with `prefix`, in order, after `after`, at most `limit` (≤ 1000).
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/storage/fn.list_keys.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-storage-set/
---
# Function bindings::zaun::bot::storage::set
> `QUOTA_EXCEEDED` when the grant is used up.
`zaun_bot::bindings::zaun::bot::storage::set` · Function
```rust
pub fn set(key: &str, value: &[u8]) -> Result<(), HostError>
```
`QUOTA_EXCEEDED` when the grant is used up.
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/storage/fn.set.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-timers-after/
---
# Function bindings::zaun::bot::timers::after
> Fires once after `ms`.
`zaun_bot::bindings::zaun::bot::timers::after` · Function
```rust
pub fn after(ms: u64, tag: &str) -> Result
```
Fires once after `ms`.
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/timers/fn.after.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-timers-cancel/
---
# Function bindings::zaun::bot::timers::cancel
> Function cancel in zaun_bot.
`zaun_bot::bindings::zaun::bot::timers::cancel` · Function
```rust
pub fn cancel(id: u64)
```
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/timers/fn.cancel.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-timers-every/
---
# Function bindings::zaun::bot::timers::every
> Fires every `ms` (≥ 1000).
`zaun_bot::bindings::zaun::bot::timers::every` · Function
```rust
pub fn every(ms: u64, tag: &str) -> Result
```
Fires every `ms` (≥ 1000).
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/timers/fn.every.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-voice-clear_queue/
---
# Function bindings::zaun::bot::voice::clear_queue
> Empties the queue; the current track keeps playing.
`zaun_bot::bindings::zaun::bot::voice::clear_queue` · Function
```rust
pub fn clear_queue() -> Result<(), HostError>
```
Empties the queue; the current track keeps playing.
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/voice/fn.clear_queue.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-voice-end_stream/
---
# Function bindings::zaun::bot::voice::end_stream
> The `pushed` track ends once its buffered packets have played.
`zaun_bot::bindings::zaun::bot::voice::end_stream` · Function
```rust
pub fn end_stream()
```
The `pushed` track ends once its buffered packets have played.
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/voice/fn.end_stream.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-voice-enqueue/
---
# Function bindings::zaun::bot::voice::enqueue
> Adds `track` to the queue (≤ 100); returns the queue's length.
`zaun_bot::bindings::zaun::bot::voice::enqueue` · Function
```rust
pub fn enqueue(track: &Track) -> Result
```
Adds `track` to the queue (≤ 100); returns the queue's length.
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/voice/fn.enqueue.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-voice-join/
---
# 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`.
`zaun_bot::bindings::zaun::bot::voice::join` · Function
```rust
pub fn join(channel: &str) -> Result<(), HostError>
```
Joins voice channel `channel` (leaving another one first). Returns once media can
flow (at most about 10 s). `FORBIDDEN` without `voice`, `CONNECT` or `SPEAK`.
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/voice/fn.join.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-voice-leave/
---
# Function bindings::zaun::bot::voice::leave
> Leaves; playback stops and the queue is cleared.
`zaun_bot::bindings::zaun::bot::voice::leave` · Function
```rust
pub fn leave()
```
Leaves; playback stops and the queue is cleared.
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/voice/fn.leave.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-voice-move_/
---
# 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.
`zaun_bot::bindings::zaun::bot::voice::move_` · Function
```rust
pub fn move_(from: u32, to: u32) -> Result<(), HostError>
```
Moves the queued track at `from` to `to` (both 0-based); the tracks between shift.
`NOT_FOUND` past the end.
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/voice/fn.move_.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-voice-pause/
---
# Function bindings::zaun::bot::voice::pause
> Function pause in zaun_bot.
`zaun_bot::bindings::zaun::bot::voice::pause` · Function
```rust
pub fn pause()
```
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/voice/fn.pause.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-voice-play/
---
# Function bindings::zaun::bot::voice::play
> Plays `track` now, replacing the current one; the queue stays.
`zaun_bot::bindings::zaun::bot::voice::play` · Function
```rust
pub fn play(track: &Track) -> Result<(), HostError>
```
Plays `track` now, replacing the current one; the queue stays.
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/voice/fn.play.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-voice-push/
---
# 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.
`zaun_bot::bindings::zaun::bot::voice::push` · Function
```rust
pub fn push(packets: &[Vec]) -> Result
```
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.
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/voice/fn.push.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-voice-remove/
---
# Function bindings::zaun::bot::voice::remove
> Removes the queued track at `index` (0 plays next); returns its title. `NOT_FOUND` past the end.
`zaun_bot::bindings::zaun::bot::voice::remove` · Function
```rust
pub fn remove(index: u32) -> Result, HostError>
```
Removes the queued track at `index` (0 plays next); returns its title. `NOT_FOUND`
past the end.
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/voice/fn.remove.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-voice-resume/
---
# Function bindings::zaun::bot::voice::resume
> Function resume in zaun_bot.
`zaun_bot::bindings::zaun::bot::voice::resume` · Function
```rust
pub fn resume()
```
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/voice/fn.resume.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-voice-seek/
---
# 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.
`zaun_bot::bindings::zaun::bot::voice::seek` · Function
```rust
pub fn seek(ms: u64) -> Result<(), HostError>
```
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.
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/voice/fn.seek.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-voice-set_loop/
---
# Function bindings::zaun::bot::voice::set_loop
> Sets what happens when a track ends (`off` when the bot joins).
`zaun_bot::bindings::zaun::bot::voice::set_loop` · Function
```rust
pub fn set_loop(mode: LoopMode) -> Result<(), HostError>
```
Sets what happens when a track ends (`off` when the bot joins).
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/voice/fn.set_loop.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-voice-set_volume/
---
# 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
`zaun_bot::bindings::zaun::bot::voice::set_volume` · Function
```rust
pub fn set_volume(percent: u16) -> Result<(), HostError>
```
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 answer `UNSUPPORTED`: call it anyway and tell the member.
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/voice/fn.set_volume.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-voice-shuffle/
---
# Function bindings::zaun::bot::voice::shuffle
> Puts the queue in a random order (the current track keeps playing).
`zaun_bot::bindings::zaun::bot::voice::shuffle` · Function
```rust
pub fn shuffle() -> Result<(), HostError>
```
Puts the queue in a random order (the current track keeps playing).
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/voice/fn.shuffle.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-voice-skip/
---
# Function bindings::zaun::bot::voice::skip
> Ends the current track; the next one starts.
`zaun_bot::bindings::zaun::bot::voice::skip` · Function
```rust
pub fn skip()
```
Ends the current track; the next one starts.
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/voice/fn.skip.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-voice-state/
---
# Function bindings::zaun::bot::voice::state
> Where the bot is and what it plays.
`zaun_bot::bindings::zaun::bot::voice::state` · Function
```rust
pub fn state() -> VoiceState
```
Where the bot is and what it plays.
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/voice/fn.state.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/function-bindings-zaun-bot-voice-stop/
---
# Function bindings::zaun::bot::voice::stop
> Ends the current track and clears the queue.
`zaun_bot::bindings::zaun::bot::voice::stop` · Function
```rust
pub fn stop()
```
Ends the current track and clears the queue.
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/voice/fn.stop.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/function-dispatch/
---
# Function dispatch
> Calls the `Bot` handler for `event`.
`zaun_bot::dispatch` · Function
```rust
pub fn dispatch(bot: &mut B, ctx: EventContext, event: Event)
```
Calls the `Bot` handler for `event`.
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/events/fn.dispatch.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/function-mention-is_id/
---
# 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`).
`zaun_bot::mention::is_id` · Function
```rust
pub fn is_id(id: &str) -> bool
```
Whether `id` is a well-formed Zaun id: 16 bytes in unpadded base64url (22 characters, the
last one of `A`, `Q`, `g`, `w`).
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/mention/fn.is_id.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/function-mention-member/
---
# Function mention::member
> The text that shows a member mention: `<@id>` (discord.js `userMention`).
`zaun_bot::mention::member` · Function
```rust
pub fn member(id: &str) -> String
```
The text that shows a member mention: `<@id>` (discord.js `userMention`).
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/mention/fn.member.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/function-mention-none/
---
# Function mention::none
> No mentions.
`zaun_bot::mention::none` · Function
```rust
pub fn none() -> Mentions
```
No mentions.
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/mention/fn.none.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/function-mention-parse/
---
# 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
`zaun_bot::mention::parse` · Function
```rust
pub fn parse(content: &str) -> Mentions
```
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` roles; malformed ids are skipped. Use it only on text the bot wrote: on
text from members it would mention whoever they named.
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/mention/fn.parse.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/function-mention-role/
---
# Function mention::role
> The text that shows a role mention: `<@&id>` (discord.js `roleMention`).
`zaun_bot::mention::role` · Function
```rust
pub fn role(id: &str) -> String
```
The text that shows a role mention: `<@&id>` (discord.js `roleMention`).
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/mention/fn.role.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/function-presence-clear_status/
---
# Function presence::clear_status
> Clears the custom status.
`zaun_bot::presence::clear_status` · Function
```rust
pub fn clear_status() -> Result<(), HostError>
```
Clears the custom status.
# Errors
The host's refusal.
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/presence/fn.clear_status.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/function-presence-set/
---
# Function presence::set
> Sets the bot's status and activity (`None`: no activity).
`zaun_bot::presence::set` · Function
```rust
pub fn set>>(status: Status, activity: impl Into>)
```
Sets the bot's status and activity (`None`: no activity).
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/presence/fn.set.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/function-presence-set_status/
---
# Function presence::set_status
> Sets the custom status text and emoji, cleared by the host at `expires_at` (ms) if given.
`zaun_bot::presence::set_status` · Function
```rust
pub fn set_status(text: Option<&str>, emoji: Option<&str>, expires_at: Option) -> Result<(), HostError>
```
Sets the custom status text and emoji, cleared by the host at `expires_at` (ms) if given.
# Errors
The host's refusal.
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/presence/fn.set_status.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/function-presence-set_status_text/
---
# Function presence::set_status_text
> Sets the custom status text, kept until changed.
`zaun_bot::presence::set_status_text` · Function
```rust
pub fn set_status_text>(text: impl Into) -> Result<(), HostError>
```
Sets the custom status text, kept until changed.
# Errors
The host's refusal (too long, rate limited).
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/presence/fn.set_status_text.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/function-text_choice/
---
# Function text_choice
> A text `Choice` (autocomplete results and fixed choices).
`zaun_bot::text_choice` · Function
```rust
pub fn text_choice, impl Into>(name: impl Into, value: impl Into) -> Choice
```
A text `Choice` (autocomplete results and fixed choices).
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/options/fn.text_choice.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/macro-export_bot/
---
# Macro export_bot
> Exports a `Bot` type as the component's `zaun:bot/bot` implementation.
`zaun_bot::export_bot` · Macro
```rust
macro_rules! export_bot { … }
```
Exports a `Bot` type as the component's `zaun:bot/bot` implementation.
The type must implement `Bot` (and so `Default`). Use it once, in the
bot crate's root.
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/macro.export_bot.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/macro-log_info/
---
# Macro log_info
> Writes an `info` line to the bot's log (`zaun-host bot logs`).
`zaun_bot::log_info` · Macro
```rust
macro_rules! log_info { … }
```
Writes an `info` line to the bot's log (`zaun-host bot logs`).
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/macro.log_info.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/struct-actionrow/
---
# Struct ActionRow
> Builds a types::ActionRow: up to 5 buttons, or one select.
`zaun_bot::ActionRow` · Struct
```rust
pub struct ActionRow(…)
```
Builds a [`types::ActionRow`]: up to 5 buttons, or one select.
## Methods
### `new`
```rust
pub fn new() -> Self
```
An empty row.
### `buttons`
```rust
pub fn buttons>(buttons: impl IntoIterator- ) -> Self
```
A row of buttons.
### `select`
```rust
pub fn select(select: Select) -> Self
```
A row holding one select.
### `button`
```rust
pub fn button(self, button: Button) -> Self
```
Adds a button.
### `build`
```rust
pub fn build(self) -> ActionRow
```
The finished row.
## Trait implementations
`Clone`, `Debug`, `Default`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/select/struct.ActionRow.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/struct-audio/
---
# Struct Audio
> The bot's audio output stream.
`zaun_bot::Audio` · Struct
```rust
pub struct Audio
```
The bot's audio output stream.
## Methods
### `open`
```rust
pub fn open(options: &StreamOptions) -> Result<(), HostError>
```
Opens the stream with every option.
# Errors
`CONFLICT` when the bot is in no voice channel or a stream is open; `UNSUPPORTED` for a
format the host cannot take; `BAD_REQUEST` for values out of range.
### `open_opus`
```rust
pub fn open_opus(title: Option<&str>) -> Result<(), HostError>
```
Opens a stream of Opus packets the bot encodes (`Audio::write_opus`).
# Errors
As `Audio::open`.
### `open_pcm`
```rust
pub fn open_pcm(sample_rate: u32, channels: u8, title: Option<&str>) -> Result<(), HostError>
```
Opens a stream of 16-bit PCM (`Audio::write_pcm`) at `sample_rate` (8000, 12000,
16000, 24000 or 48000) with 1 or 2 interleaved channels; the host encodes it.
# Errors
As `Audio::open`; `UNSUPPORTED` on hosts without an Opus encoder.
### `write_opus`
```rust
pub fn write_opus(packets: &[Vec
]) -> Result
```
Writes Opus packets (2.5–120 ms each, ≤ 1000 bytes); returns the ms buffered.
# Errors
`BUSY` past 3 s buffered (write again on `AudioLow`); `CONFLICT` without an `opus`
stream.
### `write_pcm`
```rust
pub fn write_pcm(samples: &[i16]) -> Result
```
Writes interleaved samples, any count; returns the ms buffered.
# Errors
`BUSY` past 3 s buffered (write again on `AudioLow`); `CONFLICT` without a `pcm`
stream.
### `buffered_ms`
```rust
pub fn buffered_ms() -> u32
```
The audio written and not yet played, in ms (0 without a stream).
### `clear`
```rust
pub fn clear() -> Result<(), HostError>
```
Drops everything buffered at once; the stream stays open.
# Errors
`CONFLICT` without a stream.
### `close`
```rust
pub fn close(drain: bool)
```
Closes the stream, after the buffer has played (`drain`) or at once; the player
resumes. `VoiceEvent::AudioClosed` follows.
## Trait implementations
`Clone`, `Copy`, `Debug`, `Default`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/audio/struct.Audio.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/struct-audio-pcmformat/
---
# Struct audio::PcmFormat
> PCM the host encodes to Opus.
`zaun_bot::audio::PcmFormat` · Struct
```rust
pub struct PcmFormat { … }
```
PCM the host encodes to Opus.
## Fields
### `sample_rate: u32`
8000, 12000, 16000, 24000 or 48000 Hz (Opus's own rates; nothing is resampled).
### `channels: u8`
1 (mono) or 2 (stereo, interleaved left-right).
## Trait implementations
`Clone`, `Copy`, `Debug`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/audio/struct.PcmFormat.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/struct-audio-streamoptions/
---
# Struct audio::StreamOptions
> Struct StreamOptions in zaun_bot.
`zaun_bot::audio::StreamOptions` · Struct
```rust
pub struct StreamOptions { … }
```
## Fields
### `format: AudioFormat`
### `low_water_ms: Option`
Send `audio-low` when less than this is buffered, in ms (20-2000; default 200).
### `title: Option`
Shown as the current title in `voice-state` while the stream plays.
## Trait implementations
`Clone`, `Debug`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/audio/struct.StreamOptions.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-http-request/
---
# Struct bindings::zaun::bot::http::Request
> Struct Request in zaun_bot.
`zaun_bot::bindings::zaun::bot::http::Request` · Struct
```rust
pub struct Request { … }
```
## Fields
### `method: String`
### `url: String`
### `headers: Vec<(String, String)>`
### `body: Option>`
### `timeout_ms: Option`
## Trait implementations
`Clone`, `Debug`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/http/struct.Request.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-http-response/
---
# Struct bindings::zaun::bot::http::Response
> Struct Response in zaun_bot.
`zaun_bot::bindings::zaun::bot::http::Response` · Struct
```rust
pub struct Response { … }
```
## Fields
### `status: u16`
### `headers: Vec<(String, String)>`
### `body: Vec`
## Trait implementations
`Clone`, `Debug`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/http/struct.Response.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-actionrow/
---
# Struct bindings::zaun::bot::types::ActionRow
> Type 1: up to 5 buttons, or one select.
`zaun_bot::bindings::zaun::bot::types::ActionRow` · Struct
```rust
pub struct ActionRow { … }
```
Type 1: up to 5 buttons, or one select.
## Fields
### `id: Option`
### `components: Vec`
## Trait implementations
`Clone`, `Debug`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/types/struct.ActionRow.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-activity/
---
# Struct bindings::zaun::bot::types::Activity
> What a member (or the bot) is doing.
`zaun_bot::bindings::zaun::bot::types::Activity` · Struct
```rust
pub struct Activity { … }
```
What a member (or the bot) is doing.
## Fields
### `kind: ActivityType`
### `name: String`
1-128 characters.
### `details: Option`
<= 128: e.g. the track.
### `state: Option`
<= 128: e.g. the artist.
### `url: Option`
`streaming` only: an `https://` link (open only after the reader confirms).
### `started_at: Option`
When it started, ms since the epoch.
### `emoji: Option`
`custom` only: a Unicode emoji.
## Trait implementations
`Clone`, `Debug`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/types/struct.Activity.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-attachment/
---
# Struct bindings::zaun::bot::types::Attachment
> Struct Attachment in zaun_bot.
`zaun_bot::bindings::zaun::bot::types::Attachment` · Struct
```rust
pub struct Attachment { … }
```
## Fields
### `attachment_id: Id`
### `name: String`
### `size: u64`
### `mime: String`
### `sha3_256: String`
base64url SHA3-256.
## Trait implementations
`Clone`, `Debug`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/types/struct.Attachment.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-button/
---
# Struct bindings::zaun::bot::types::Button
> Type 2.
`zaun_bot::bindings::zaun::bot::types::Button` · Struct
```rust
pub struct Button { … }
```
Type 2.
## Fields
### `id: Option`
### `style: ButtonStyle`
### `label: Option`
### `emoji: Option`
A Unicode emoji.
### `custom_id: Option`
Styles 1-4.
### `url: Option`
Style 5 only: an `https://` link, opened after the reader confirms.
### `disabled: bool`
## Trait implementations
`Clone`, `Debug`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/types/struct.Button.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-checkbox/
---
# Struct bindings::zaun::bot::types::Checkbox
> Type 23.
`zaun_bot::bindings::zaun::bot::types::Checkbox` · Struct
```rust
pub struct Checkbox { … }
```
Type 23.
## Fields
### `id: Option`
### `custom_id: String`
### `is_default: bool`
## Trait implementations
`Clone`, `Debug`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/types/struct.Checkbox.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-checkboxgroup/
---
# Struct bindings::zaun::bot::types::CheckboxGroup
> Type 22: 1-10 options.
`zaun_bot::bindings::zaun::bot::types::CheckboxGroup` · Struct
```rust
pub struct CheckboxGroup { … }
```
Type 22: 1-10 options.
## Fields
### `id: Option`
### `custom_id: String`
### `options: Vec`
### `min_values: Option`
### `max_values: Option`
### `required: Option`
## Trait implementations
`Clone`, `Debug`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/types/struct.CheckboxGroup.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-choiceoption/
---
# Struct bindings::zaun::bot::types::ChoiceOption
> Struct ChoiceOption in zaun_bot.
`zaun_bot::bindings::zaun::bot::types::ChoiceOption` · Struct
```rust
pub struct ChoiceOption { … }
```
## Fields
### `label: String`
### `value: String`
### `description: Option`
## Trait implementations
`Clone`, `Debug`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/types/struct.ChoiceOption.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-commandoption/
---
# Struct bindings::zaun::bot::types::CommandOption
> Struct CommandOption in zaun_bot.
`zaun_bot::bindings::zaun::bot::types::CommandOption` · Struct
```rust
pub struct CommandOption { … }
```
## Fields
### `kind: OptionKind`
### `name: String`
### `name_localizations: Vec`
### `description: String`
### `description_localizations: Vec`
### `required: bool`
### `choices: Vec`
### `channel_types: Vec`
### `min_value: Option`
### `max_value: Option`
### `min_length: Option`
### `max_length: Option`
### `autocomplete: bool`
## Trait implementations
`Clone`, `Debug`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/types/struct.CommandOption.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-communityprofile/
---
# Struct bindings::zaun::bot::types::CommunityProfile
> Struct CommunityProfile in zaun_bot.
`zaun_bot::bindings::zaun::bot::types::CommunityProfile` · Struct
```rust
pub struct CommunityProfile { … }
```
## Fields
### `system_channel_id: Option`
### `default_slowmode_s: u32`
## Trait implementations
`Clone`, `Debug`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/types/struct.CommunityProfile.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-container/
---
# Struct bindings::zaun::bot::types::Container
> Type 17.
`zaun_bot::bindings::zaun::bot::types::Container` · Struct
```rust
pub struct Container { … }
```
Type 17.
## Fields
### `id: Option`
### `components: Vec`
### `accent_color: Option`
### `spoiler: bool`
## Trait implementations
`Clone`, `Debug`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/types/struct.Container.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-defaultvalue/
---
# Struct bindings::zaun::bot::types::DefaultValue
> Struct DefaultValue in zaun_bot.
`zaun_bot::bindings::zaun::bot::types::DefaultValue` · Struct
```rust
pub struct DefaultValue { … }
```
## Fields
### `id: Id`
### `kind: DefaultValueKind`
## Trait implementations
`Clone`, `Debug`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/types/struct.DefaultValue.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-embed/
---
# Struct bindings::zaun::bot::types::Embed
> Struct Embed in zaun_bot.
`zaun_bot::bindings::zaun::bot::types::Embed` · Struct
```rust
pub struct Embed { … }
```
## Fields
### `title: Option`
### `description: Option`
### `url: Option`
`https://` only.
### `color: Option`
### `timestamp: Option`
### `author: Option`
### `footer: Option`
### `image: Option`
Attachment ids of the same message, never URLs.
### `thumbnail: Option`
### `fields: Vec`
## Trait implementations
`Clone`, `Debug`, `From`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/types/struct.Embed.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-embedauthor/
---
# Struct bindings::zaun::bot::types::EmbedAuthor
> embeds
`zaun_bot::bindings::zaun::bot::types::EmbedAuthor` · Struct
```rust
pub struct EmbedAuthor { … }
```
---- embeds ----------------------------------------------------------------
## Fields
### `name: String`
### `url: Option`
### `icon: Option`
## Trait implementations
`Clone`, `Debug`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/types/struct.EmbedAuthor.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-embedfield/
---
# Struct bindings::zaun::bot::types::EmbedField
> Struct EmbedField in zaun_bot.
`zaun_bot::bindings::zaun::bot::types::EmbedField` · Struct
```rust
pub struct EmbedField { … }
```
## Fields
### `name: String`
### `value: String`
### `inline: bool`
## Trait implementations
`Clone`, `Debug`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/types/struct.EmbedField.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-embedfooter/
---
# Struct bindings::zaun::bot::types::EmbedFooter
> Struct EmbedFooter in zaun_bot.
`zaun_bot::bindings::zaun::bot::types::EmbedFooter` · Struct
```rust
pub struct EmbedFooter { … }
```
## Fields
### `text: String`
### `icon: Option`
## Trait implementations
`Clone`, `Debug`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/types/struct.EmbedFooter.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-entityselect/
---
# Struct bindings::zaun::bot::types::EntitySelect
> Struct EntitySelect in zaun_bot.
`zaun_bot::bindings::zaun::bot::types::EntitySelect` · Struct
```rust
pub struct EntitySelect { … }
```
## Fields
### `id: Option`
### `kind: EntityKind`
### `custom_id: String`
### `placeholder: Option`
### `min_values: Option`
### `max_values: Option`
### `default_values: Vec`
### `channel_types: Vec`
Channel select only.
### `required: Option`
### `disabled: bool`
## Trait implementations
`Clone`, `Debug`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/types/struct.EntitySelect.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-file/
---
# Struct bindings::zaun::bot::types::File
> Type 13.
`zaun_bot::bindings::zaun::bot::types::File` · Struct
```rust
pub struct File { … }
```
Type 13.
## Fields
### `id: Option`
### `file: Id`
### `spoiler: bool`
## Trait implementations
`Clone`, `Debug`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/types/struct.File.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-fileupload/
---
# Struct bindings::zaun::bot::types::FileUpload
> Type 19.
`zaun_bot::bindings::zaun::bot::types::FileUpload` · Struct
```rust
pub struct FileUpload { … }
```
Type 19.
## Fields
### `id: Option`
### `custom_id: String`
### `min_values: Option`
### `max_values: Option`
### `required: Option`
## Trait implementations
`Clone`, `Debug`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/types/struct.FileUpload.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-interaction/
---
# Struct bindings::zaun::bot::types::Interaction
> Struct Interaction in zaun_bot.
`zaun_bot::bindings::zaun::bot::types::Interaction` · Struct
```rust
pub struct Interaction { … }
```
## Fields
### `interaction_id: Id`
### `bot_id: Id`
### `channel_id: Id`
### `member: Member`
The invoker.
### `app_permissions: Permissions`
The bot's effective permissions in the channel.
### `locale: Option`
### `message: Option`
For component interactions: the message holding the component.
### `data: InteractionData`
### `created_at: Timestamp`
## Trait implementations
`Clone`, `Debug`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/types/struct.Interaction.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-interactionmetadata/
---
# Struct bindings::zaun::bot::types::InteractionMetadata
> Struct InteractionMetadata in zaun_bot.
`zaun_bot::bindings::zaun::bot::types::InteractionMetadata` · Struct
```rust
pub struct InteractionMetadata { … }
```
## Fields
### `interaction_id: Id`
### `kind: u8`
### `name: Option`
### `member_id: Id`
## Trait implementations
`Clone`, `Debug`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/types/struct.InteractionMetadata.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-label/
---
# Struct bindings::zaun::bot::types::Label
> Type 18.
`zaun_bot::bindings::zaun::bot::types::Label` · Struct
```rust
pub struct Label { … }
```
Type 18.
## Fields
### `id: Option`
### `label: String`
### `description: Option`
### `component: LabelChild`
## Trait implementations
`Clone`, `Debug`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/types/struct.Label.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-localized/
---
# Struct bindings::zaun::bot::types::Localized
> Struct Localized in zaun_bot.
`zaun_bot::bindings::zaun::bot::types::Localized` · Struct
```rust
pub struct Localized { … }
```
## Fields
### `locale: String`
### `text: String`
## Trait implementations
`Clone`, `Debug`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/types/struct.Localized.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-mediagallery/
---
# Struct bindings::zaun::bot::types::MediaGallery
> Type 12: 1-10 items.
`zaun_bot::bindings::zaun::bot::types::MediaGallery` · Struct
```rust
pub struct MediaGallery { … }
```
Type 12: 1-10 items.
## Fields
### `id: Option`
### `items: Vec`
## Trait implementations
`Clone`, `Debug`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/types/struct.MediaGallery.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-mediaitem/
---
# Struct bindings::zaun::bot::types::MediaItem
> Struct MediaItem in zaun_bot.
`zaun_bot::bindings::zaun::bot::types::MediaItem` · Struct
```rust
pub struct MediaItem { … }
```
## Fields
### `media: Id`
### `description: Option`
### `spoiler: bool`
## Trait implementations
`Clone`, `Debug`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/types/struct.MediaItem.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-memberroles/
---
# Struct bindings::zaun::bot::types::MemberRoles
> Struct MemberRoles in zaun_bot.
`zaun_bot::bindings::zaun::bot::types::MemberRoles` · Struct
```rust
pub struct MemberRoles { … }
```
## Fields
### `member_id: Id`
### `role_ids: Vec`
## Trait implementations
`Clone`, `Debug`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/types/struct.MemberRoles.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-membertimeout/
---
# Struct bindings::zaun::bot::types::MemberTimeout
> `until` is `none` when the timeout was cleared.
`zaun_bot::bindings::zaun::bot::types::MemberTimeout` · Struct
```rust
pub struct MemberTimeout { … }
```
`until` is `none` when the timeout was cleared.
## Fields
### `member_id: Id`
### `until: Option`
## Trait implementations
`Clone`, `Debug`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/types/struct.MemberTimeout.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-messagebody/
---
# Struct bindings::zaun::bot::types::MessageBody
> What a bot sends: `message.send`, responses, follow-ups and edits.
`zaun_bot::bindings::zaun::bot::types::MessageBody` · Struct
```rust
pub struct MessageBody { … }
```
What a bot sends: `message.send`, responses, follow-ups and edits.
## Fields
### `content: Option`
### `embeds: Vec`
### `components: Vec`
### `attachments: Vec`
Attachment ids the bot uploaded (`messages.upload`).
### `mentions: Option`
### `flags: MessageFlags`
## Trait implementations
`Clone`, `Debug`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/types/struct.MessageBody.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-messagedeleted/
---
# Struct bindings::zaun::bot::types::MessageDeleted
> Struct MessageDeleted in zaun_bot.
`zaun_bot::bindings::zaun::bot::types::MessageDeleted` · Struct
```rust
pub struct MessageDeleted { … }
```
## Fields
### `channel_id: Id`
### `message_id: Id`
## Trait implementations
`Clone`, `Debug`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/types/struct.MessageDeleted.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-messageevent/
---
# Struct bindings::zaun::bot::types::MessageEvent
> A message, and whether it is in a direct-message channel with the bot.
`zaun_bot::bindings::zaun::bot::types::MessageEvent` · Struct
```rust
pub struct MessageEvent { … }
```
A message, and whether it is in a direct-message channel with the bot.
## Fields
### `message: Message`
### `is_dm: bool`
## Trait implementations
`Clone`, `Debug`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/types/struct.MessageEvent.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-messageflags/
---
# Struct bindings::zaun::bot::types::MessageFlags
> messages Discord's values: 4, 64, 4096, 32768. `LOADING` is host-set only.
`zaun_bot::bindings::zaun::bot::types::MessageFlags` · Struct
```rust
pub struct MessageFlags(…)
```
---- messages -------------------------------------------------------
Discord's values: 4, 64, 4096, 32768. `LOADING` is host-set only.
## Methods
### `empty`
```rust
pub const fn empty() -> Self
```
Get a flags value with all bits unset.
### `all`
```rust
pub const fn all() -> Self
```
Get a flags value with all known bits set.
### `bits`
```rust
pub const fn bits(&self) -> u8
```
Get the underlying bits value.
The returned value is exactly the bits set in this flags value.
### `from_bits`
```rust
pub const fn from_bits(bits: u8) -> Option
```
Convert from a bits value.
This method will return `None` if any unknown bits are set.
### `from_bits_truncate`
```rust
pub const fn from_bits_truncate(bits: u8) -> Self
```
Convert from a bits value, unsetting any unknown bits.
### `from_bits_retain`
```rust
pub const fn from_bits_retain(bits: u8) -> Self
```
Convert from a bits value exactly.
### `from_name`
```rust
pub fn from_name(name: &str) -> Option
```
Get a flags value with the bits of a flag with the given name set.
This method will return `None` if `name` is empty or doesn't
correspond to any named flag.
### `is_empty`
```rust
pub const fn is_empty(&self) -> bool
```
Whether all bits in `self` are unset.
### `is_all`
```rust
pub const fn is_all(&self) -> bool
```
Whether all known bits in this flags value are set.
### `intersects`
```rust
pub const fn intersects(&self, other: Self) -> bool
```
Whether any set bits in `other` are also set in `self`.
### `contains`
```rust
pub const fn contains(&self, other: Self) -> bool
```
Whether all set bits in `other` are also set in `self`.
### `insert`
```rust
pub fn insert(&mut self, other: Self)
```
The bitwise or (`|`) of the bits in `self` and `other`.
### `remove`
```rust
pub fn remove(&mut self, other: Self)
```
The intersection of `self` with the complement of `other` (`&!`).
This method is not equivalent to `self & !other` when `other` has unknown bits set.
`remove` won't truncate `other`, but the `!` operator will.
### `toggle`
```rust
pub fn toggle(&mut self, other: Self)
```
The bitwise exclusive-or (`^`) of the bits in `self` and `other`.
### `set`
```rust
pub fn set(&mut self, other: Self, value: bool)
```
Call `insert` when `value` is `true` or `remove` when `value` is `false`.
### `intersection`
```rust
pub const fn intersection(self, other: Self) -> Self
```
The bitwise and (`&`) of the bits in `self` and `other`.
### `union`
```rust
pub const fn union(self, other: Self) -> Self
```
The bitwise or (`|`) of the bits in `self` and `other`.
### `difference`
```rust
pub const fn difference(self, other: Self) -> Self
```
The intersection of `self` with the complement of `other` (`&!`).
This method is not equivalent to `self & !other` when `other` has unknown bits set.
`difference` won't truncate `other`, but the `!` operator will.
### `symmetric_difference`
```rust
pub const fn symmetric_difference(self, other: Self) -> Self
```
The bitwise exclusive-or (`^`) of the bits in `self` and `other`.
### `complement`
```rust
pub const fn complement(self) -> Self
```
The bitwise negation (`!`) of the bits in `self`, truncating the result.
### `iter`
```rust
pub const fn iter(&self) -> Iter
```
Yield a set of contained flags values.
Each yielded flags value will correspond to a defined named flag. Any unknown bits
will be yielded together as a final flags value.
### `iter_names`
```rust
pub const fn iter_names(&self) -> IterNames
```
Yield a set of contained named flags values.
This method is like [`iter`](#method.iter), except only yields bits in contained named flags.
Any unknown bits, or bits not corresponding to a contained flag will not be yielded.
## Trait implementations
`Binary`, `BitAnd`, `BitAndAssign`, `BitOr`, `BitOrAssign`, `BitXor`, `BitXorAssign`, `Clone`, `Copy`, `Debug`, `Eq`, `Extend`, `Flags`, `FromIterator`, `Hash`, `IntoIterator`, `LowerHex`, `Not`, `Octal`, `Ord`, `PartialEq`, `PartialOrd`, `PublicFlags`, `StructuralPartialEq`, `Sub`, `SubAssign`, `UpperHex`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/types/struct.MessageFlags.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-messagesdeleted/
---
# Struct bindings::zaun::bot::types::MessagesDeleted
> Struct MessagesDeleted in zaun_bot.
`zaun_bot::bindings::zaun::bot::types::MessagesDeleted` · Struct
```rust
pub struct MessagesDeleted { … }
```
## Fields
### `channel_id: Id`
### `message_ids: Vec`
## Trait implementations
`Clone`, `Debug`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/types/struct.MessagesDeleted.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-modal/
---
# Struct bindings::zaun::bot::types::Modal
> Struct Modal in zaun_bot.
`zaun_bot::bindings::zaun::bot::types::Modal` · Struct
```rust
pub struct Modal { … }
```
## Fields
### `custom_id: String`
### `title: String`
### `components: Vec`
## Trait implementations
`Clone`, `Debug`, `From`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/types/struct.Modal.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-modalvalue/
---
# Struct bindings::zaun::bot::types::ModalValue
> Struct ModalValue in zaun_bot.
`zaun_bot::bindings::zaun::bot::types::ModalValue` · Struct
```rust
pub struct ModalValue { … }
```
## Fields
### `id: Option`
### `custom_id: String`
### `component_type: u8`
### `value: Option`
### `values: Vec`
## Trait implementations
`Clone`, `Debug`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/types/struct.ModalValue.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-presence/
---
# Struct bindings::zaun::bot::types::Presence
> `status`: `online`, `idle`, `dnd` or `offline` (invisible members look offline).
`zaun_bot::bindings::zaun::bot::types::Presence` · Struct
```rust
pub struct Presence { … }
```
`status`: `online`, `idle`, `dnd` or `offline` (invisible members look offline).
## Fields
### `member_id: Id`
### `status: String`
### `activity: Option`
## Trait implementations
`Clone`, `Debug`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/types/struct.Presence.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-radiogroup/
---
# Struct bindings::zaun::bot::types::RadioGroup
> Type 21: 2-10 options.
`zaun_bot::bindings::zaun::bot::types::RadioGroup` · Struct
```rust
pub struct RadioGroup { … }
```
Type 21: 2-10 options.
## Fields
### `id: Option`
### `custom_id: String`
### `options: Vec`
### `required: Option`
## Trait implementations
`Clone`, `Debug`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/types/struct.RadioGroup.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-rawevent/
---
# Struct bindings::zaun::bot::types::RawEvent
> Struct RawEvent in zaun_bot.
`zaun_bot::bindings::zaun::bot::types::RawEvent` · Struct
```rust
pub struct RawEvent { … }
```
## Fields
### `kind: String`
### `json: String`
## Trait implementations
`Clone`, `Debug`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/types/struct.RawEvent.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-receivedoption/
---
# Struct bindings::zaun::bot::types::ReceivedOption
> One option the invoker filled in, with the sub-command path flattened onto the data.
`zaun_bot::bindings::zaun::bot::types::ReceivedOption` · Struct
```rust
pub struct ReceivedOption { … }
```
One option the invoker filled in, with the sub-command path flattened onto the data.
## Fields
### `name: String`
### `kind: OptionKind`
### `value: OptionValue`
### `focused: bool`
## Trait implementations
`Clone`, `Debug`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/types/struct.ReceivedOption.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-registeredcommand/
---
# Struct bindings::zaun::bot::types::RegisteredCommand
> Struct RegisteredCommand in zaun_bot.
`zaun_bot::bindings::zaun::bot::types::RegisteredCommand` · Struct
```rust
pub struct RegisteredCommand { … }
```
## Fields
### `command_id: Id`
### `kind: CommandKind`
### `name: String`
## Trait implementations
`Clone`, `Debug`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/types/struct.RegisteredCommand.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-registration/
---
# Struct bindings::zaun::bot::types::Registration
> What `init` returns.
`zaun_bot::bindings::zaun::bot::types::Registration` · Struct
```rust
pub struct Registration { … }
```
What `init` returns.
## Fields
### `commands: Vec`
## Trait implementations
`Clone`, `Debug`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/types/struct.Registration.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-resolved/
---
# Struct bindings::zaun::bot::types::Resolved
> Struct Resolved in zaun_bot.
`zaun_bot::bindings::zaun::bot::types::Resolved` · Struct
```rust
pub struct Resolved { … }
```
## Fields
### `members: Vec`
### `roles: Vec`
### `channels: Vec`
### `messages: Vec`
### `attachments: Vec`
## Trait implementations
`Clone`, `Debug`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/types/struct.Resolved.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-section/
---
# Struct bindings::zaun::bot::types::Section
> Type 9: 1-3 text displays and an accessory.
`zaun_bot::bindings::zaun::bot::types::Section` · Struct
```rust
pub struct Section { … }
```
Type 9: 1-3 text displays and an accessory.
## Fields
### `id: Option`
### `components: Vec`
### `accessory: SectionAccessory`
## Trait implementations
`Clone`, `Debug`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/types/struct.Section.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-selectoption/
---
# Struct bindings::zaun::bot::types::SelectOption
> Struct SelectOption in zaun_bot.
`zaun_bot::bindings::zaun::bot::types::SelectOption` · Struct
```rust
pub struct SelectOption { … }
```
## Fields
### `label: String`
### `value: String`
### `description: Option`
### `emoji: Option`
### `is_default: bool`
## Trait implementations
`Clone`, `Debug`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/types/struct.SelectOption.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-separator/
---
# Struct bindings::zaun::bot::types::Separator
> Type 14.
`zaun_bot::bindings::zaun::bot::types::Separator` · Struct
```rust
pub struct Separator { … }
```
Type 14.
## Fields
### `id: Option`
### `divider: bool`
### `spacing: SeparatorSpacing`
## Trait implementations
`Clone`, `Copy`, `Debug`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/types/struct.Separator.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-stringselect/
---
# Struct bindings::zaun::bot::types::StringSelect
> Type 3.
`zaun_bot::bindings::zaun::bot::types::StringSelect` · Struct
```rust
pub struct StringSelect { … }
```
Type 3.
## Fields
### `id: Option`
### `custom_id: String`
### `options: Vec`
### `placeholder: Option`
### `min_values: Option`
### `max_values: Option`
### `required: Option`
In a modal.
### `disabled: bool`
## Trait implementations
`Clone`, `Debug`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/types/struct.StringSelect.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-subcommand/
---
# Struct bindings::zaun::bot::types::SubCommand
> Type 1.
`zaun_bot::bindings::zaun::bot::types::SubCommand` · Struct
```rust
pub struct SubCommand { … }
```
Type 1.
## Fields
### `name: String`
### `name_localizations: Vec`
### `description: String`
### `description_localizations: Vec`
### `options: Vec`
## Trait implementations
`Clone`, `Debug`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/types/struct.SubCommand.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-subcommandgroup/
---
# Struct bindings::zaun::bot::types::SubCommandGroup
> Type 2.
`zaun_bot::bindings::zaun::bot::types::SubCommandGroup` · Struct
```rust
pub struct SubCommandGroup { … }
```
Type 2.
## Fields
### `name: String`
### `name_localizations: Vec`
### `description: String`
### `description_localizations: Vec`
### `sub_commands: Vec`
## Trait implementations
`Clone`, `Debug`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/types/struct.SubCommandGroup.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-textdisplay/
---
# Struct bindings::zaun::bot::types::TextDisplay
> Type 10.
`zaun_bot::bindings::zaun::bot::types::TextDisplay` · Struct
```rust
pub struct TextDisplay { … }
```
Type 10.
## Fields
### `id: Option`
### `content: String`
## Trait implementations
`Clone`, `Debug`
[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/types/struct.TextDisplay.html)
---
url: https://zaunchat.github.io/docs/reference/rust/zaun-bot/struct-bindings-zaun-bot-types-textinput/
---
# Struct bindings::zaun::bot::types::TextInput
> Type 4.
`zaun_bot::bindings::zaun::bot::types::TextInput` · Struct
```rust
pub struct TextInput { … }
```
Type 4.
## Fields
### `id: Option`
### `custom_id: String`
### `style: TextInputStyle`
### `min_length: Option`
### `max_length: Option