Composure
Composure is a Rust framework for Discord bots that answer Interactions over HTTP, with no gateway: served from Cloudflare Workers or any server. This guide walks through building one, chapter by chapter; every example in it is compiled as a test.
- Getting started: crates, features, a first bot, serving and syncing it
- Commands:
#[command], Options, Choices, Groups, context menus, autocomplete, Scopes - Responses: what handlers return; ephemeral messages, embeds, files, errors
- Components and modals: buttons, selects and forms with
#[component],#[modal]and#[derive(Modal)], state in thecustom_id - Views:
rsx!markup and#[view], with a reference of every tag and attribute - REST and deferring: calling Discord’s API, follow-ups, Deferred Responses
- Webhook Events: app installs, entitlements, lobby messages
- Platforms: Adapters, State, platform-specific Commands, logging
- Testing: running handlers without Discord
- Local development, Deploying and Troubleshooting: running a bot, shipping it, and fixing it
The API documentation covers every type and function.
Terms like Command, Option, App, Route, Scope and Sync are capitalized when they
mean Composure’s concept of them; see
CONTEXT.md for the
glossary, and docs/adr/ for
why things are the way they are.