diff --git a/config.toml b/config.toml index cb60f44..25c55be 100644 --- a/config.toml +++ b/config.toml @@ -19,7 +19,7 @@ token = "" # Bot 基础配置 [bot] # 命令前缀列表 -command = ["/"] +command = ["。"] # 是否忽略自己的消息 ignore_self_message = true # 权限不足时的消息 diff --git a/web_static/changelog_generator/generate.py b/web_static/changelog_generator/generate.py new file mode 100644 index 0000000..3403880 --- /dev/null +++ b/web_static/changelog_generator/generate.py @@ -0,0 +1,71 @@ +import os +import sys +from datetime import datetime +from jinja2 import Environment, FileSystemLoader + +# ========================================== +# 配置区域 +# ========================================== + +# 输出文件路径 (相对于当前脚本或绝对路径) +OUTPUT_FILE = "../changelog.html" + +# 更新日志数据 +# 格式说明: +# version: 版本号 +# date: 日期 (YYYY-MM-DD) +# description: 版本描述 (可选) +# changes: 变更列表 +# - type: 类型 (add, update, fix) +# - content: 变更内容 +changelogs = [ + { + "version": "v1.0.0", + "date": "2026-3-1", + "description": "引入了更多有趣的互动功能,并优化了系统稳定性。", + "changes": [ + {"type": "add", "content": "新增了天气查询功能,支持全国主要城市"}, + {"type": "update", "content": "优化了 Web Parser 的解析速度,不过b站的视频解析等待重做中"}, + {"type": "fix", "content": "修复了在某些特定网络环境下图片加载失败的问题"}, + {"type": "update", "content": "支持多实现端连接(反向WS),此功能并不完善,等待重做"} + + + ] + } +] + +# ========================================== +# 生成逻辑 (通常不需要修改) +# ========================================== + +def generate_changelog(): + # 获取当前脚本所在目录 + base_dir = os.path.dirname(os.path.abspath(__file__)) + + # 设置 Jinja2 环境 + env = Environment(loader=FileSystemLoader(base_dir)) + template = env.get_template("template.html") + + # 获取最新版本号 + latest_version = changelogs[0]["version"] if changelogs else "v0.0.0" + + # 渲染模板 + html_content = template.render( + log=changelogs[0] if changelogs else None, + latest_version=latest_version, + generated_at=datetime.now().strftime("%Y-%m-%d %H:%M:%S") + ) + + # 确定输出路径 + output_path = os.path.join(base_dir, OUTPUT_FILE) + + # 写入文件 + try: + with open(output_path, "w", encoding="utf-8") as f: + f.write(html_content) + print(f"✅ 成功生成更新日志: {os.path.abspath(output_path)}") + except Exception as e: + print(f"❌ 生成失败: {e}") + +if __name__ == "__main__": + generate_changelog() diff --git a/web_static/changelog_generator/template.html b/web_static/changelog_generator/template.html new file mode 100644 index 0000000..e0d3eac --- /dev/null +++ b/web_static/changelog_generator/template.html @@ -0,0 +1,187 @@ + + + + + + NEOBOT | Changelog + + + + + + + + + + + + + +
+
+ + +
+
PROJECT HISTORY
+

+ System
+ Evolution +

+

+ 记录每一次微小的改变,见证成长的轨迹。 +

+
+ + +
+
+ +
+ + +
+
+
+

{{ log.version }}

+ LATEST +
+
{{ log.date }}
+
+ {% if log.description %} +
+

+ "{{ log.description }}" +

+
+ {% endif %} +
+ + +
+
    + {% for change in log.changes %} +
  • + {% if change.type == 'add' %} + ADD + {% elif change.type == 'update' %} + UPD + {% elif change.type == 'fix' %} + FIX + {% else %} + MSC + {% endif %} + + {{ change.content }} +
  • + {% endfor %} +
+
+
+
+ +
+
+ + + + +