mirror of
https://github.com/koloideal/Argenta.git
synced 2026-06-10 10:05:28 +03:00
docs
This commit is contained in:
@@ -12,12 +12,13 @@ orchestrator = Orchestrator()
|
||||
# 2. Создание роутера для группировки команд
|
||||
main_router = Router(title="Основные команды")
|
||||
|
||||
|
||||
# 3. Определение команды и её обработчика
|
||||
@main_router.command(Command(
|
||||
"hello",
|
||||
description="Печатает приветственное сообщение",
|
||||
flags=Flag("name")
|
||||
))
|
||||
@main_router.command(
|
||||
Command(
|
||||
"hello", description="Печатает приветственное сообщение", flags=Flag("name")
|
||||
)
|
||||
)
|
||||
def hello_handler(response: Response):
|
||||
"""Этот обработчик будет вызван для команды 'hello'."""
|
||||
name = response.input_flags.get_flag_by_name("name")
|
||||
@@ -26,6 +27,7 @@ def hello_handler(response: Response):
|
||||
else:
|
||||
print("Привет, мир!")
|
||||
|
||||
|
||||
# 4. Подключение роутера к приложению
|
||||
app.include_router(main_router)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user