telegram.error module
This module contains an object that represents Telegram errors.
- exception telegram.error.BadRequest(message)
Bases:
NetworkError
Raised when Telegram could not process the request correctly.
- exception telegram.error.ChatMigrated(new_chat_id)
Bases:
TelegramError
Raised when the requested group chat migrated to supergroup and has a new chat id.
- Parameters:
new_chat_id (
int
) – The new chat id of the group.
- new_chat_id
- exception telegram.error.Conflict(message)
Bases:
TelegramError
Raised when a long poll or webhook conflicts with another one.
- exception telegram.error.InvalidToken
Bases:
TelegramError
Raised when the token is invalid.
- exception telegram.error.NetworkError(message)
Bases:
TelegramError
Base class for exceptions due to networking errors.
- exception telegram.error.RetryAfter(retry_after)
Bases:
TelegramError
Raised when flood limits where exceeded.
- Parameters:
retry_after (
int
) – Time in seconds, after which the bot can retry the request.
- retry_after
- exception telegram.error.TelegramError(message)
Bases:
Exception
Base class for Telegram errors.
- message
- exception telegram.error.TimedOut
Bases:
NetworkError
Raised when a request took too long to finish.
- exception telegram.error.Unauthorized(message)
Bases:
TelegramError
Raised when the bot has not enough rights to perform the requested action.