-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathapp.py
More file actions
24 lines (19 loc) · 785 Bytes
/
app.py
File metadata and controls
24 lines (19 loc) · 785 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from aiogram import executor
from loader import dp
import middlewares, filters, handlers
from utils.notify_admins import on_startup_notify
from utils.set_bot_commands import set_default_commands
from apscheduler.schedulers.asyncio import AsyncIOScheduler
from handlers.users.check_payments import check_expired_users
async def on_startup(dispatcher):
# Birlamchi komandalar (/star va /help)
await set_default_commands(dispatcher)
# Bot ishga tushgani haqida adminga xabar berish
await on_startup_notify(dispatcher)
scheduler = AsyncIOScheduler()
scheduler.start()
await check_expired_users()
scheduler.add_job(check_expired_users, "interval", hours=24)
#
if __name__ == '__main__':
executor.start_polling(dp, on_startup=on_startup)