feat(help): 重构帮助菜单界面并优化样式
refactor(bili_parser): 修复 API 响应 content-type 问题 fix(command_manager): 添加帮助图片获取的错误处理 docs(deployment): 简化部署文档并移除 JIT 相关内容
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 116 KiB After Width: | Height: | Size: 136 KiB |
@@ -202,17 +202,20 @@ class CommandManager:
|
||||
内置的 `/help` 命令的实现。
|
||||
直接从 Redis 获取缓存的图片。
|
||||
"""
|
||||
# 1. 尝试从 Redis 获取
|
||||
help_pic = await redis_manager.get("neobot:core:help_pic")
|
||||
|
||||
if not help_pic:
|
||||
await bot.send(event, "帮助图片缓存缺失,正在重新生成...")
|
||||
await self.sync_help_pic()
|
||||
try:
|
||||
# 1. 尝试从 Redis 获取
|
||||
help_pic = await redis_manager.get("neobot:core:help_pic")
|
||||
|
||||
if help_pic:
|
||||
await bot.send(event, MessageSegment.image(help_pic))
|
||||
return
|
||||
if not help_pic:
|
||||
await bot.send(event, "帮助图片缓存缺失,正在重新生成...")
|
||||
await self.sync_help_pic()
|
||||
help_pic = await redis_manager.get("neobot:core:help_pic")
|
||||
|
||||
if help_pic:
|
||||
await bot.send(event, MessageSegment.image(help_pic))
|
||||
return
|
||||
except Exception as e:
|
||||
logger.error(f"获取或生成帮助图片失败: {e}")
|
||||
|
||||
# 2. 最后的兜底:发送纯文本
|
||||
help_text = "--- 可用指令列表 ---\n"
|
||||
|
||||
Reference in New Issue
Block a user