Merge pull request #545 from corolin/main-fix-pr

修复在接收到拍一拍消息时,由于某些原因无法获取到消息内容导致异常,且影响到正常消息的获取
This commit is contained in:
SengokuCola
2025-03-22 21:14:26 +08:00
committed by GitHub

View File

@@ -296,7 +296,7 @@ class ChatBot:
return
raw_message = f"[戳了戳]{global_config.BOT_NICKNAME}" # 默认类型
if info := event.raw_info:
if info := event.model_extra["raw_info"]:
poke_type = info[2].get("txt", "戳了戳") # 戳戳类型,例如“拍一拍”、“揉一揉”、“捏一捏”
custom_poke_message = info[4].get("txt", "") # 自定义戳戳消息,若不存在会为空字符串
raw_message = f"[{poke_type}]{global_config.BOT_NICKNAME}{custom_poke_message}"