Custom type definition for user-level persisted state.
Custom type definition for chat-level persisted state.
Custom type definition for bot-level persisted state.
Creates a new CallbackContext instance.
Custom type definition for user-level persisted state.
Custom type definition for chat-level persisted state.
Custom type definition for bot-level persisted state.
Initialization options for context properties.
OptionalargsPositional arguments parsed from a command message.
ReadonlybotThe Bot client instance executing this handler.
OptionalbotGlobal bot-level persistent or memory storage object.
OptionalchatPer-chat persistent or memory storage object.
Linear async conversation helper instance.
OptionalerrorThe caught exception / error when invoked inside an error handler.
OptionalmatchesRegExp match arrays populated by filters matching regular expressions.
OptionalmenuInteractive menu navigation and live update helper when invoked inside a menu callback.
OptionalschedulerBackground task scheduler and timer engine.
OptionaltaskThe current background task/job being executed (when invoked from the scheduler).
Optional ReadonlyupdateThe Update that triggered this handler invocation, if applicable.
OptionaluserPer-user persistent or memory storage object.
Convenience shortcut to answer the active callback query.
Additional answer options (e.g. text notification, alert).
true on success.
Convenience shortcut to delete a message in the current chat.
OptionalmessageId: number
Identifier of the message to delete (defaults to current effective_message).
true on success.
Convenience shortcut to edit the text of the current message.
New message text.
Additional text editing options.
The edited Message or true.
Convenience shortcut to send a text reply to the current chat.
Message text to send.
Additional parameters for sending message.
The sent Message.
Convenience shortcut to send an audio file to the current chat.
File ID, URL, or InputFile.
Additional audio options.
The sent Message.
Convenience shortcut to send a document/file to the current chat.
File ID, URL, or InputFile.
Additional document options.
The sent Message.
Convenience shortcut to send an HTML-formatted message to the current chat.
HTML string content.
Additional message options.
The sent Message.
Convenience shortcut to send a MarkdownV2-formatted message to the current chat.
MarkdownV2 string content.
Additional message options.
The sent Message.
Convenience shortcut to send a photo to the current chat.
File ID, URL, or InputFile.
Additional photo options.
The sent Message.
Convenience shortcut to send a video to the current chat.
File ID, URL, or InputFile.
Additional video options.
The sent Message.
Context object passed to handler callbacks, error handlers, and job callbacks.
Remarks
Context state property names (
context.user_data,context.chat_data,context.bot_data,context.args,context.job_queue) use consistentsnake_casenaming.Example