Toggle table of contents sidebar
ContextTypes¶Bases: typing.Generic
Convenience class to gather customizable types of the telegram.ext.CallbackContext
interface.
Added in version 13.6.
context (type
, optional) – Determines the type of the context
argument of all (error-)handler callbacks and job callbacks. Must be a subclass of telegram.ext.CallbackContext
. Defaults to telegram.ext.CallbackContext
.
bot_data (type
, optional) – Determines the type of context.bot_data
of all (error-)handler callbacks and job callbacks. Defaults to dict
. Must support instantiating without arguments.
chat_data (type
, optional) – Determines the type of context.chat_data
of all (error-)handler callbacks and job callbacks. Defaults to dict
. Must support instantiating without arguments.
user_data (type
, optional) – Determines the type of context.user_data
of all (error-)handler callbacks and job callbacks. Defaults to dict
. Must support instantiating without arguments.
Shortcut for the type annotation for the context
argument that’s correct for the default settings, i.e. if telegram.ext.ContextTypes
is not used.
Example
async def callback(update: Update, context: ContextTypes.DEFAULT_TYPE): ...
alias of CallbackContext
[ExtBot
[None
], dict
[Any
, Any
], dict
[Any
, Any
], dict
[Any
, Any
]]
The type of context.bot_data
of all (error-)handler callbacks and job callbacks.
The type of context.chat_data
of all (error-)handler callbacks and job callbacks.
The type of the context
argument of all (error-)handler callbacks and job callbacks.
The type of context.user_data
of all (error-)handler callbacks and job callbacks.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4