Skip to content

Latest commit

History

59 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Telegram Bot API errors

Introduction

This is a non-official list of actual errors you can encounter while developing your bot using the Telegram Bot API.

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.

If you want to contribute, ensure to include:

  • The actual json output
  • Optional textual description
  • Whether there is interaction needed from the developer
  • What method did create the error

The error list

This is the actual list that has been composed so far. Feel free to add more.

JSONHuman DescriptionAction needed?Methods raising
Bad Request: BUTTON_URL_INVALIDInvalid URL format in inline keyboard buttonCorrect the URL format or protocolsendMessage, editMessageText
Bad Request: chat not foundThe chat is unknown to the bot.Double check the provided chat_idany
Bad Request: entities too longToo many formatting entities in message (9500 char limit for markdown)Reduce number of formatted entities or split messagesendMessage, editMessageText
Bad Request: file is too bigFile size exceeds the allowed limit (20MB for bots)Reduce file size or split into smaller partssendDocument, sendPhoto, sendVideo
Bad Request: group is deactivatedTarget group has been deactivatedRemove chat_id from bot databasesendMessage
Bad Request: Group migrated to supergroupOccurs when a group chat has been converted/migrated to a supergroupCheck the provided chat_id and make sure the new Super Group ID is passedsendMessage
Bad Request: Invalid file idThe file id you are trying to retrieve doesn't existTry to call getFile before downloadinggetFile
Bad Request: member not foundThe specified user is not a member of the target chatEnsure the user is in the chat and has interacted with the botgetChatMember, banChatMember, getChatAdministrators
Bad Request: message can't be deletedInsufficient permissions to delete messageCheck bot permissions and message age (48h limit)deleteMessage
Bad Request: message can't be editedThe message text cannot be editedCheck is message belong to chat or is message exist in chateditMessageText
Bad Request: Message not modifiedThe current and new message text and reply markups are the sameActually chanange the text or reply markup of the message to be editededitMessageText
Bad Request: message text is emptyThe message text is empty or not providedProvide a valid message textsendMessage, editMessageText
Bad Request: message to delete not foundMessage with specified ID doesn't existVerify message ID exists in chatdeleteMessage
Bad Request: message to edit not foundThe message for editing has been deleted or is unavailableVerify the existence of the message and bot rightseditMessageText, editMessageCaption
Bad Request: not enough rights to send photos to the chatBot lacks permission to send photosGrant appropriate permissions to botsendPhoto
Bad Request: not enough rights to send text messages to the chatBot lacks permission to send text messagesGrant appropriate permissions to botsendMessage
Bad Request: PEER_ID_INVALIDInvalid chat/user ID. It often occurs when the bot has not seen the user in a group or private chat-sendMessage, getChat
Bad Request: reply message not foundMessage being replied to doesn't existRemove reply_to_message_id or verify message existssendMessage
Bad Request: user not foundUser_id is incorrectCorrect user_idany
Bad Request: Wrong parameter action in requestOccurs when the action property value is invalidProvide a valid value to the action property as specified in the documentationsendChatAction
Conflict: can't use getUpdates method while webhook is active; use deleteWebhook to delete the webhook firstYou are trying to use getUpdates while a webhook is activeUse deleteWebhook to delete the webhook firstgetUpdates
Conflict: Terminated by other long pollYou have already set up a webhook and are trying to get the updates via getUpdatesDo not use getUpdatesgetUpdates
Forbidden: bot blocked by userThe user have blocked the botany
Forbidden: bot can't initiate conversation with a userUser must start conversation with bot firstWait for user to start the botsendMessage
Forbidden: bot can't send messages to botsYou tried to send a message to another bot. This is not possiblesendMessage
Forbidden: bot is not a member of the channel chatBot is not a member of the channelAdd bot to the channelsendMessage, deleteMessage
Forbidden: bot is not a member of the supergroup chatBot is not a member of the supergroupAdd bot to the supergroupsendMessage, getChatAdministrators
Forbidden: bot was kickedBot was kickedDelete chat_id on your sidesendMessage
Forbidden: user is deactivatedYou're trying to perform an action on a user account that has been deactivated or deletedDouble check the user IsendMessage
Too many requestsYou are hitting the API limit, more information heresendMessage
UnauthorizedBot token is incorrectCorrect your bot token and try againany

About

A list of errorcodes and their meaning

Resources

Stars

40 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors