generated from Latand/aiogram-bot-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.py
33 lines (23 loc) · 945 Bytes
/
app.py
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
29
30
31
32
33
import asyncio
import os
import threading
from hashlib import sha256
from aiogram import executor
from handlers import dp
from utils.misc.jobs import cancel_bank_accounts, send_report_transactions, check_schwab_miniks, \
update_brothers_cost_sheet
from utils.notify_admins import on_startup_notify
from utils.db.database import create_db
async def on_startup(dispatcher):
# Уведомляет про запуск
await on_startup_notify(dispatcher)
await create_db()
await send_report_transactions()
_thread = threading.Thread(target=asyncio.run, args=(cancel_bank_accounts(),))
_thread.start()
_thread = threading.Thread(target=asyncio.run, args=(check_schwab_miniks(),))
_thread.start()
_thread = threading.Thread(target=asyncio.run, args=(update_brothers_cost_sheet(),))
_thread.start()
if __name__ == '__main__':
executor.start_polling(dp, on_startup=on_startup, skip_updates=True)