Improved examples, added links to docs
This commit is contained in:
parent
85c2130875
commit
93a2fed8e6
@ -9,8 +9,6 @@ But it is easy to integrate pyrogram with your favourite scheduler.
|
|||||||
schedule
|
schedule
|
||||||
--------
|
--------
|
||||||
|
|
||||||
Note that schedule is not suitable for async version of pyrogram.
|
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
import time
|
import time
|
||||||
@ -20,20 +18,15 @@ Note that schedule is not suitable for async version of pyrogram.
|
|||||||
def job():
|
def job():
|
||||||
app.send_message("me", "Hi!")
|
app.send_message("me", "Hi!")
|
||||||
|
|
||||||
|
schedule.every(3).seconds.do(job)
|
||||||
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)
|
|
||||||
|
|
||||||
with app:
|
with app:
|
||||||
while True:
|
while True:
|
||||||
schedule.run_pending()
|
schedule.run_pending()
|
||||||
time.sleep(1)
|
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
|
apscheduler
|
||||||
-----------
|
-----------
|
||||||
@ -71,3 +64,4 @@ Apscheduler supports async version of pyrogram too, here is async example:
|
|||||||
scheduler.start()
|
scheduler.start()
|
||||||
app.run()
|
app.run()
|
||||||
|
|
||||||
|
For more information read `library <https://apscheduler.readthedocs.io/>`_ docs.
|
||||||
|
Loading…
Reference in New Issue
Block a user