Update handling errors example

Use asyncio.sleep instead of time.sleep
This commit is contained in:
Dan 2021-05-05 13:58:47 +02:00
parent e9e6c30d05
commit 8515ef1746

View File

@ -96,10 +96,12 @@ The value is stored in the ``x`` attribute of the exception object:
.. code-block:: python
import time
import asyncio
from pyrogram.errors import FloodWait
try:
... # Your code
except FloodWait as e:
time.sleep(e.x) # Wait "x" seconds before continuing
...
try:
... # Your code
except FloodWait as e:
await asyncio.sleep(e.x) # Wait "x" seconds before continuing
...