channel-telegram
Run and operate a Telegram channel worker for LionClaw using the kernel channel bridge APIs.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Run and operate a Telegram channel worker for LionClaw using the kernel channel bridge APIs.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Use this skill when asked to communicate with another local LionClaw project instance, teammate, reviewer, QA instance, or sibling agent through team-local. Use it to list reachable instances, resolve routes, and send requested questions, results, updates, or /runtime attachments via the LionClaw channel_send MCP tool.
First-party LionClaw channel for local project instance communication.
Use when the user invokes $lionclaw-private-context, asks what LionClaw remembers, or wants to remember, update, or clarify durable memory, style, preferences, or private context.
Host-side LionClaw private-context skill for deterministic projection, committed-turn recording, and explicit profile or memory management.
Host-side Email work-inbox channel for LionClaw.
Handle LionClaw email-channel turns and replies without touching mailbox credentials or raw mail transport.
| name | channel-telegram |
| description | Run and operate a Telegram channel worker for LionClaw using the kernel channel bridge APIs. |
Use this skill when the user wants Telegram as a LionClaw channel.
Manual QA and Telegram-specific acceptance notes live in README.md in this
skill directory.
What you run:
Under the hood, the worker:
telegram:user:<id>,
telegram:chat:<id>, telegram:topic:<id>, and
telegram:message:<id>,/v0/channels/inbound and treats the
response as admission state, not completed work,lc_... pairing tokens through the kernel pairing API without
starting an agent turn for the claim message,waiting_for_attachments,/v0/channels/stream/pull for progress events,/status and /stop without
stealing runtime slash commands such as /compact,/v0/channels/outbox/pull,/v0/channels/outbox/report,/v0/channels/health/report,/v0/channels/stream/ack.python3 and uv for source/development worker runsUse the product path first:
printf 'TELEGRAM_BOT_TOKEN=...\n' > telegram.env
lionclaw connect telegram --env-file ./telegram.env
lionclaw doctor
connect telegram installs or refreshes the channel skill, stores declared
channel env in the selected instance home, and starts the background stack.
Direct worker invocation is for development and tests when you intentionally
provide the LionClaw worker environment. Polling is the default. For webhook
deployments, expose the worker's local receiver through HTTPS, set Telegram's
webhook URL with the same secret_token, and run the worker with its normal
LionClaw/Telegram env plus:
TELEGRAM_UPDATE_MODE=webhook \
TELEGRAM_WEBHOOK_SECRET_TOKEN=... \
TELEGRAM_WEBHOOK_HOST=127.0.0.1 \
TELEGRAM_WEBHOOK_PORT=8080 \
TELEGRAM_WEBHOOK_PATH=/telegram/webhook \
./skills/channel-telegram/scripts/worker
pending_approval -> approved grant
through lionclaw channel pairing approve ...).message, edited_message, channel_post, and
edited_channel_post updates when they contain usable text, captions, or
supported media. Inline callback_query updates are accepted only for
HMAC-scoped LionClaw button payloads generated by this worker.dm; group mentions and bot replies use Telegram
entities and the bot's numeric id; leading bot mentions are stripped from the
runtime-facing text and captions; forum topics map to scoped thread refs.media_group_id albums are coalesced before attachment staging so the
runtime sees one turn with all album files./start lc_<token>.
DM links use https://t.me/<bot_username>?start=lc_<token>; group links use
https://t.me/<bot_username>?startgroup=lc_<token> where Telegram exposes the
payload to the bot. Approved Telegram hosts can create a short-lived one-use
group link from /connections in DM; unconnected groups are instructed to use
that link path rather than exposing pc_... operator approval codes.
Connected groups authorize the destination only. The Telegram sender must also
have an approved direct host grant before group prompts, runtime slash
commands, or local group controls run.consumer_id to telegram:<channel_id> and
start_mode=resume, so unacked progress events are replayed after worker
restart. LIONCLAW_STREAM_START_MODE accepts resume or tail./help, /status,
/stop, /settings, and /connections are channel-local controls. Session
mutation commands stay namespaced as /lionclaw reset and /lionclaw retry;
bare slash commands pass through to the runtime after Telegram-only addressing
syntax is removed.
Connected groups get chat-scoped /ask, /help, /status, /stop, and
/settings menu commands. In groups, /ask message strips /ask and submits
only the message body to the runtime; empty /ask opens a selective Telegram
reply prompt for the asker.
/stop uses the channel-safe active turn cancellation action with the
expected turn id guard. Bot commands explicitly targeted at a different
Telegram bot are never captured as LionClaw-local controls, even inside an
active forum topic. In groups, commands with a leading bot mention, for example
@lionclaw_bot /status, are treated like first-column bot commands; runtime
slash commands are forwarded without the leading mention or @lionclaw_bot
command target.sendPhoto, sendVideo, sendAudio/sendVoice) and fall back to
documents by MIME type. Short text on media deliveries is used as the first
attachment caption when the rendered caption fits Telegram's limits. Native
Telegram media groups are used for compatible photo/video batches with two
to ten attachments.thread_ref and reply_to_ref are converted back into Telegram
delivery parameters, and each outbox lease is reported with its attempt_id.runtime_id in inbound requests.$LIONCLAW_HOME/runtime/channels/$LIONCLAW_CHANNEL_ID/telegram.offset by
default. Webhook mode is enabled with TELEGRAM_UPDATE_MODE=webhook and
requires TELEGRAM_WEBHOOK_SECRET_TOKEN; TELEGRAM_WEBHOOK_HOST,
TELEGRAM_WEBHOOK_PORT, TELEGRAM_WEBHOOK_PATH, and
TELEGRAM_WEBHOOK_MAX_BODY_BYTES tune the local receiver.LIONCLAW_HEALTH_REPORT_INTERVAL_SECS. Checks cover a fresh Telegram
getMe, polling or webhook intake health, update lag, malformed provider
updates quarantined by the current worker process, and delivery failures
observed by the current worker process.Run these from the repository root when changing this skill:
uv run --project skills/channel-telegram black --check skills/channel-telegram/lionclaw_channel_telegram skills/channel-telegram/tests
uv run --project skills/channel-telegram ruff check skills/channel-telegram/lionclaw_channel_telegram skills/channel-telegram/tests
uv run --project skills/channel-telegram python -m unittest discover -s skills/channel-telegram/tests -q