Updated Types of Handlers (markdown)

Joscha Götzer 2017-12-27 23:20:28 +01:00
parent a00db8b94d
commit 5071ba8823

@ -21,7 +21,8 @@ def start_callback(bot, update, args):
... ...
dispatcher.add_handler(CommandHandler("start", start_callback, pass_args=True))``` dispatcher.add_handler(CommandHandler("start", start_callback, pass_args=True))
```
Sending "/start Hello World!" to your bot will now split everything after /start separated by the space character into a list of words and pass it on to the `args` parameter of `start_callback`: `["Hello", "World!"]`. We join these chunks together by calling `" ".join(args)` and echo the resulting string back to the user. Sending "/start Hello World!" to your bot will now split everything after /start separated by the space character into a list of words and pass it on to the `args` parameter of `start_callback`: `["Hello", "World!"]`. We join these chunks together by calling `" ".join(args)` and echo the resulting string back to the user.