Skip to content

Telegram Bot API Reference

A developer-friendly reference for the Telegram Bot API, with GramIO TypeScript examples for every method.

Why not just use the official docs?

The official Telegram docs are complete but dense. This reference adds:

  • TypeScript types for every parameter and return value
  • GramIO-specific examples showing real usage patterns
  • Searchable from Google — find what you need faster

Methods

Methods are the actions your bot can perform — sending messages, answering queries, managing chats, and more.

Sending Messages

MethodDescription
sendMessageSend text messages
sendPhotoSend photos
sendDocumentSend files
sendVideoSend videos
sendAudioSend audio files
sendVoiceSend voice messages
sendAnimationSend GIF animations
sendStickerSend stickers
sendMediaGroupSend a group of media
sendLocationSend location
sendVenueSend a venue
sendContactSend a phone contact
sendPollSend a poll
sendDiceSend an animated emoji

Getting Updates

MethodDescription
getUpdatesReceive incoming updates via long polling
setWebhookSpecify a URL to receive incoming updates
deleteWebhookRemove webhook integration
getWebhookInfoGet current webhook status

Bot Information

MethodDescription
getMeGet basic info about the bot
logOutLog out from the cloud Bot API server
closeClose the bot instance

Editing Messages

MethodDescription
editMessageTextEdit text of a sent message
editMessageCaptionEdit caption of a media message
editMessageMediaEdit animation, audio, document, photo, or video
editMessageReplyMarkupEdit reply markup of a message
deleteMessageDelete a message
deleteMessagesDelete multiple messages
copyMessageCopy a message
forwardMessageForward a message

Chat Management

MethodDescription
getChatGet info about a chat
getChatMemberGet info about a chat member
getChatMemberCountGet the number of members in a chat
banChatMemberBan a user in a chat
unbanChatMemberUnban a previously banned user
restrictChatMemberRestrict a user in a chat
promoteChatMemberPromote or demote a user in a chat
leaveChatBot leaves a group, supergroup, or channel
pinChatMessagePin a message in a chat
unpinChatMessageUnpin a message in a chat

Inline & Callback Queries

MethodDescription
answerCallbackQuerySend a response to a callback query
answerInlineQuerySend results for an inline query
answerWebAppQuerySet result of an interaction with a Web App

Commands & Menu

MethodDescription
setMyCommandsSet the list of bot commands
getMyCommandsGet the current list of bot commands
deleteMyCommandsDelete bot commands
setChatMenuButtonChange the bot's menu button

Types

Types describe the shape of data returned by the API and used as parameters.

Core Objects

TypeDescription
MessageRepresents a message
UserRepresents a Telegram user or bot
ChatRepresents a chat
UpdateRepresents an incoming update
MessageEntitySpecial entity in a text message

Media Types

TypeDescription
PhotoSizeRepresents a photo or thumbnail
DocumentRepresents a general file
VideoRepresents a video file
AudioRepresents an audio file
VoiceRepresents a voice note
StickerRepresents a sticker
AnimationRepresents an animation file

Keyboards

TypeDescription
InlineKeyboardMarkupInline keyboard
InlineKeyboardButtonButton on an inline keyboard
ReplyKeyboardMarkupCustom keyboard with reply options
KeyboardButtonButton on a reply keyboard
ReplyKeyboardRemoveRemove the reply keyboard
ForceReplyForce a reply from the user

Auto-generated

This reference is generated from the Telegram Bot API schema (v9.0, April 2025). GramIO usage examples are maintained manually.