telegramlib.telegram_exceptions

Telegram Bot Library Exceptions Module

This module defines custom exception classes for the Telegram bot library. These exceptions are used to handle specific error conditions that may arise during the operation of the bot, providing more granular and meaningful error messages.

Details

All exceptions in this module derive from TelegramLibError, which in turn inherits from Python’s built-in Exception class. Each custom exception provides context-specific error handling, enabling the bot to communicate precise issues to developers and users.

Exceptions

AdminNotDefinedError([message])

Exception raised when attempting to set controllers without an admin.

BotNotStartedCorrectlyError([message])

Exception raised when attempting to perform actions without starting the bot properly.

InternalError(message)

Exception raised for internal errors.

InvalidDataStructureError([message])

Exception raised when database is corrupted or improperly modified

InvalidTypeError(expected_type, actual_type)

Exception raised when a variable is of an unexpected type.

MissingStartCommandError([message])

Exception raised when starting bot without a start command.

TelegramLibError(message)

Base class for exceptions in this module.