Discord Bot API Skill (Advanced)
Purpose
Provide a production-oriented guide for building Discord bot workflows via the REST API and Interactions, focusing on professional command UX, safe operations, and direct HTTPS usage (no SDKs).
Best fit
- - You want command-first bot behavior and clear interaction flows.
- You prefer direct HTTP requests without a library dependency.
- You need a structured map of Discord API surfaces.
Not a fit
- - You need a full SDK or gateway client implementation.
- You plan to stream large media uploads directly.
Quick orientation
- - Read
references/discord-api-overview.md for base URL, versioning, and object map. - Read
references/discord-auth-and-tokens.md for token types and security boundaries. - Read
references/discord-interactions.md for interaction lifecycle and response patterns. - Read
references/discord-app-commands.md for slash, user, and message commands. - Read
references/discord-messages-components.md for messages, embeds, and components. - Read
references/discord-gateway-webhooks.md for gateway vs webhook tradeoffs. - Read
references/discord-rate-limits.md for throttling and header-based handling. - Read
references/discord-request-templates.md for HTTP payload templates. - Read
references/discord-feature-map.md for the full surface checklist.
Required inputs
- - Bot token and application ID.
- Interaction endpoint public key (if using interaction webhooks).
- Command list and UX tone.
- Allowed intents and event scope.
Expected output
- - A clear bot workflow plan, command design, and operational checklist.
Operational notes
- - Prefer interactions and slash commands over prefix parsing.
- Always validate incoming interaction signatures.
- Keep payloads small and respond quickly to interactions.
Security notes
- - Never log tokens or secrets.
- Use least-privilege permissions and scopes.
Discord Bot API 技能(高级)
目的
提供一份面向生产的指南,用于通过REST API和交互构建Discord机器人工作流,专注于专业的命令用户体验、安全操作以及直接使用HTTPS(无需SDK)。
最佳适用场景
- - 你需要以命令优先的机器人行为和清晰的交互流程。
- 你倾向于直接使用HTTP请求,不依赖库。
- 你需要一份结构化的Discord API接口映射。
不适用场景
- - 你需要完整的SDK或网关客户端实现。
- 你计划直接流式传输大型媒体上传。
快速导航
- - 阅读 references/discord-api-overview.md 了解基础URL、版本控制和对象映射。
- 阅读 references/discord-auth-and-tokens.md 了解令牌类型和安全边界。
- 阅读 references/discord-interactions.md 了解交互生命周期和响应模式。
- 阅读 references/discord-app-commands.md 了解斜杠命令、用户命令和消息命令。
- 阅读 references/discord-messages-components.md 了解消息、嵌入和组件。
- 阅读 references/discord-gateway-webhooks.md 了解网关与Webhook的权衡。
- 阅读 references/discord-rate-limits.md 了解限流和基于标头的处理。
- 阅读 references/discord-request-templates.md 了解HTTP负载模板。
- 阅读 references/discord-feature-map.md 了解完整的接口清单。
必需输入
- - 机器人令牌和应用程序ID。
- 交互端点公钥(如果使用交互Webhook)。
- 命令列表和用户体验风格。
- 允许的意图和事件范围。
预期输出
操作说明
- - 优先使用交互和斜杠命令,而非前缀解析。
- 始终验证传入的交互签名。
- 保持负载小巧,并快速响应交互。
安全说明
- - 切勿记录令牌或密钥。
- 使用最小权限原则设置权限和作用域。