fix: 修复表情包重复保存

This commit is contained in:
tcmofashi
2025-03-13 00:46:50 +08:00
parent 70243c23c5
commit 2d7da8cd70
2 changed files with 10 additions and 116 deletions

View File

@@ -232,7 +232,7 @@ class EmojiManager:
image_hash = hashlib.md5(image_bytes).hexdigest()
image_format = Image.open(io.BytesIO(image_bytes)).format.lower()
# 检查是否已经注册过
existing_emoji = db["emoji"].find_one({"filename": filename})
existing_emoji = db["emoji"].find_one({"hash": image_hash})
description = None
if existing_emoji: