telegram.ext.typehandler module¶
This module contains the TypeHandler class
-
class
telegram.ext.typehandler.TypeHandler(type, callback, strict=False, pass_update_queue=False, pass_job_queue=False)¶ Bases:
telegram.ext.handler.HandlerHandler class to handle updates of custom types.
Parameters: - type (type) – The
typeof updates this handler should process, as determined byisinstance - callback (function) – A function that takes
bot, updateas positional arguments. It will be called when thecheck_updatehas determined that an update should be processed by this handler. - strict (optional[bool]) – Use
typeinstead ofisinstance. Default isFalse - pass_update_queue (optional[bool]) – If set to
True, a keyword argument calledupdate_queuewill be passed to the callback function. It will be theQueueinstance used by theUpdaterandDispatcherthat contains new updates which can be used to insert updates. Default isFalse. - pass_job_queue (optional[bool]) – If set to
True, a keyword argument calledjob_queuewill be passed to the callback function. It will be aJobQueueinstance created by theUpdaterwhich can be used to schedule new jobs. Default isFalse.
-
checkUpdate(*args, **kwargs)¶
-
check_update(update)¶
-
handleUpdate(*args, **kwargs)¶
-
handle_update(update, dispatcher)¶
-
m= 'telegram.TypeHandler.'¶
- type (type) – The