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
| Method | Description |
|---|---|
| sendMessage | Send text messages |
| sendPhoto | Send photos |
| sendDocument | Send files |
| sendVideo | Send videos |
| sendAudio | Send audio files |
| sendVoice | Send voice messages |
| sendAnimation | Send GIF animations |
| sendSticker | Send stickers |
| sendMediaGroup | Send a group of media |
| sendLocation | Send location |
| sendVenue | Send a venue |
| sendContact | Send a phone contact |
| sendPoll | Send a poll |
| sendDice | Send an animated emoji |
Getting Updates
| Method | Description |
|---|---|
| getUpdates | Receive incoming updates via long polling |
| setWebhook | Specify a URL to receive incoming updates |
| deleteWebhook | Remove webhook integration |
| getWebhookInfo | Get current webhook status |
Bot Information
| Method | Description |
|---|---|
| getMe | Get basic info about the bot |
| logOut | Log out from the cloud Bot API server |
| close | Close the bot instance |
Editing Messages
| Method | Description |
|---|---|
| editMessageText | Edit text of a sent message |
| editMessageCaption | Edit caption of a media message |
| editMessageMedia | Edit animation, audio, document, photo, or video |
| editMessageReplyMarkup | Edit reply markup of a message |
| deleteMessage | Delete a message |
| deleteMessages | Delete multiple messages |
| copyMessage | Copy a message |
| forwardMessage | Forward a message |
Chat Management
| Method | Description |
|---|---|
| getChat | Get info about a chat |
| getChatMember | Get info about a chat member |
| getChatMemberCount | Get the number of members in a chat |
| banChatMember | Ban a user in a chat |
| unbanChatMember | Unban a previously banned user |
| restrictChatMember | Restrict a user in a chat |
| promoteChatMember | Promote or demote a user in a chat |
| leaveChat | Bot leaves a group, supergroup, or channel |
| pinChatMessage | Pin a message in a chat |
| unpinChatMessage | Unpin a message in a chat |
Inline & Callback Queries
| Method | Description |
|---|---|
| answerCallbackQuery | Send a response to a callback query |
| answerInlineQuery | Send results for an inline query |
| answerWebAppQuery | Set result of an interaction with a Web App |
Commands & Menu
| Method | Description |
|---|---|
| setMyCommands | Set the list of bot commands |
| getMyCommands | Get the current list of bot commands |
| deleteMyCommands | Delete bot commands |
| setChatMenuButton | Change the bot's menu button |
Types
Types describe the shape of data returned by the API and used as parameters.
Core Objects
| Type | Description |
|---|---|
| Message | Represents a message |
| User | Represents a Telegram user or bot |
| Chat | Represents a chat |
| Update | Represents an incoming update |
| MessageEntity | Special entity in a text message |
Media Types
| Type | Description |
|---|---|
| PhotoSize | Represents a photo or thumbnail |
| Document | Represents a general file |
| Video | Represents a video file |
| Audio | Represents an audio file |
| Voice | Represents a voice note |
| Sticker | Represents a sticker |
| Animation | Represents an animation file |
Keyboards
| Type | Description |
|---|---|
| InlineKeyboardMarkup | Inline keyboard |
| InlineKeyboardButton | Button on an inline keyboard |
| ReplyKeyboardMarkup | Custom keyboard with reply options |
| KeyboardButton | Button on a reply keyboard |
| ReplyKeyboardRemove | Remove the reply keyboard |
| ForceReply | Force 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.