mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2024-11-21 22:56:38 +01:00
Add information about the maximum lenght accepted by telegram for the start
parameter in deep-linking. Add the base64 encoding suggestion.
parent
0ab741b86f
commit
ec4c36c72f
1 changed files with 4 additions and 0 deletions
|
@ -35,6 +35,10 @@ Clicking this link will open your Telegram Client and show a big START button. W
|
|||
|
||||
Note that since telegram doesn't support spaces in deep linking parameters, you will have to manually split the single `Hello_World` argument, into `["Hello", "World!"]` (using `args[0].split('_')` for example)
|
||||
|
||||
You also have to pay attention to the maximum lenght accepted by Telegram itself. As stated in the [documentation](https://core.telegram.org/bots#deep-linking) the maximum lenght for the start parameter is 64.
|
||||
|
||||
Also, since this is an URL parameter, you have to pay attention on how to correctly pass the values in order to avoid passing URL reserved characters. Consier the usage of `base64.urlsafe_b64encode`.
|
||||
|
||||
## Pattern matching: The RegexHandler
|
||||
|
||||
For more complex inputs you can employ the [telegram.ext.RegexHandler](https://python-telegram-bot.readthedocs.io/en/latest/telegram.ext.regexhandler.html), which internally uses the `re`-module to match textual user input with a supplied pattern.
|
||||
|
|
Loading…
Reference in a new issue