Files
HeXi/hexi/plugins/nonebot_plugin_group_tools/handlers/management/antivirus.py
T

26 lines
862 B
Python
Raw Normal View History

"""群管理工具 —— 病毒消息拦截。"""
from __future__ import annotations
from nonebot import on_message, require
from nonebot.adapters.onebot.v11 import Bot, GroupMessageEvent
from nonebot.rule import is_type
from nonebot_plugin_alconna import UniMessage
require("nonebot_plugin_alconna")
fuck_xxs = on_message(rule=is_type(GroupMessageEvent), block=False)
@fuck_xxs.handle()
async def fuck_xxs_handle(bot: Bot, ev: GroupMessageEvent):
for m in ev.message:
if m.type == "json" and '"app":"com.tencent.autoreply"' in m.data.get(
"data", ""
):
await bot.delete_msg(message_id=ev.message_id)
await UniMessage.text(
"这是onse病毒码,会获取到你手机的xxs,然后发起攻击...以下省略6行需要全文背诵的金句"
).send()
return