mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-11 18:01:04 +00:00
Remove commands= from examples
This commit is contained in:
parent
b56628bb2e
commit
b94123de3d
2 changed files with 4 additions and 4 deletions
|
|
@ -59,7 +59,7 @@ async def handle_invalid_exceptions(event: ErrorEvent) -> None:
|
||||||
logger.error("Error `Invalid` caught: %r while processing %r", event.exception, event.update)
|
logger.error("Error `Invalid` caught: %r while processing %r", event.exception, event.update)
|
||||||
|
|
||||||
|
|
||||||
@dp.message(Command(commands=["age"]))
|
@dp.message(Command("age"))
|
||||||
async def handle_set_age(message: types.Message, command: CommandObject) -> None:
|
async def handle_set_age(message: types.Message, command: CommandObject) -> None:
|
||||||
"""
|
"""
|
||||||
This handler receives only messages with `/age` command.
|
This handler receives only messages with `/age` command.
|
||||||
|
|
@ -83,7 +83,7 @@ async def handle_set_age(message: types.Message, command: CommandObject) -> None
|
||||||
await message.reply(text=f"Your age is {age}")
|
await message.reply(text=f"Your age is {age}")
|
||||||
|
|
||||||
|
|
||||||
@dp.message(Command(commands=["name"]))
|
@dp.message(Command("name"))
|
||||||
async def handle_set_name(message: types.Message, command: CommandObject) -> None:
|
async def handle_set_name(message: types.Message, command: CommandObject) -> None:
|
||||||
"""
|
"""
|
||||||
This handler receives only messages with `/name` command.
|
This handler receives only messages with `/name` command.
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ from aiogram.types import (
|
||||||
my_router = Router()
|
my_router = Router()
|
||||||
|
|
||||||
|
|
||||||
@my_router.message(Command(commands=["start"]))
|
@my_router.message(Command("start"))
|
||||||
async def command_start(message: Message, bot: Bot, base_url: str):
|
async def command_start(message: Message, bot: Bot, base_url: str):
|
||||||
await bot.set_chat_menu_button(
|
await bot.set_chat_menu_button(
|
||||||
chat_id=message.chat.id,
|
chat_id=message.chat.id,
|
||||||
|
|
@ -20,7 +20,7 @@ async def command_start(message: Message, bot: Bot, base_url: str):
|
||||||
await message.answer("""Hi!\nSend me any type of message to start.\nOr just send /webview""")
|
await message.answer("""Hi!\nSend me any type of message to start.\nOr just send /webview""")
|
||||||
|
|
||||||
|
|
||||||
@my_router.message(Command(commands=["webview"]))
|
@my_router.message(Command("webview"))
|
||||||
async def command_webview(message: Message, base_url: str):
|
async def command_webview(message: Message, base_url: str):
|
||||||
await message.answer(
|
await message.answer(
|
||||||
"Good. Now you can try to send it via Webview",
|
"Good. Now you can try to send it via Webview",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue