telegram.ext.ContextTypes¶
-
class
telegram.ext.
ContextTypes
(context=<class 'telegram.ext.callbackcontext.CallbackContext'>, bot_data=<class 'dict'>, chat_data=<class 'dict'>, user_data=<class 'dict'>)¶ Bases:
Generic
[telegram.ext.utils.types.CCT
,telegram.ext.utils.types.UD
,telegram.ext.utils.types.CD
,telegram.ext.utils.types.BD
]Convenience class to gather customizable types of the
telegram.ext.CallbackContext
interface.New in version 13.6.
- Parameters
context (
type
, optional) – Determines the type of thecontext
argument of all (error-)handler callbacks and job callbacks. Must be a subclass oftelegram.ext.CallbackContext
. Defaults totelegram.ext.CallbackContext
.bot_data (
type
, optional) – Determines the type ofcontext.bot_data
of all (error-)handler callbacks and job callbacks. Defaults todict
. Must support instantiating without arguments.chat_data (
type
, optional) – Determines the type ofcontext.chat_data
of all (error-)handler callbacks and job callbacks. Defaults todict
. Must support instantiating without arguments.user_data (
type
, optional) – Determines the type ofcontext.user_data
of all (error-)handler callbacks and job callbacks. Defaults todict
. Must support instantiating without arguments.