Add HeXi bot codebase: custom plugins, web frontends, tests

- hexi core: message handling, rate limiting, cooldown, plugin manager
- Custom plugins: BF stats, daily check-in, quotes, persona cards, etc.
- Community plugins vendored under hexi/plugins with local fixes
- Web admin frontends (learning-chat, persona-admin), unified hexi/web
- Tests for rate_limit/cooldown/memes/persona; poetry.lock

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2026-09-01 13:13:40 +08:00
co-authored by Claude
parent 1783c60afa
commit b61d09f09f
3201 changed files with 160436 additions and 171 deletions
@@ -0,0 +1,38 @@
"""<插件名> — MTSS 结构 + 统一配置标准参考模板。
放在 hexi/plugins/ 后改名:目录 nonebot_plugin_<name>,并替换所有
`nonebot_plugin_template` / `template` 占位(建议全局搜索替换)。
结构:Trigger(handlers) → Service(services) → Model(repository/models)。
配置在 config.py 统一注册,Web 可读可改。
"""
from nonebot import require
from nonebot.plugin import PluginMetadata
require("nonebot_plugin_alconna")
__plugin_meta__ = PluginMetadata(
name="插件模板",
description="MTSS 结构 + 统一配置标准参考模板",
usage="模板指令 [参数]",
type="application",
)
# 入口只做四件事:require / meta / 导入子模块 / 配置注册
from . import config as _config # noqa: E402,F401
from . import handlers as _handlers # noqa: E402,F401
from . import web as _web # noqa: E402,F401
from hexi.web_plugin_registry import register_web_plugin # noqa: E402
_config.register_config()
# 注册到统一 Web 管理台(/hub):hub 启动时自动挂载 /api/template
register_web_plugin(
"template",
"插件模板",
"user",
lambda: _web.build_admin_app(),
module_name=__name__,
)