mirror of
https://github.com/nonebot/nonebot2.git
synced 2024-11-28 03:05:25 +08:00
⚡ improve echo matcher
This commit is contained in:
parent
ea8f7717b9
commit
883ea18224
@ -1,10 +1,11 @@
|
||||
from nonebot.rule import to_me
|
||||
from nonebot.adapters import Event
|
||||
from nonebot.adapters import Message
|
||||
from nonebot.plugin import on_command
|
||||
from nonebot.params import EventMessage
|
||||
|
||||
echo = on_command("echo", to_me())
|
||||
|
||||
|
||||
@echo.handle()
|
||||
async def echo_escape(event: Event):
|
||||
await echo.send(message=event.get_message())
|
||||
async def echo_escape(message: Message = EventMessage()):
|
||||
await echo.send(message=message)
|
||||
|
Loading…
Reference in New Issue
Block a user