forked from PheeZz/XTLS-Reality-bot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.py
43 lines (32 loc) · 1.1 KB
/
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
38
39
40
41
42
43
from aiogram import executor
async def set_commands(dp):
from aiogram import types
await dp.bot.set_my_commands(
commands=[
types.BotCommand(command="/menu", description="Show main menu"),
types.BotCommand(command="/pay", description="Show payment methods"),
types.BotCommand(command="/help", description="Show connection help guide"),
]
)
async def on_startup(dp):
from source import handlers
from source import middlewares
from source.utils.shedulers import SubscriptionChecker
from loguru import logger
import time
subscription_checker = SubscriptionChecker()
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("[+] Bot started successfully")
if __name__ == "__main__":
# Launch
from aiogram import executor
from source.handlers import dp
executor.start_polling(dp, skip_updates=True, on_startup=on_startup)