-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
28 lines (21 loc) · 822 Bytes
/
app.py
File metadata and controls
28 lines (21 loc) · 822 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
25
26
27
28
from aiogram import executor
from loader import dp, db
import middlewares, filters, handlers
from utils.notify_admins import on_startup_notify
from utils.set_bot_commands import set_default_commands
from data.admin_rights import make_admins_forever
async def on_startup(dispatcher):
# Ma'lumotlar bazasini yaratamiz:
await db.create()
await db.create_table_users()
await db.create_table_category()
await db.create_table_product()
await db.create_table_order()
await db.create_table_admins()
await make_admins_forever(db)
# Birlamchi komandalar (/start va /help)
await set_default_commands(dispatcher)
# Bot ishga tushgani haqida adminga xabar berish
await on_startup_notify(dispatcher)
if __name__ == '__main__':
executor.start_polling(dp, on_startup=on_startup)