mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-07-27 16:21:28 +00:00
✅ add specified test for mirai adapter
This commit is contained in:
13
tests/test_plugins/test_mirai.py
Normal file
13
tests/test_plugins/test_mirai.py
Normal file
@ -0,0 +1,13 @@
|
||||
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)
|
Reference in New Issue
Block a user