mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2024-10-24 01:46:22 +02:00
Fix type annotation in example snippet: handlers are passed Update, not Updater
parent
b7f322e9a2
commit
8f04a5be75
1 changed files with 2 additions and 2 deletions
|
@ -58,12 +58,12 @@ def start(bot, update, args, job_queue):
|
|||
|
||||
to the new style using CallbackContext
|
||||
``` python
|
||||
def start(update: Updater, context: CallbackContext):
|
||||
def start(update: Update, context: CallbackContext):
|
||||
# Stuff here
|
||||
# args will be available as context.args
|
||||
# jobqueue will be available as context.jobqueue
|
||||
```
|
||||
_On python 2 which doesn't support annotations replace `update: Updater, context: CallbackContext` with simply `update, context`._
|
||||
_On python 2 which doesn't support annotations replace `update: Update, context: CallbackContext` with simply `update, context`._
|
||||
|
||||
## Error handler callbacks
|
||||
Error handler callbacks are the ones added using `Dispatcher.add_error_handler`. These have also been changed from the old form:
|
||||
|
|
Loading…
Reference in a new issue