-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.py
37 lines (30 loc) · 950 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
34
35
36
37
from aiogram import executor
from source import handlers
from source import middlewares
from source.handlers import dp
from aiogram import executor
from loguru import logger
import time
async def set_commands(dp):
from aiogram import types
await dp.bot.set_my_commands(
commands=[
types.BotCommand(command="/start", description="🏠 Главное меню"),
#types.BotCommand(command="/send", description="📤 Отправить файл"),
]
)
async def on_startup(dp):
middlewares.setup(dp)
await set_commands(dp)
handlers.setup(dp)
logger.add(
f'logs/{time.strftime("%Y-%m-%d__%H-%M")}.log',
level="DEBUG",
rotation="500 MB",
compression="zip",
)
logger.success("[+] Бот запущен!")
# Запуск бота
if __name__ == "__main__":
# Launch
executor.start_polling(dp, skip_updates=True, on_startup=on_startup)