Improved examples, added links to docs

This commit is contained in:
MrNaif2018 2019-08-01 10:11:29 +03:00 committed by GitHub
parent 85c2130875
commit 93a2fed8e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -9,8 +9,6 @@ But it is easy to integrate pyrogram with your favourite scheduler.
schedule
--------
Note that schedule is not suitable for async version of pyrogram.
.. code-block:: python
import time
@ -20,20 +18,15 @@ Note that schedule is not suitable for async version of pyrogram.
def job():
app.send_message("me", "Hi!")
schedule.every(10).minutes.do(job)
schedule.every().hour.do(job)
schedule.every().day.at("10:30").do(job)
schedule.every(5).to(10).minutes.do(job)
schedule.every().monday.do(job)
schedule.every().wednesday.at("13:15").do(job)
schedule.every().minute.at(":17").do(job)
schedule.every(3).seconds.do(job)
with app:
while True:
schedule.run_pending()
time.sleep(1)
Note that schedule is not suitable for async version of pyrogram.
For more information read `library <https://schedule.readthedocs.io/>`_ docs.
apscheduler
-----------
@ -71,3 +64,4 @@ Apscheduler supports async version of pyrogram too, here is async example:
scheduler.start()
app.run()
For more information read `library <https://apscheduler.readthedocs.io/>`_ docs.