mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
#238 Formatted deep linking docs
This commit is contained in:
parent
41191721f6
commit
52f35058db
1 changed files with 12 additions and 6 deletions
|
|
@ -12,14 +12,20 @@ https://core.telegram.org/bots#deep-linking
|
|||
We have add some utils to get deep links more handy.
|
||||
|
||||
Basic link example:
|
||||
>>> from aiogram.utils.deep_linking import get_start_link
|
||||
>>> link = await get_start_link('foo') # result: 'https://t.me/MyBot?start=foo'
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
from aiogram.utils.deep_linking import get_start_link
|
||||
link = await get_start_link('foo') # result: 'https://t.me/MyBot?start=foo'
|
||||
|
||||
Encoded link example:
|
||||
>>> from aiogram.utils.deep_linking import get_start_link, decode_payload
|
||||
>>> link = await get_start_link('foo', encode=True) # result: 'https://t.me/MyBot?start=Zm9v'
|
||||
>>> # and decode it back:
|
||||
>>> payload = decode_payload('Zm9v') # result: 'foo'
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
from aiogram.utils.deep_linking import get_start_link, decode_payload
|
||||
link = await get_start_link('foo', encode=True) # result: 'https://t.me/MyBot?start=Zm9v'
|
||||
# and decode it back:
|
||||
payload = decode_payload('Zm9v') # result: 'foo'
|
||||
|
||||
"""
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue