Merge pull request #95 from Rikki-Zero/debug

fix: 检查是否 <没有找到> emoji ,修复 0 emoji 时报错问题
pull/101/head
Rikki 2025-03-08 03:49:15 +08:00 committed by GitHub
commit e0d986cc2b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 2 deletions

View File

@ -165,8 +165,12 @@ class ChatBot:
bot_response_time = tinking_time_point
if random() < global_config.emoji_chance:
emoji_path,discription = await emoji_manager.get_emoji_for_text(response)
if emoji_path:
emoji_raw = await emoji_manager.get_emoji_for_text(response)
# 检查是否 <没有找到> emoji
if emoji_raw != None:
emoji_path,discription = emoji_raw
emoji_cq = CQCode.create_emoji_cq(emoji_path)
if random() < 0.5: