Первый стрим
This commit is contained in:
27
main.py
Normal file
27
main.py
Normal file
@ -0,0 +1,27 @@
|
||||
import asyncio
|
||||
|
||||
from aiogram import Dispatcher, F
|
||||
from aiogram.filters import Command
|
||||
|
||||
from app.handlers.docker_commands import get_containers, container_actions, do_container_action
|
||||
from app.handlers.user_command import execute_command
|
||||
from app.settings import bot
|
||||
|
||||
|
||||
async def start():
|
||||
dp = Dispatcher()
|
||||
|
||||
dp.message.register(execute_command, Command(commands="command"))
|
||||
dp.message.register(get_containers, Command(commands="docker_list"))
|
||||
|
||||
dp.callback_query.register(container_actions, F.data.startswith("container"))
|
||||
dp.callback_query.register(do_container_action, F.data.startswith("action"))
|
||||
|
||||
try:
|
||||
await dp.start_polling(bot)
|
||||
finally:
|
||||
await bot.session.close()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
asyncio.run(start())
|
Reference in New Issue
Block a user