Update handling errors example
Use asyncio.sleep instead of time.sleep
This commit is contained in:
parent
e9e6c30d05
commit
8515ef1746
@ -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
|
||||
await asyncio.sleep(e.x) # Wait "x" seconds before continuing
|
||||
...
|
Loading…
Reference in New Issue
Block a user