Skip to content
Back to top
View this page

# telegram.warnings Module

This module contains classes used for warnings issued by this library.

Added in version 20.0.

exception telegram.warnings.PTBDeprecationWarning(version, message)

  Bases: `telegram.warnings.PTBUserWarning`, `DeprecationWarning`

  Custom warning class for deprecations in this library.

  Changed in version 20.0: Renamed TelegramDeprecationWarning to PTBDeprecationWarning.

  Parameters:

    - version (`str`) –

      The version in which the feature was deprecated.

      Added in version 21.2.

    - message (`str`) –

      The message to display.

      Added in version 21.2.

  version

    The version in which the feature was deprecated.

    Added in version 21.2.

    Type:

      `str`

  message

    The message to display.

    Added in version 21.2.

    Type:

      `str`

  __str__()

    Returns a string representation of the warning, using `message` and `version`.

    Added in version 21.2.

exception telegram.warnings.PTBRuntimeWarning

  Bases: `telegram.warnings.PTBUserWarning`, `RuntimeWarning`

  Custom runtime warning class used for warnings in this library.

  Added in version 20.0.

exception telegram.warnings.PTBUserWarning

  Bases: `UserWarning`

  Custom user warning class used for warnings in this library.

  See also

  Exceptions, Warnings and Logging

  Added in version 20.0.