Avoid using telethon.sync in the examples

This commit is contained in:
Lonami Exo
2019-08-13 23:33:39 +02:00
parent 61c0e63bbe
commit e1905d0d7a
28 changed files with 283 additions and 217 deletions

View File

@@ -50,7 +50,7 @@ And except them as such:
.. code-block:: python
try:
client.send_message(chat, 'Hi')
await client.send_message(chat, 'Hi')
except errors.FloodWaitError as e:
# e.seconds is how many seconds you have
# to wait before making the request again.
@@ -98,11 +98,11 @@ This is basic Python knowledge. You should use the dot operator:
.. code-block:: python
me = client.get_me()
me = await client.get_me()
print(me.username)
# ^ we used the dot operator to access the username attribute
result = client(functions.photos.GetUserPhotosRequest(
result = await client(functions.photos.GetUserPhotosRequest(
user_id='me',
offset=0,
max_id=0,