A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://python-telegram-bot.readthedocs.io/telegram.ext.contexttypes.html below:

ContextTypes - python-telegram-bot v22.3

Back to top

Toggle table of contents sidebar

ContextTypes
class telegram.ext.ContextTypes(context=<class 'telegram.ext._callbackcontext.CallbackContext'>, bot_data=<class 'dict'>, chat_data=<class 'dict'>, user_data=<class 'dict'>)[source]

Bases: typing.Generic

Convenience class to gather customizable types of the telegram.ext.CallbackContext interface.

Added in version 13.6.

Parameters:
DEFAULT_TYPE[source]

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]]

property bot_data[source]

The type of context.bot_data of all (error-)handler callbacks and job callbacks.

property chat_data[source]

The type of context.chat_data of all (error-)handler callbacks and job callbacks.

property context[source]

The type of the context argument of all (error-)handler callbacks and job callbacks.

property user_data[source]

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