├── README.md └── json ├── bad-request-button-url-invalid.json ├── bad-request-chat-not-found.json ├── bad-request-entities-too-long.json ├── bad-request-file-too-big.json ├── bad-request-group-chat-migrated.json ├── bad-request-group-deactivated.json ├── bad-request-invalid-file-id.json ├── bad-request-member-not-found.json ├── bad-request-message-cant-be-deleted.json ├── bad-request-message-cant-be-edited.json ├── bad-request-message-not-modified.json ├── bad-request-message-text-is-empty.json ├── bad-request-message-to-delete-not-found.json ├── bad-request-message-to-edit-not-found.json ├── bad-request-not-enough-rights-photos.json ├── bad-request-not-enough-rights-text.json ├── bad-request-peer-id-invalid.json ├── bad-request-reply-message-not-found.json ├── bad-request-user-not-found.json ├── bad-request-wrong-parameter-action-in-request.json ├── conflicted-terminated-by-other-long-poll.json ├── forbidden-bot-blocked-by-user.json ├── forbidden-bot-cant-send-messages-to-bots.json ├── forbidden-bot-not-member-channel.json ├── forbidden-bot-not-member-supergroup.json ├── forbidden-bot-was-kicked.json ├── forbidden-cant-initiate-conversation.json ├── forbidden-user-is-deactivated.json ├── too-many-requests.json ├── unauthorized.json └── webhook-is-active.json /README.md: -------------------------------------------------------------------------------- 1 | # Telegram Bot API errors 2 | 3 | ## Introduction 4 | This is a non-official list of actual errors you can encounter while developing your bot using the Telegram Bot API. 5 | 6 | The meaning, explanations, codes and other stuff in these errors may change at any given time, so don't trust too much on this list and use your common sense. 7 | 8 | If you want to contribute, ensure to include: 9 | - The actual json output 10 | - Optional textual description 11 | - Whether there is interaction needed from the developer 12 | - What method did create the error 13 | 14 | ## The error list 15 | 16 | This is the actual list that has been composed so far. Feel free to add more. 17 | 18 | | JSON | Human Description| Action needed? | Methods raising | 19 | |--------------|------------------|-------------------|:---------------:| 20 | |[Bad Request: BUTTON_URL_INVALID](json/bad-request-button-url-invalid.json)|Invalid URL format in inline keyboard button|Correct the URL format or protocol|sendMessage, editMessageText| 21 | |[Bad Request: chat not found](json/bad-request-chat-not-found.json )|The chat is unknown to the bot.| Double check the provided `chat_id`|any| 22 | |[Bad Request: entities too long](json/bad-request-entities-too-long.json)|Too many formatting entities in message (9500 char limit for markdown)|Reduce number of formatted entities or split message|sendMessage, editMessageText| 23 | |[Bad Request: file is too big](json/bad-request-file-too-big.json)|File size exceeds the allowed limit (20MB for bots)|Reduce file size or split into smaller parts|sendDocument, sendPhoto, sendVideo| 24 | |[Bad Request: group is deactivated](json/bad-request-group-deactivated.json)|Target group has been deactivated|Remove chat_id from bot database|sendMessage| 25 | |[Bad Request: Group migrated to supergroup](json/bad-request-group-chat-migrated.json)| Occurs when a group chat has been converted/migrated to a supergroup| Check the provided `chat_id` and make sure the new Super Group ID is passed |sendMessage| 26 | |[Bad Request: Invalid file id](json/bad-request-invalid-file-id.json)| The file id you are trying to retrieve doesn't exist|Try to call getFile before downloading|getFile| 27 | |[Bad Request: member not found](json/bad-request-member-not-found.json)|The specified user is not a member of the target chat|Ensure the user is in the chat and has interacted with the bot|getChatMember, banChatMember, getChatAdministrators| 28 | |[Bad Request: message can't be deleted](json/bad-request-message-cant-be-deleted.json)|Insufficient permissions to delete message|Check bot permissions and message age (48h limit)|deleteMessage| 29 | | [Bad Request: message can't be edited](json/bad-request-message-cant-be-edited.json) | The message text cannot be edited | Check is message belong to chat or is message exist in chat | editMessageText | 30 | |[Bad Request: Message not modified](json/bad-request-message-not-modified.json)|The current and new message text and reply markups are the same| Actually chanange the text or reply markup of the message to be edited|editMessageText| 31 | | [Bad Request: message text is empty](json/bad-request-message-text-is-empty.json) | The message text is empty or not provided | Provide a valid message text | sendMessage, editMessageText | 32 | |[Bad Request: message to delete not found](json/bad-request-message-to-delete-not-found.json)|Message with specified ID doesn't exist|Verify message ID exists in chat|deleteMessage| 33 | |[Bad Request: message to edit not found](json/bad-request-message-to-edit-not-found.json)|The message for editing has been deleted or is unavailable|Verify the existence of the message and bot rights|editMessageText, editMessageCaption| 34 | |[Bad Request: not enough rights to send photos to the chat](json/bad-request-not-enough-rights-photos.json)|Bot lacks permission to send photos|Grant appropriate permissions to bot|sendPhoto| 35 | |[Bad Request: not enough rights to send text messages to the chat](json/bad-request-not-enough-rights-text.json)|Bot lacks permission to send text messages|Grant appropriate permissions to bot|sendMessage| 36 | |[Bad Request: PEER_ID_INVALID](json/bad-request-peer-id-invalid.json)|Invalid chat/user ID. It often occurs when the bot has not seen the user in a group or private chat|-|sendMessage, getChat| 37 | |[Bad Request: reply message not found](json/bad-request-reply-message-not-found.json)|Message being replied to doesn't exist|Remove reply_to_message_id or verify message exists|sendMessage| 38 | |[Bad Request: user not found](json/bad-request-user-not-found.json)|User_id is incorrect|Correct user_id|any| 39 | |[Bad Request: Wrong parameter action in request](json/bad-request-wrong-parameter-action-in-request.json)| Occurs when the `action` property value is invalid | Provide a valid value to the `action` property as [specified in the documentation](https://core.telegram.org/bots/api#sendchataction) |sendChatAction| 40 | | [Conflict: can't use getUpdates method while webhook is active; use deleteWebhook to delete the webhook first](json/webhook-is-active.json) | You are trying to use getUpdates while a webhook is active | Use deleteWebhook to delete the webhook first | getUpdates | 41 | |[Conflict: Terminated by other long poll](json/conflicted-terminated-by-other-long-poll.json)|You have already set up a webhook and are trying to get the updates via getUpdates|Do not use getUpdates|getUpdates| 42 | |[Forbidden: bot blocked by user](json/forbidden-bot-blocked-by-user.json)| The user have blocked the bot ||any| 43 | |[Forbidden: bot can't initiate conversation with a user](json/forbidden-cant-initiate-conversation.json)|User must start conversation with bot first|Wait for user to start the bot|sendMessage| 44 | |[Forbidden: bot can't send messages to bots](json/forbidden-bot-cant-send-messages-to-bots.json)|You tried to send a message to another bot. This is not possible||sendMessage| 45 | |[Forbidden: bot is not a member of the channel chat](json/forbidden-bot-not-member-channel.json)|Bot is not a member of the channel|Add bot to the channel|sendMessage, deleteMessage| 46 | |[Forbidden: bot is not a member of the supergroup chat](json/forbidden-bot-not-member-supergroup.json)|Bot is not a member of the supergroup|Add bot to the supergroup|sendMessage, getChatAdministrators| 47 | |[Forbidden: bot was kicked](json/forbidden-bot-was-kicked.json)|Bot was kicked|Delete `chat_id` on your side|sendMessage| 48 | |[Forbidden: user is deactivated](json/forbidden-user-is-deactivated.json)|You're trying to perform an action on a user account that has been deactivated or deleted| Double check the user I|sendMessage| 49 | |[Too many requests](json/too-many-requests.json)|You are hitting the API limit, [more information here](https://core.telegram.org/bots/faq#my-bot-is-hitting-limits-how-do-i-avoid-this)||sendMessage| 50 | |[Unauthorized](json/unauthorized.json)|Bot token is incorrect|Correct your bot token and try again|any| -------------------------------------------------------------------------------- /json/bad-request-button-url-invalid.json: -------------------------------------------------------------------------------- 1 | { 2 | "ok": false, 3 | "error_code": 400, 4 | "description": "Bad Request: BUTTON_URL_INVALID" 5 | } -------------------------------------------------------------------------------- /json/bad-request-chat-not-found.json: -------------------------------------------------------------------------------- 1 | { 2 | "ok": false, 3 | "error_code": 400, 4 | "description": "Bad Request: chat not found" 5 | } 6 | -------------------------------------------------------------------------------- /json/bad-request-entities-too-long.json: -------------------------------------------------------------------------------- 1 | { 2 | "ok": false, 3 | "error_code": 400, 4 | "description": "Bad Request: entities too long" 5 | } -------------------------------------------------------------------------------- /json/bad-request-file-too-big.json: -------------------------------------------------------------------------------- 1 | { 2 | "ok": false, 3 | "error_code": 400, 4 | "description": "Bad Request: file is too big" 5 | } -------------------------------------------------------------------------------- /json/bad-request-group-chat-migrated.json: -------------------------------------------------------------------------------- 1 | { 2 | "ok": false, 3 | "error_code": 400, 4 | "description": "Bad Request: group chat was migrated to a supergroup chat", 5 | "parameters": { 6 | "migrate_to_chat_id": -123456789 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /json/bad-request-group-deactivated.json: -------------------------------------------------------------------------------- 1 | { 2 | "ok": false, 3 | "error_code": 400, 4 | "description": "Bad Request: group is deactivated" 5 | } -------------------------------------------------------------------------------- /json/bad-request-invalid-file-id.json: -------------------------------------------------------------------------------- 1 | { 2 | "ok": false, 3 | "error_code": 400, 4 | "description": "Bad Request: invalid file id" 5 | } 6 | -------------------------------------------------------------------------------- /json/bad-request-member-not-found.json: -------------------------------------------------------------------------------- 1 | { 2 | "ok": false, 3 | "error_code": 400, 4 | "description": "Bad Request: member not found" 5 | } -------------------------------------------------------------------------------- /json/bad-request-message-cant-be-deleted.json: -------------------------------------------------------------------------------- 1 | { 2 | "ok": false, 3 | "error_code": 400, 4 | "description": "Bad Request: message can't be deleted" 5 | } -------------------------------------------------------------------------------- /json/bad-request-message-cant-be-edited.json: -------------------------------------------------------------------------------- 1 | { 2 | "ok": false, 3 | "error_code": 400, 4 | "description": "Bad Request: message can't be edited" 5 | } 6 | -------------------------------------------------------------------------------- /json/bad-request-message-not-modified.json: -------------------------------------------------------------------------------- 1 | { 2 | "ok": false, 3 | "error_code": 400, 4 | "description": "Bad Request: message is not modified" 5 | } 6 | -------------------------------------------------------------------------------- /json/bad-request-message-text-is-empty.json: -------------------------------------------------------------------------------- 1 | { 2 | "ok": false, 3 | "error_code": 400, 4 | "description": "Bad Request: message text is empty" 5 | } 6 | -------------------------------------------------------------------------------- /json/bad-request-message-to-delete-not-found.json: -------------------------------------------------------------------------------- 1 | { 2 | "ok": false, 3 | "error_code": 400, 4 | "description": "Bad Request: message to delete not found" 5 | } -------------------------------------------------------------------------------- /json/bad-request-message-to-edit-not-found.json: -------------------------------------------------------------------------------- 1 | { 2 | "ok": false, 3 | "error_code": 400, 4 | "description": "Bad Request: message to edit not found" 5 | } -------------------------------------------------------------------------------- /json/bad-request-not-enough-rights-photos.json: -------------------------------------------------------------------------------- 1 | { 2 | "ok": false, 3 | "error_code": 400, 4 | "description": "Bad Request: not enough rights to send photos to the chat" 5 | } -------------------------------------------------------------------------------- /json/bad-request-not-enough-rights-text.json: -------------------------------------------------------------------------------- 1 | { 2 | "ok": false, 3 | "error_code": 400, 4 | "description": "Bad Request: not enough rights to send text messages to the chat" 5 | } -------------------------------------------------------------------------------- /json/bad-request-peer-id-invalid.json: -------------------------------------------------------------------------------- 1 | { 2 | "ok": false, 3 | "error_code": 400, 4 | "description": "Bad Request: PEER_ID_INVALID" 5 | } -------------------------------------------------------------------------------- /json/bad-request-reply-message-not-found.json: -------------------------------------------------------------------------------- 1 | { 2 | "ok": false, 3 | "error_code": 400, 4 | "description": "Bad Request: reply message not found" 5 | } -------------------------------------------------------------------------------- /json/bad-request-user-not-found.json: -------------------------------------------------------------------------------- 1 | { 2 | "ok": false, 3 | "error_code": 400, 4 | "description": "[Error]: Bad Request: user not found" 5 | } 6 | -------------------------------------------------------------------------------- /json/bad-request-wrong-parameter-action-in-request.json: -------------------------------------------------------------------------------- 1 | { 2 | "ok": false, 3 | "error_code": 400, 4 | "description": "Bad Request: wrong parameter action in request" 5 | } 6 | -------------------------------------------------------------------------------- /json/conflicted-terminated-by-other-long-poll.json: -------------------------------------------------------------------------------- 1 | { 2 | "ok": false, 3 | "error_code": 409, 4 | "description": "Conflict: terminated by other long poll or webhook" 5 | } 6 | -------------------------------------------------------------------------------- /json/forbidden-bot-blocked-by-user.json: -------------------------------------------------------------------------------- 1 | { 2 | "ok": false, 3 | "error_code": 403, 4 | "description": "Forbidden: bot was blocked by the user" 5 | } 6 | -------------------------------------------------------------------------------- /json/forbidden-bot-cant-send-messages-to-bots.json: -------------------------------------------------------------------------------- 1 | { 2 | "ok": false, 3 | "error_code": 403, 4 | "description": "Forbidden: bot can't send messages to bots" 5 | } 6 | -------------------------------------------------------------------------------- /json/forbidden-bot-not-member-channel.json: -------------------------------------------------------------------------------- 1 | { 2 | "ok": false, 3 | "error_code": 403, 4 | "description": "Forbidden: bot is not a member of the channel chat" 5 | } -------------------------------------------------------------------------------- /json/forbidden-bot-not-member-supergroup.json: -------------------------------------------------------------------------------- 1 | { 2 | "ok": false, 3 | "error_code": 403, 4 | "description": "Forbidden: bot is not a member of the supergroup chat" 5 | } -------------------------------------------------------------------------------- /json/forbidden-bot-was-kicked.json: -------------------------------------------------------------------------------- 1 | { 2 | "ok": false, 3 | "error_code": 403, 4 | "description": "Forbidden: bot was kicked from the group chat" 5 | } 6 | -------------------------------------------------------------------------------- /json/forbidden-cant-initiate-conversation.json: -------------------------------------------------------------------------------- 1 | { 2 | "ok": false, 3 | "error_code": 403, 4 | "description": "Forbidden: bot can't initiate conversation with a user" 5 | } -------------------------------------------------------------------------------- /json/forbidden-user-is-deactivated.json: -------------------------------------------------------------------------------- 1 | { 2 | "ok": false, 3 | "error_code": 403, 4 | "description": "Forbidden: user is deactivated" 5 | } 6 | -------------------------------------------------------------------------------- /json/too-many-requests.json: -------------------------------------------------------------------------------- 1 | { 2 | "ok": false, 3 | "error_code": 429, 4 | "description": "Too Many Requests: retry after X", 5 | "parameters": { "retry_after": 123 } 6 | } 7 | -------------------------------------------------------------------------------- /json/unauthorized.json: -------------------------------------------------------------------------------- 1 | { 2 | "ok": false, 3 | "error_code": 401, 4 | "description": "Unauthorized" 5 | } 6 | -------------------------------------------------------------------------------- /json/webhook-is-active.json: -------------------------------------------------------------------------------- 1 | { 2 | "ok": false, 3 | "error_code": 409, 4 | "description": "Conflict: can't use getUpdates method while webhook is active; use deleteWebhook to delete the webhook first" 5 | } 6 | --------------------------------------------------------------------------------