Riferimento errori TelegramGuida completa alla risoluzione dei problemi con soluzioni

Comprehensive reference for Telegram Bot API errors. Find solutions and troubleshoot common integration issues.

16 codici di errore
5 categorie
Bot API

Categorie di Errori

Authentication

3 errors

Chat

3 errors

Rate Limiting

3 errors

Media

4 errors

Content

3 errors

Tutti i Codici di Errore

#Authentication

bot_blockedrefresh-token

The bot was blocked by the user or removed from the chat.

Soluzione:

The user has blocked your bot or removed it from the channel/group. Ask the user to unblock the bot or add it back as an administrator.

bot_kickedrefresh-token

The bot was kicked from the chat.

Soluzione:

Your bot was removed from this channel or group. The bot needs to be re-added as an administrator with posting permissions.

unauthorizedrefresh-token

Bot token is invalid or expired.

Soluzione:

The bot token is no longer valid. This could happen if the token was regenerated in BotFather. Reconnect your Telegram account.

#Chat

chat_not_founduser-error

The specified chat does not exist or the bot is not a member.

Soluzione:

The channel or group ID is invalid or the bot is not a member. Verify the chat ID is correct and the bot has been added as an administrator.

chat_write_forbiddenuser-error

The bot does not have permission to send messages in this chat.

Soluzione:

The bot lacks posting permissions in this channel/group. Ensure the bot is an administrator with 'Post Messages' permission enabled.

not_enough_rightsuser-error

The bot does not have sufficient admin rights.

Soluzione:

The bot needs additional admin permissions. Check that the bot has rights to post messages, send media, and any other required permissions.

#Rate Limiting

flood_controlretry

Too many requests. Telegram's flood control limit reached.

Soluzione:

You've exceeded Telegram's rate limits. Wait for the specified retry_after seconds before sending more messages. Late handles this automatically with queuing.

too_many_requestsretry

Rate limit exceeded. Please slow down.

Soluzione:

Too many API calls in a short period. Telegram limits are approximately 30 messages per second to different chats. Implement proper rate limiting.

retry_afterretry

Rate limited. Must wait before sending more messages.

Soluzione:

Telegram is enforcing a cooldown period. Wait for the specified duration before retrying. Late automatically handles this with exponential backoff.

#Media

file_too_largeuser-error

The file is too large to upload.

Soluzione:

Telegram has file size limits: photos up to 10MB, documents up to 50MB, videos up to 50MB. Compress your file or use a smaller version.

wrong_file_typeuser-error

The file type is not supported or the file is corrupted.

Soluzione:

Ensure your file is in a supported format (JPEG, PNG for images; MP4 for videos). Re-export the file and try again.

photo_invaliduser-error

The photo could not be processed.

Soluzione:

The image file is corrupted or in an unsupported format. Use JPEG or PNG format and ensure the image is not corrupted.

video_invaliduser-error

The video could not be processed.

Soluzione:

The video file is corrupted or uses an unsupported codec. Convert to MP4 with H.264 codec and AAC audio.

#Content

message_too_longuser-error

The message text exceeds the maximum length (4096 characters).

Soluzione:

Telegram messages are limited to 4096 characters. Shorten your message or split it into multiple messages.

caption_too_longuser-error

The media caption exceeds the maximum length (1024 characters).

Soluzione:

Media captions are limited to 1024 characters. Use a shorter caption or send the additional text as a separate message.

media_group_invaliduser-error

Invalid media group. Albums must contain 2-10 items of the same type.

Soluzione:

Media albums require 2-10 photos or videos. Ensure all items are the same type (all photos or all videos) and within the count limit.

Migliori Pratiche

Gestione degli Errori

  • Implement automatic retries for flood control and rate limit errors
  • Handle bot_blocked errors gracefully and notify users to reconnect
  • Log all errors with chat IDs for debugging
  • Show user-friendly error messages in your UI

Suggerimenti per la Prevenzione

  • Verify bot permissions before sending messages
  • Compress images and videos before upload
  • Implement rate limiting (max 30 messages/second)
  • Always check message length before sending

Hai Bisogno di Aiuto per Telegram l'Integrazione?

La nostra API gestisce automaticamente gli scenari di errore con logica di riprova intelligente e registrazione dettagliata.