commands list

This commit is contained in:
mihalin 2021-09-10 23:20:06 +03:00
parent 367cc29982
commit f52353fd14

22
main.py
View File

@ -20,13 +20,31 @@ async def init_database():
await Tortoise.init(config=TORTOISE_ORM) await Tortoise.init(config=TORTOISE_ORM)
async def init_olgram():
from olgram.router import bot
from aiogram.types import BotCommand
await bot.set_my_commands(
[
BotCommand("start", "Запустить бота"),
BotCommand("addbot", "Добавить нового бота"),
BotCommand("mybots", "Список ботов"),
BotCommand("help", "Справка")
]
)
async def initialization():
await init_database()
await init_redis()
await init_olgram()
def main(): def main():
""" """
Classic polling Classic polling
""" """
loop = asyncio.get_event_loop() loop = asyncio.get_event_loop()
loop.run_until_complete(init_database()) loop.run_until_complete(initialization())
loop.run_until_complete(init_redis())
loop.create_task(dp.start_polling()) loop.create_task(dp.start_polling())
loop.create_task(server_main().start()) loop.create_task(server_main().start())