channel-bot

GitHub

管理 Telegram/Slack 聊天机器人渠道,实现消息路由、Webhook/Polling 配置及新适配器开发。用于将 AI Agent 接入即时通讯平台并处理消息收发与身份会话管理。

template/{{cookiecutter.project_slug}}/.claude/skills/channel-bot/SKILL.md vstorm-co/full-stack-ai-agent-template

Trigger Scenarios

注册或管理 Telegram/Slack 机器人 调试消息投递问题 添加新的消息平台适配器

Install

npx skills add vstorm-co/full-stack-ai-agent-template --skill channel-bot -g -y
More Options

Non-standard path

npx skills add https://github.com/vstorm-co/full-stack-ai-agent-template/tree/main/template/{{cookiecutter.project_slug}}/.claude/skills/channel-bot -g -y

Use without installing

npx skills use vstorm-co/full-stack-ai-agent-template@channel-bot

指定 Agent (Claude Code)

npx skills add vstorm-co/full-stack-ai-agent-template --skill channel-bot -a claude-code -g -y

安装 repo 全部 skill

npx skills add vstorm-co/full-stack-ai-agent-template --all -g -y

预览 repo 内 skill

npx skills add vstorm-co/full-stack-ai-agent-template --list

SKILL.md

Frontmatter
{
    "name": "channel-bot",
    "description": "Work with messaging-channel bots (Telegram \/ Slack) — register a bot, route inbound messages through the AI agent, handle webhooks vs polling, or add a new channel adapter. Use when wiring chat into a messaging platform or debugging bot delivery."
}

Messaging Channels (Telegram / Slack)

Channels are a thick service at backend/app/services/channels/: per-platform adapters plus a router that funnels inbound messages into the same agent pipeline as the web chat.

Layout

File Responsibility
base.py Shared channel adapter interface
telegram.py Telegram adapter (aiogram v3)
slack.py Slack adapter (Events API + Socket Mode)
router.py Maps an inbound platform message → conversation/session → agent run → reply
chart_render.py Renders chart tool output as PNG for channels

Bots are stored in the DB (channel_bot), with per-user identity (channel_identity) and per-thread session (channel_session) tables. Bot tokens are encrypted at rest with CHANNEL_ENCRYPTION_KEY (Fernet).

Register / manage a bot

uv run {{ cookiecutter.project_slug }} cmd channel ...   # see `cmd channel --help`

Webhook vs polling

  • Polling (dev): the adapter long-polls the platform — no public URL needed.
  • Webhook (prod): the platform POSTs to POST /api/v1/telegram/{bot_id}/webhook / the Slack events endpoint. Verify the signature/secret (HMAC for Telegram, signing secret for Slack) before processing.

Add a new channel adapter

  1. Implement an adapter in services/channels/<platform>.py against the base.py interface (parse inbound → normalized message; send outbound).
  2. Wire it into router.py so inbound messages reach the agent and replies stream back.
  3. Add a webhook route under api/routes/v1/ (signature-verified) and/or a polling entrypoint.
  4. Reuse the existing conversation/session model — don't fork the agent pipeline.

Rules

  • Inbound messages flow through router.py into the same agent/session pipeline as web chat — don't duplicate agent logic per platform.
  • Always verify webhook signatures before acting on a payload.
  • Store tokens encrypted (CHANNEL_ENCRYPTION_KEY); never log or echo them.
  • Respect per-group/per-thread concurrency controls already in the adapters.

Version History

  • 0.2.16 Current 2026-07-25 10:05

Same Skill Collection

template/{{cookiecutter.project_slug}}/.claude/skills/agent-tool/SKILL.md
template/{{cookiecutter.project_slug}}/.claude/skills/alembic-migration/SKILL.md
template/{{cookiecutter.project_slug}}/.claude/skills/background-task/SKILL.md
template/{{cookiecutter.project_slug}}/.claude/skills/billing-stripe/SKILL.md
template/{{cookiecutter.project_slug}}/.claude/skills/frontend-feature/SKILL.md
template/{{cookiecutter.project_slug}}/.claude/skills/pytest-suite/SKILL.md
template/{{cookiecutter.project_slug}}/.claude/skills/rag-knowledge/SKILL.md

Metadata

Files
0
Version
0.2.19
Hash
7c48eeab
Indexed
2026-07-25 10:05

ホーム - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-10-03 07:32
浙ICP备14020137号-1