mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2024-11-22 07:06:26 +01:00
Updated Types of Handlers (markdown)
parent
a00db8b94d
commit
5071ba8823
1 changed files with 2 additions and 1 deletions
|
@ -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.
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue