telegram

Interact with Telegram Bot API: send messages/photos/files/videos/audio/stickers/polls to any chat/group/channel, manage groups (pin/unpin/ban/kick/promote/restrict/set title/description/photo), forward/copy/delete/edit messages, react to messages, create invite links, manage forum topics, inline keyboards, and more. Use for ANY Telegram operation.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "telegram" with this command: npx skills add ninehills/skills/ninehills-skills-telegram

Telegram Bot API Skill

You have full access to the Telegram Bot API. Use CLI commands for common operations, and direct API calls for everything else.

Getting the Bot Token

BOT_TOKEN=$(curl -s http://localhost:23001/api/settings | jq -r '.telegram.botToken')

API Call Pattern

# JSON body (most methods)
curl -s "https://api.telegram.org/bot${BOT_TOKEN}/<METHOD>" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

# Multipart form (file uploads)
curl -s "https://api.telegram.org/bot${BOT_TOKEN}/<METHOD>" \
  -F "chat_id=<CHAT_ID>" \
  -F "photo=@/path/to/file.jpg" \
  -F "caption=optional caption"

Full API docs: https://core.telegram.org/bots/api


CLI Quick Commands

# Current chat (ALMA_CHAT_ID auto-set)
alma send photo /path/to/img.jpg "caption"
alma send file /path/to/doc.pdf "caption"
alma send audio /path/to/song.mp3
alma send video /path/to/vid.mp4

# Group operations
alma group list
alma group send <chatId> "text"
alma group send-photo <chatId> /path "caption"
alma group send-document <chatId> /path "caption"
alma group send-video <chatId> /path "caption"
alma group history <chatId> [limit]
alma group search <chatId> "query"
alma group context <chatId>
alma group pin <chatId> <msgId>
alma group unpin <chatId> [msgId]
alma group leave <chatId>
alma group patrol

# Direct message & message mgmt
alma dm <userId> "message"
alma msg delete <chatId> <msgId>
alma msg react <chatId> <msgId> <emoji>   # Add reaction to a message (e.g. ❤️ 😂 👍)
alma msg sticker <chatId> <sticker_file_id>  # Send a sticker (use file_id from received stickers)
alma msg sticker-search [set_name]          # List sticker sets (no args) or index a specific set
alma msg sticker-find <emoji>               # Find stickers by emoji across all indexed sets

All Telegram Bot API Methods

Sending Messages

MethodDescription
sendMessageSend text message. Params: chat_id, text, parse_mode (HTML/Markdown), reply_parameters, reply_markup, message_thread_id, link_preview_options
sendPhotoSend photo. chat_id, photo (file_id/URL/upload), caption, has_spoiler
sendDocumentSend file. chat_id, document, caption, thumbnail
sendVideoSend video. chat_id, video, caption, duration, width, height, has_spoiler
sendAnimationSend GIF. chat_id, animation, caption, has_spoiler
sendAudioSend audio. chat_id, audio, caption, duration, performer, title
sendVoiceSend voice message. chat_id, voice, caption, duration
sendVideoNoteSend round video. chat_id, video_note, duration, length
sendStickerSend sticker. chat_id, sticker (file_id/URL/upload)
sendLocationSend location. chat_id, latitude, longitude, live_period
sendVenueSend venue. chat_id, latitude, longitude, title, address
sendContactSend contact. chat_id, phone_number, first_name, last_name
sendPollSend poll. chat_id, question, options ([{text:...}]), is_anonymous, type (quiz/regular), allows_multiple_answers
sendDiceSend dice/slot. chat_id, emoji (🎲🎯🏀⚽🎳🎰)
sendMediaGroupSend album (2-10 items). chat_id, media ([{type,media,caption}])
sendChatActionShow typing/uploading status. chat_id, action (typing/upload_photo/upload_video/upload_document/record_voice/record_video/etc)
sendMessageDraftStream partial message. chat_id, text, business_connection_id

Forwarding & Copying

MethodDescription
forwardMessageForward message. chat_id (target), from_chat_id, message_id
forwardMessagesForward multiple. chat_id, from_chat_id, message_ids ([array])
copyMessageCopy without "Forwarded" header. chat_id, from_chat_id, message_id, caption
copyMessagesCopy multiple. chat_id, from_chat_id, message_ids

Editing Messages

MethodDescription
editMessageTextEdit text. chat_id, message_id, text, parse_mode, reply_markup
editMessageCaptionEdit caption. chat_id, message_id, caption
editMessageMediaEdit media. chat_id, message_id, media
editMessageReplyMarkupEdit inline keyboard. chat_id, message_id, reply_markup
editMessageLiveLocationUpdate live location. chat_id, message_id, latitude, longitude
stopMessageLiveLocationStop live location. chat_id, message_id
deleteMessageDelete message. chat_id, message_id
deleteMessagesDelete multiple. chat_id, message_ids ([array])

Reactions

MethodDescription
setMessageReactionReact to message. chat_id, message_id, reaction ([{"type":"emoji","emoji":"👍"}]), is_big

Chat Management

MethodDescription
getChatGet chat info. chat_id
getChatMemberCountMember count. chat_id
getChatMemberGet one member's info. chat_id, user_id
getChatAdministratorsList admins. chat_id
setChatTitleSet title. chat_id, title
setChatDescriptionSet description. chat_id, description
setChatPhotoSet photo. chat_id, photo (upload)
deleteChatPhotoDelete photo. chat_id
setChatPermissionsSet default permissions. chat_id, permissions ({can_send_messages, can_send_photos, ...})
setChatStickerSetSet sticker set. chat_id, sticker_set_name
deleteChatStickerSetRemove sticker set. chat_id
leaveChatLeave chat. chat_id
pinChatMessagePin message. chat_id, message_id, disable_notification
unpinChatMessageUnpin message. chat_id, message_id
unpinAllChatMessagesUnpin all. chat_id

Member Management

MethodDescription
banChatMemberBan user. chat_id, user_id, until_date, revoke_messages
unbanChatMemberUnban user. chat_id, user_id, only_if_banned
restrictChatMemberRestrict user. chat_id, user_id, permissions, until_date
promoteChatMemberPromote to admin. chat_id, user_id, can_change_info, can_post_messages, can_edit_messages, can_delete_messages, can_invite_users, can_restrict_members, can_pin_messages, can_promote_members, can_manage_video_chats, can_manage_chat
setChatAdministratorCustomTitleSet admin title. chat_id, user_id, custom_title
approveChatJoinRequestApprove join request. chat_id, user_id
declineChatJoinRequestDecline join request. chat_id, user_id

Invite Links

MethodDescription
exportChatInviteLinkCreate new primary link. chat_id
createChatInviteLinkCreate invite link. chat_id, name, expire_date, member_limit, creates_join_request
editChatInviteLinkEdit invite link. chat_id, invite_link, ...
revokeChatInviteLinkRevoke link. chat_id, invite_link
createChatSubscriptionInviteLinkPaid subscription link. chat_id, subscription_period, subscription_price

Forum Topics

MethodDescription
createForumTopicCreate topic. chat_id, name, icon_color, icon_custom_emoji_id
editForumTopicEdit topic. chat_id, message_thread_id, name, icon_custom_emoji_id
closeForumTopicClose topic. chat_id, message_thread_id
reopenForumTopicReopen topic. chat_id, message_thread_id
deleteForumTopicDelete topic. chat_id, message_thread_id
unpinAllForumTopicMessagesUnpin all in topic. chat_id, message_thread_id
getForumTopicIconStickersGet available topic icons
editGeneralForumTopicEdit General topic. chat_id, name
closeGeneralForumTopicClose General. chat_id
reopenGeneralForumTopicReopen General. chat_id
hideGeneralForumTopicHide General. chat_id
unhideGeneralForumTopicUnhide General. chat_id

Bot Profile

MethodDescription
getMeGet bot info
setMyNameSet bot name. name, language_code
getMyNameGet bot name
setMyDescriptionSet bot description. description, language_code
getMyDescriptionGet bot description
setMyShortDescriptionSet short description. short_description
getMyShortDescriptionGet short description
setMyProfilePhotoSet bot profile photo. photo
removeMyProfilePhotoRemove bot profile photo
setMyCommandsSet command list. commands ([{command,description}]), scope, language_code
getMyCommandsGet commands
deleteMyCommandsDelete commands
setChatMenuButtonSet menu button. chat_id, menu_button
getChatMenuButtonGet menu button
setMyDefaultAdministratorRightsSet default admin rights. rights, for_channels
getMyDefaultAdministratorRightsGet default admin rights

User Info

MethodDescription
getUserProfilePhotosGet profile photos. user_id, offset, limit
getUserProfileAudiosGet profile audios. user_id

Files

MethodDescription
getFileGet file download info. file_id. Download: https://api.telegram.org/file/bot<TOKEN>/<file_path>

Inline Keyboards & Callbacks

// reply_markup for inline buttons
{
  "inline_keyboard": [
    [{"text": "Button 1", "callback_data": "btn1"}, {"text": "URL", "url": "https://example.com"}],
    [{"text": "Row 2", "callback_data": "btn2"}]
  ]
}
MethodDescription
answerCallbackQueryAnswer callback from inline button. callback_query_id, text, show_alert

Stickers

MethodDescription
sendStickerSend sticker. chat_id, sticker
getStickerSetGet sticker set. name
getCustomEmojiStickersGet custom emoji. custom_emoji_ids
createNewStickerSetCreate sticker set. user_id, name, title, stickers
addStickerToSetAdd sticker. user_id, name, sticker
setStickerPositionInSetReorder. sticker, position
deleteStickerFromSetDelete sticker. sticker
setStickerSetTitleSet title. name, title
setStickerSetThumbnailSet thumbnail. name, user_id, thumbnail

Payments

MethodDescription
sendInvoiceSend invoice. chat_id, title, description, payload, currency, prices
createInvoiceLinkCreate payment link
answerShippingQueryAnswer shipping. shipping_query_id, ok, shipping_options
answerPreCheckoutQueryAnswer checkout. pre_checkout_query_id, ok
refundStarPaymentRefund stars. user_id, telegram_payment_charge_id

Games

MethodDescription
sendGameSend game. chat_id, game_short_name
setGameScoreSet score. user_id, score, chat_id, message_id
getGameHighScoresGet scores. user_id, chat_id, message_id

Common Examples

Post to a channel

curl -s "https://api.telegram.org/bot${BOT_TOKEN}/sendMessage" \
  -H "Content-Type: application/json" \
  -d '{"chat_id": "@channel_username", "text": "Hello!"}'

Send photo with inline keyboard

curl -s "https://api.telegram.org/bot${BOT_TOKEN}/sendPhoto" \
  -H "Content-Type: application/json" \
  -d '{
    "chat_id": "'$ALMA_CHAT_ID'",
    "photo": "https://example.com/image.jpg",
    "caption": "Check this out!",
    "reply_markup": {"inline_keyboard": [[{"text":"👍 Like","callback_data":"like"},{"text":"👎","callback_data":"dislike"}]]}
  }'

