Files
nonebot-plugin-watch/nonebot_plugin_watch/matcher.py
2024-10-19 00:25:57 +08:00

17 lines
555 B
Python

from nonebot import on_message
from nonebot_plugin_alconna.uniseg import UniMsg
from nonebot_plugin_uninfo import Uninfo # type: ignore[import-untyped]
from plyer import notification # type: ignore[import-untyped]
from .config import config
@on_message().handle()
async def _(session: Uninfo, msg: UniMsg):
if session.user.id in config.watch_ids:
notification.notify( # type: ignore
title=f"{session.user.nick or session.user.name or session.user.id} 发言",
message=repr(msg),
timeout=10,
)