"""wtfllm 群启用范围控制:仅允许在指定群及私聊中触发。""" from nonebot import get_driver from nonebot.exception import IgnoredException from nonebot.message import run_preprocessor from nonebot.adapters.onebot.v11 import GroupMessageEvent from nonebot_plugin_wtfllm import __plugin_meta__ # noqa: F401 确保插件已加载 WTFLLM_ENABLED_GROUPS = {"621016172"} @run_preprocessor async def gate_wtfllm_groups(matcher, event): if matcher.plugin_name != "nonebot_plugin_wtfllm": return if isinstance(event, GroupMessageEvent) and str(event.group_id) not in WTFLLM_ENABLED_GROUPS: raise IgnoredException("wtfllm 仅在指定群启用")