Forward message between chats

curl -s "https://api.telegram.org/bot${BOT_TOKEN}/forwardMessage" \
  -H "Content-Type: application/json" \
  -d '{"chat_id": "<TARGET>", "from_chat_id": "<SOURCE>", "message_id": 123}'

Create a poll

curl -s "https://api.telegram.org/bot${BOT_TOKEN}/sendPoll" \
  -H "Content-Type: application/json" \
  -d '{"chat_id": "'$ALMA_CHAT_ID'", "question": "Best language?", "options": [{"text":"Rust"},{"text":"TypeScript"},{"text":"Python"}], "is_anonymous": false}'

Reply to a specific message

curl -s "https://api.telegram.org/bot${BOT_TOKEN}/sendMessage" \
  -H "Content-Type: application/json" \
  -d '{"chat_id": "'$ALMA_CHAT_ID'", "text": "Replying!", "reply_parameters": {"message_id": 5678}}'

Promote user to admin

curl -s "https://api.telegram.org/bot${BOT_TOKEN}/promoteChatMember" \
  -H "Content-Type: application/json" \
  -d '{"chat_id": "<GROUP>", "user_id": 12345, "can_pin_messages": true, "can_invite_users": true}'

Upload and send a local file

curl -s "https://api.telegram.org/bot${BOT_TOKEN}/sendDocument" \
  -F "chat_id=$ALMA_CHAT_ID" \
  -F "document=@/path/to/file.pdf" \
  -F "caption=Here's the document"

