This commit is contained in:
SengokuCola
2025-06-25 21:31:35 +08:00
2 changed files with 7 additions and 5 deletions

View File

@@ -309,7 +309,11 @@ async def clear_temp_emoji() -> None:
logger.info("[清理] 开始清理缓存...") logger.info("[清理] 开始清理缓存...")
for need_clear in (os.path.join(BASE_DIR, "emoji"), os.path.join(BASE_DIR, "image"), os.path.join(BASE_DIR, "images")): for need_clear in (
os.path.join(BASE_DIR, "emoji"),
os.path.join(BASE_DIR, "image"),
os.path.join(BASE_DIR, "images"),
):
if os.path.exists(need_clear): if os.path.exists(need_clear):
files = os.listdir(need_clear) files = os.listdir(need_clear)
# 如果文件数超过100就全部删除 # 如果文件数超过100就全部删除

View File

@@ -142,15 +142,13 @@ class ExpressionSelector:
"style" "style"
): ):
current_count = expr.get("count", 1) current_count = expr.get("count", 1)
# 简单加0.1但限制最高为5 # 简单加0.1但限制最高为5
new_count = min(current_count + increment, 5.0) new_count = min(current_count + increment, 5.0)
expr["count"] = new_count expr["count"] = new_count
expr["last_active_time"] = time.time() expr["last_active_time"] = time.time()
logger.info( logger.info(f"表达方式激活: 原count={current_count:.2f}, 增量={increment}, 新count={new_count:.2f}")
f"表达方式激活: 原count={current_count:.2f}, 增量={increment}, 新count={new_count:.2f}"
)
break break
# 保存更新后的文件 # 保存更新后的文件