feat(wtfllm): 接入 nonebot-plugin-wtfllm AI 帮助助手
- pyproject 注册 nonebot_plugin_wtfllm 插件 - 新增 wtfllm_gate 插件:仅在群 621016172 启用 wtfllm 响应 - 新增 kb_build:抓取 danding.vip 文档并导入 wtfllm 知识库的脚本 - requirements: 升级 nonebot2 2.5.0 / pydantic 2.13.5,补 aiohttp 与 wtfllm 依赖
This commit is contained in:
17
danding_bot/plugins/wtfllm_gate.py
Normal file
17
danding_bot/plugins/wtfllm_gate.py
Normal file
@@ -0,0 +1,17 @@
|
||||
"""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 仅在指定群启用")
|
||||
Reference in New Issue
Block a user