Expand description
Telegram’s plug-in to the generic service lifecycle.
Everything in this file is Telegram-specific — scope names, the
prompt for a default chat, the shape of the Telegram credential
(TelegramSecrets = one bot token), and the call that validates
the token against the Bot 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 full recipe.
Structs§
- Captured
Chat - Snapshot of the first private-chat message we saw during capture.
chat_idis the value persisted to config; the remaining fields are used only to render the confirmation prompt. - Create
Args - Telegram
Lifecycle - Telegram
Secrets - Telegram uses one long-lived bot token, issued by @BotFather. It carries the bot’s identity on its own — there is no separate application ID.
Constants§
- CAPTURE_
TIMEOUT - How long
capture_self_chatwill wait for the user to send a message to the bot before giving up. Picked to be long enough for a context-switch to the Telegram client, short enough to fail fast if the user never sends anything.
Functions§
- capture_
self_ chat - Poll
getUpdatesfor up toCAPTURE_TIMEOUTseconds, looking for the first private-chat message whosefrom.iddiffers from the bot’s own ID. ReturnsSome(CapturedChat)on success (and after the user confirms the detected identity),Noneif the user skipped or the timeout elapsed.