mirror of
https://github.com/nonebot/nonebot2.git
synced 2024-12-01 01:25:07 +08:00
14 lines
362 B
Python
14 lines
362 B
Python
from nonebot.plugin import on_message
|
|
from nonebot.adapters.mirai import Bot, MessageEvent
|
|
|
|
message_test = on_message()
|
|
|
|
|
|
@message_test.handle()
|
|
async def _message(bot: Bot, event: MessageEvent):
|
|
text = event.get_plaintext()
|
|
if not text:
|
|
return
|
|
reversed_text = ''.join(reversed(text))
|
|
await bot.send(event, reversed_text, at_sender=True)
|