35 lines
1.1 KiB
Python
35 lines
1.1 KiB
Python
"""群聊学习 —— 入口(元数据 + 配置注册 + Web 挂载)。"""
|
|
|
|
from nonebot import require
|
|
from nonebot.plugin import PluginMetadata
|
|
|
|
require("nonebot_plugin_orm")
|
|
|
|
from .config import NICKNAME, config_manager, register_config as _register_learning_config # noqa: E402
|
|
from . import web_hub # noqa: E402
|
|
from hexi.web_hub.web_plugin_registry import register_web_plugin # noqa: E402
|
|
|
|
# 注册到统一 Web 管理台(/hub):hub 启动时挂载 /api/learning_chat
|
|
register_web_plugin(
|
|
"learning_chat",
|
|
"群聊学习",
|
|
"chat",
|
|
lambda: web_hub.build_admin_app(),
|
|
module_name=__name__,
|
|
)
|
|
|
|
# 统一配置标准:把顶层 ChatConfig 字段暴露给 /hub 插件配置页
|
|
_register_learning_config()
|
|
|
|
__plugin_meta__ = PluginMetadata(
|
|
name="群聊学习",
|
|
description="学习群友们的发言、复读以及主动发言",
|
|
usage="详见README",
|
|
type="application",
|
|
homepage="https://github.com/CMHopeSunshine/nonebot-plugin-learning-chat",
|
|
supported_adapters={"~onebot.v11"},
|
|
extra={"author": "惜月"},
|
|
)
|
|
|
|
from .handlers import learning_chat # noqa: E402,F401
|