Updated Scheduling Functions (markdown)

スタークギャング 2021-02-03 22:28:03 +05:30
parent af14b68658
commit e8d70769f1

@ -60,22 +60,22 @@ If you don't mind using other libraries, [`aiocron`](https://github.com/gawel/ai
---
You Can Also Use [`apscheduler`](https://github.com/agronholm/apscheduler), Which is Much Simpler And Much Efficient.
You can also use [`apscheduler`](https://github.com/agronholm/apscheduler), which is much simpler and much efficient.
Here is A Example For Running A Job (Function) Everyday at 6am.
Here is a example for running a job (Function) everyday at 6am.
```python
from apscheduler.schedulers.asyncio import AsyncIOScheduler
async def greet_me():
print("Good Morning Midhun")
print("Good morning Midhun")
scheduler = AsyncIOScheduler()
scheduler.add_job(greet_me, trigger="cron", hour=06)
scheduler.start()
```
You Can Also Run A Job At Specific intervals, Here is A Example For it.
You can also run a job at specific intervals, here is a example for it.
```python
from apscheduler.schedulers.asyncio import AsyncIOScheduler
@ -87,8 +87,8 @@ scheduler = AsyncIOScheduler()
scheduler.add_job(this_will_run_at_every_one_hour, 'interval', minutes=60)
scheduler.start()
```
You Can Also Set Custom TimeZones And Also Use DataBases For Running These Functions.
You can also set custom Time zone and also use database for running these functions.
I Like This Because it's More Advance And Better.
This is more advance And works smoothly with telethon.
Read More About This From [`Here`](https://apscheduler.readthedocs.io/en/stable)
Read more about this from [`Here`](https://apscheduler.readthedocs.io/en/stable)