Telegram Topic Message Sender
This skill packages Telegram topic messaging into a reusable script.
It now uses openclaw message send directly (no bot token env required).
What it does
- - Send a message to a Telegram supergroup topic (
message_thread_id) - Supports fixed defaults (chat/topic) so daily use can be one command
- Uses OpenClaw CLI INLINECODE2
Script
Required env
- - None (uses your configured OpenClaw channel auth)
Optional defaults
- -
TG_DEFAULT_CHANNEL: default channel (default telegram) - INLINECODE6 : default chat id (e.g.
-1003574630717) - INLINECODE8 : default topic id (e.g.
96)
Usage
CODEBLOCK0
Notes
- - Bot must be in the target group and have permission to post.
- If topic id is wrong, Telegram will return an error.
- This script only sends plain text; markdown/html parse mode is intentionally not enabled to reduce formatting failures.
Telegram 主题消息发送器
该技能将Telegram主题消息发送功能封装为可复用的脚本。
现在直接使用openclaw message send命令(无需机器人令牌环境变量)。
功能说明
- - 向Telegram超级群组主题(messagethreadid)发送消息
- 支持固定默认值(聊天/主题),日常使用只需一条命令
- 使用OpenClaw CLI的openclaw message send命令
脚本文件
- - 路径:scripts/send-topic-message.sh
所需环境变量
可选默认值
- - TGDEFAULTCHANNEL:默认频道(默认为telegram)
- TGDEFAULTCHATID:默认聊天ID(例如-1003574630717)
- TGDEFAULTTOPICID:默认主题ID(例如96)
使用方法
bash
1) 使用环境变量中的默认值(推荐)
export TG
DEFAULTCHANNEL=telegram
export TG
DEFAULTCHAT_ID=-1003574630717
export TG
DEFAULTTOPIC_ID=96
bash skills/telegram-topic-message-sender/scripts/send-topic-message.sh 测试消息
2) 调用时覆盖目标参数
bash skills/telegram-topic-message-sender/scripts/send-topic-message.sh \
--channel telegram \
--chat-id -1003574630717 \
--topic-id 96 \
部署完成,已上线 ✅
注意事项
- - 机器人必须已加入目标群组并拥有发帖权限。
- 如果主题ID错误,Telegram将返回错误信息。
- 此脚本仅发送纯文本;有意未启用Markdown/HTML解析模式,以减少格式错误。