Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

Telegram

17 actions for messages, chats, files, media, search, and contacts. Uses MTProto (user impersonation) — you authenticate with your own Telegram account, not a bot.

Connection

Telegram uses phone-based authentication instead of OAuth. Click Connect on your dashboard and enter your phone number. Telegram sends a code to your app; enter it (and your 2FA password if enabled) to link your account.

Messages

send_message

ParameterTypeRequiredDescription
chatstringyesUsername (@user), phone (+1234567890), or chat ID
textstringyesMessage text
filestringnoURL or file path to attach (photo, document, video)
reply_tonumbernoMessage ID to reply to
exec("telegram.send_message", {
  chat: "@username",
  text: "Meeting confirmed for 3pm"
})

get_messages

ParameterTypeRequiredDescription
chatstringyesUsername, phone, or chat ID
limitnumbernoNumber of messages (default 20, max 100)
offset_idnumbernoGet messages before this message ID

search_messages

ParameterTypeRequiredDescription
querystringyesSearch query text
chatstringnoChat to search in (omit for global search)
limitnumbernoMax results (default 20, max 100)
exec("telegram.search_messages", {
  query: "meeting notes",
  limit: 10
})

edit_message

ParameterTypeRequiredDescription
chatstringyesChat where the message is
message_idnumberyesID of the message to edit
textstringyesNew message text

delete_messages

ParameterTypeRequiredDescription
chatstringyesChat where the messages are
message_idsarrayyesArray of message IDs to delete
revokebooleannoDelete for everyone (default true)

forward_messages

ParameterTypeRequiredDescription
from_chatstringyesSource chat
to_chatstringyesDestination chat
message_idsarrayyesArray of message IDs to forward

mark_read

ParameterTypeRequired
chatstringyes

Chats

get_dialogs

ParameterTypeRequiredDescription
limitnumbernoNumber of chats (default 30, max 100)
archivedbooleannoInclude archived chats

get_chat

ParameterTypeRequired
chatstringyes

get_participants

ParameterTypeRequiredDescription
chatstringyesGroup/channel username or ID
limitnumbernoMax participants (default 50)

Contacts

get_contacts

No parameters. Returns the user's full contact list.

resolve_username

ParameterTypeRequiredDescription
usernamestringyesUsername to resolve (with or without @)

Files

send_file

Send a file (photo, document, GIF, voice note, video) to a chat. Pass a URL via file or a Gateway file_id from gateway.upload_file.

ParameterTypeRequiredDescription
chatstringyesUsername, phone, or chat ID
filestringnoURL or file path to send
file_idstringnoGateway file ID (from gateway.upload_file)
captionstringnoCaption text (supports markdown)
force_documentbooleannoSend as document instead of auto-detecting
voice_notebooleannoSend as voice note
video_notebooleannoSend as round video note
reply_tonumbernoMessage ID to reply to

Either file or file_id is required.

# Send a photo via URL
exec("telegram.send_file", {
  chat: "@username",
  file: "https://example.com/photo.jpg",
  caption: "Check this out"
})
 
# Send a file from Gateway storage
exec("telegram.send_file", {
  chat: "@username",
  file_id: "abc123",
  caption: "Q1 report attached",
  force_document: true
})

send_gif

Search for a GIF and send it using the @gif inline bot.

ParameterTypeRequiredDescription
chatstringyesUsername, phone, or chat ID
querystringyesGIF search query
indexnumbernoWhich result to send (0-based, default 0)
exec("telegram.send_gif", {
  chat: "@username",
  query: "celebration"
})

download_media

Download media (photo, file, voice) from a message. Returns base64-encoded data with metadata. Max 10MB for base64 response.

ParameterTypeRequiredDescription
chatstringyesChat containing the message
message_idnumberyesMessage ID with media to download
exec("telegram.download_media", {
  chat: "@username",
  message_id: 123
})
# → { data: "base64...", filename: "photo.jpg", mimeType: "image/jpeg", size: "12345" }

send_sticker

Search for a sticker and send it using the @sticker inline bot.

ParameterTypeRequiredDescription
chatstringyesUsername, phone, or chat ID
querystringyesSticker search query or emoji
indexnumbernoWhich result to pick (0-based, default 0)

send_dice

Send an animated dice/emoji.

ParameterTypeRequiredDescription
chatstringyesUsername, phone, or chat ID
emojistringno🎲 🎯 🏀 ⚽ 🎰 🎳 (default 🎲)
exec("telegram.send_dice", { chat: "@channel", emoji: "🎯" })

Chat Identifiers

The chat parameter accepts multiple formats:

FormatExample
Username@username
Phone+1234567890
Numeric ID123456789