如何在 Aiogram 的调度程序中从 message_handler 中排除 /command?

How to exclude the /command from message_handler in the dispatcher of Aiogram?

我有一个消息处理程序,它响应使用 python3 库 Aiogram 编写的 Bot 应用程序中的命令。

我可以从应用程序接收到我发送给 BOT 的消息,但我想排除该命令(可能通过配置,而不是解析字符串)。也许在文档中,但目前我找不到答案。

为了清楚起见,如果我输入我的 TelegramBot

/my_command text

这是我在 python3 应用程序中的代码

@dispatcher.message_handler(commands=['my_command'])
async def echo(message: types.Message):

我想从 message types.Message 变量中的 message_handler 接收字符串 text 而不是 /my_command text.

非常感谢

仅提取命令参数的函数是get_args():

@dispatcher.message_handler(commands=['my_command'])
async def echo(message: types.Message):
    arguments = message.get_args()
    await message.reply(arguments)