Loading...
Loading...
Publish to your Telegram channel/group via a bot using the official Telegram Bot API — send text or photo posts, edit and delete messages, and verify the bot's access to a chat. Use when the user wants to broadcast to a Telegram channel/group with a bot token (BotFather), cross-post an article, or manage the bot's posts. Distinct from the personal-account Telegram connector.
npx skill4agent add acedatacloud/skills telegram-botcurl + jq$TELEGRAMBOT_BOT_TOKEN$TELEGRAMBOT_CHAT_ID@your_channelhttps://api.telegram.org/bot$TELEGRAMBOT_BOT_TOKEN/<METHOD>{"ok":true,"result":...}{"ok":false,"error_code":<n>,"description":"<msg>"}.okdescription401 Unauthorized400 Bad Request: chat not found403 Forbidden: bot is not a member of the channel chat... need administrator rights429parameters.retry_afterchat_id@channelusername-1001234567890getChatBOT="https://api.telegram.org/bot$TELEGRAMBOT_BOT_TOKEN"
curl -sS "$BOT/getMe" | jq '{ok, bot: .result.username, name: .result.first_name}'
# confirm the bot can post to the target chat (must be admin in the channel):
CHAT="${TELEGRAMBOT_CHAT_ID:-@your_channel}"
curl -sS -G "$BOT/getChat" --data-urlencode "chat_id=$CHAT" \
| jq '{ok, type: .result.type, title: .result.title, error: .description}'parse_mode=HTMLMarkdownV2CHAT="${TELEGRAMBOT_CHAT_ID:-@your_channel}"
curl -sS -G "$BOT/sendMessage" \
--data-urlencode "chat_id=$CHAT" \
--data-urlencode "text=<b>Hello</b> from the bot 👋 #ai" \
--data-urlencode "parse_mode=HTML" \
--data-urlencode "disable_web_page_preview=false" \
| jq '{ok, message_id: .result.message_id, error: .description}'https://t.me/<channelusername>/<message_id><b> <i> <u> <s> <a href> <code> <pre> <blockquote>< > &< > &_ * [ ] ( ) ~ \withtext--data-urlencodeCHAT="${TELEGRAMBOT_CHAT_ID:-@your_channel}"
curl -sS -G "$BOT/sendPhoto" \
--data-urlencode "chat_id=$CHAT" \
--data-urlencode "photo=https://cdn.example.com/pic.jpg" \
--data-urlencode "caption=<b>Caption</b> text" \
--data-urlencode "parse_mode=HTML" \
| jq '{ok, message_id: .result.message_id, error: .description}'photofile_idsendMediaGroup# edit text (same chat_id + message_id)
curl -sS -G "$BOT/editMessageText" \
--data-urlencode "chat_id=$CHAT" --data-urlencode "message_id=123" \
--data-urlencode "text=Updated text" --data-urlencode "parse_mode=HTML" \
| jq '{ok, error: .description}'
# delete a message
curl -sS -G "$BOT/deleteMessage" \
--data-urlencode "chat_id=$CHAT" --data-urlencode "message_id=123" \
| jq '{ok, error: .description}'deleteMessagecan_delete_messages403getChat-100...@username429parameters.retry_aftertelegram