mirror of https://github.com/Mai-with-u/MaiBot.git
Fix emoji emotion parsing for different delimiters
parent
9e89501888
commit
1273f7a6ab
|
|
@ -271,7 +271,7 @@ def _to_emoji_objects(data: Any) -> Tuple[List["MaiEmoji"], int]:
|
||||||
|
|
||||||
emoji.description = emoji_data.description
|
emoji.description = emoji_data.description
|
||||||
# Deserialize emotion string from DB to list
|
# Deserialize emotion string from DB to list
|
||||||
emoji.emotion = emoji_data.emotion.split(",") if emoji_data.emotion else []
|
emoji.emotion = emoji_data.emotion.replace(",",",").split(",") if emoji_data.emotion else []
|
||||||
emoji.usage_count = emoji_data.usage_count
|
emoji.usage_count = emoji_data.usage_count
|
||||||
|
|
||||||
db_last_used_time = emoji_data.last_used_time
|
db_last_used_time = emoji_data.last_used_time
|
||||||
|
|
@ -732,7 +732,7 @@ class EmojiManager:
|
||||||
emoji_record = Emoji.get_or_none(Emoji.emoji_hash == emoji_hash)
|
emoji_record = Emoji.get_or_none(Emoji.emoji_hash == emoji_hash)
|
||||||
if emoji_record and emoji_record.emotion:
|
if emoji_record and emoji_record.emotion:
|
||||||
logger.info(f"[缓存命中] 从数据库获取表情包情感标签: {emoji_record.emotion[:50]}...")
|
logger.info(f"[缓存命中] 从数据库获取表情包情感标签: {emoji_record.emotion[:50]}...")
|
||||||
return emoji_record.emotion.split(",")
|
return emoji_record.emotion.replace(",",",").split(",")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"从数据库查询表情包情感标签时出错: {e}")
|
logger.error(f"从数据库查询表情包情感标签时出错: {e}")
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue