Files
HeXi/dev/plugin_template/nonebot_plugin_template/services/main.py
T
sansenhoshi 131b92b319 结构调整
视频解析多图/多媒体结构 消息体适配
2026-09-08 14:25:32 +08:00

21 lines
632 B
Python

"""业务逻辑层:一个业务动作一个方法;不依赖 nonebot(可单测)。"""
from __future__ import annotations
from hexi.web_hub.web_config import get_effective_value
from ..repository import get_record, save_record
_PLUGIN_ID = __package__.rsplit(".", 1)[0]
async def do_something(text: str) -> str:
"""示例业务:记录输入并返回带配置的回复。"""
save_record("last_input", text)
prefix = get_effective_value(_PLUGIN_ID, "reply", "你好,我是模板插件!")
record = get_record("last_input")
if record:
return f"{prefix} 已记录:{record}"
return prefix