群消息

from nonebot import on_message
from nonebot.adapters.mirai2 import Bot, GroupMessage, MessageSegment


msging = on_message()

@msging.handle()
async def _(bot: Bot, event: GroupMessage):
	...
	await msging.send(MessageSegment.plan("xxx"))

好友消息

from nonebot.adapters.mirai2 import FriendMessage, MessageSegment


msg = on_message()

@msg.handle()
async def _(bot: Bot, event: FriendMessage):
	...