Expand description
Discord’s plug-in to the generic service lifecycle.
Everything in this file is Discord-specific — scope names, prompts
for application ID and default guild, the shape of the Discord
credential (DiscordSecrets = one bot token), and the call that
validates the token against the Discord API. The generic plumbing
(flag parsing, path resolution, JSON envelopes, human banners,
keychain I/O sequencing) lives in src/cli/lifecycle.rs and is
shared with every other service.
See docs/services.md#adding-a-new-service for the recipe a new
service would follow. This file is the first — and, until
Telegram/Slack/etc. land, only — implementation of that recipe.
Structs§
- Create
Args - Discord
Lifecycle - Discord
Secrets - Discord only uses one secret — the long-lived bot token — so
Secretswraps it in a named struct rather thanStringfor parity with services that need richer shapes.
Functions§
- validate_
self_ user - Validate a Discord user-ID string: numeric snowflake that resolves
via
GET /users/{id}. Shared between the create-time path andzad discord self set. Returns the canonical string form (not the parsedu64) because the config field is already aString.