MarketDeck docs

telegram

Send notifications through a Telegram bot — agent runs, paper trade events, alerts.

Telegram is one of the optional notification channels the agent runtime can fan messages out to. The bot token and chat id live in GSettings (or in the secret store on hosts without GSettings); the token is never logged.

Usage#

marketdeck telegram <subcommand> [args]

Subcommands#

SubcommandWhat it does
statusShow whether a token is present and the configured chat id (no token leak).
testSend a canned test message — confirms both the token and the chat id resolve at the API.
send <message…>Send an arbitrary message to the configured chat. Useful for cron-driven scripts.

Examples#

marketdeck telegram status --format text
marketdeck telegram test
marketdeck secrets test --scope telegram
marketdeck secrets rotate-plan --scope telegram
marketdeck telegram send "Daily snapshot complete: see /tmp/marketdeck.log"

Configuration#

Set the token + chat id once via marketdeck config:

marketdeck config set telegram-bot-token  '<bot-token>'
marketdeck config set telegram-chat-id    '<numeric-chat-id>'

Bot tokens are sensitive — use single-quoted strings on the shell to avoid expansion, and prefer setting them via the GNOME plugin's prefs UI when you have the choice (it routes the value to the secret store directly without it appearing in shell history).

Use marketdeck secrets for metadata-only Telegram diagnostics, export, rotation planning, and confirmed removal. The bot token is never printed.

Trading Safety#

The daemon-hosted bot exposes interactive real-perp actions such as /open and /close. Those actions consume the same Trading Preflight v2 engine as marketdeck safety preflight, marketdeck wallets ..., and real-agent autotrade before a signed order is sent. A blocked trade is shown in chat with the top preflight findings instead of falling through to an exchange rejection.

Token redaction#

/bot<id>:<secret>/... URLs are stripped from every persist site (in-memory log buffer, the cross-process JSONL log, the per-host last-error message, and observer callbacks) before any external viewer sees them. A journal grep for the token comes back empty.