Send album (media group)

curl -s "https://api.telegram.org/bot${BOT_TOKEN}/sendMediaGroup" \
  -H "Content-Type: application/json" \
  -d '{"chat_id": "'$ALMA_CHAT_ID'", "media": [
    {"type":"photo","media":"https://example.com/1.jpg","caption":"First"},
    {"type":"photo","media":"https://example.com/2.jpg"}
  ]}'

Create invite link

curl -s "https://api.telegram.org/bot${BOT_TOKEN}/createChatInviteLink" \
  -H "Content-Type: application/json" \
  -d '{"chat_id": "<GROUP>", "name": "My Link", "member_limit": 100}'

Tips

  • Channel posts: Use @channel_username or numeric chat_id (starts with -100)
  • Bot must be admin to: post to channels, pin, delete others' messages, ban, manage topics
  • ALMA_CHAT_ID is auto-set in Bash tool env — use it for current chat
  • File uploads: Use -F multipart form, not -d JSON
  • parse_mode: Use "HTML" for <b>bold</b> <i>italic</i> <code>code</code> <a href="url">link</a>
  • Group IDs are negative; user IDs are positive
  • Message IDs are visible as [msg:xxx] in chat
  • For methods not listed here, check https://core.telegram.org/bots/api

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Automation

scheduler

No summary provided by upstream source.

Repository SourceNeeds Review
Automation

agent-browser

No summary provided by upstream source.

Repository SourceNeeds Review
Automation

coding-agent

No summary provided by upstream source.

Repository SourceNeeds Review
General

self-reflection

No summary provided by upstream source.

Repository SourceNeeds Review