1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
//! `autumn-plugin-discord`: a Discord bot framework for Autumn.
//!
//! Declare slash commands as data, mount the signed interactions webhook,
//! and answer with typed responses:
//!
//! ```ignore
//! use autumn_plugin_discord::{Command, DiscordPlugin, InteractionResponse, MessagePayload};
//! use autumn_web::prelude::*;
//!
//! async fn ping(ctx: autumn_plugin_discord::CommandContext) -> AutumnResult<InteractionResponse> {
//! Ok(InteractionResponse::channel_message(MessagePayload::content("Pong!")))
//! }
//!
//! #[autumn_web::main]
//! async fn main() {
//! autumn_web::app()
//! .plugin(DiscordPlugin::new().command(Command::new("ping", "Replies with Pong!").handler(ping)))
//! .run()
//! .await;
//! }
//! ```
//!
//! ## Configuration
//!
//! ```toml
//! [discord]
//! application_id = "123456789012345678"
//! public_key = "<64 hex chars from the developer portal>"
//! ```
//!
//! The bot token comes only from the `DISCORD_BOT_TOKEN` environment
//! variable — never from the config file.
//!
//! ## Modules
//!
//! | Module | Purpose |
//! |--------|---------|
//! | [`config`] | Layered `[discord]` config: file, env, builder overrides |
//! | [`commands`] | Slash-command declarations and dispatch |
//! | [`interactions`] | The signed webhook route and the [`interactions::VerifiedInteraction`] extractor |
//! | [`verify`] | Ed25519 signature verification |
//! | [`client`] | Discord REST client (register commands, follow-ups) |
//! | [`gateway`] | Minimal gateway client (identify, heartbeat, dispatch) |
//! | [`health`] | `GET /applications/@me` readiness check |
//! | [`plugin`] | The [`plugin::DiscordPlugin`] |
// ── Re-exports ─────────────────────────────────────────────────────
pub use ;
pub use ;
pub use DiscordConfig;
pub use ;
pub use ;
pub use ;
pub use VerifiedInteraction;
pub use ;
pub use ;
pub use ;