修复收到图片消息保存到本地失败的问题

This commit is contained in:
chenzhenkun
2023-09-14 23:39:07 +08:00
parent ca25d0433f
commit ba6c671051
2 changed files with 7 additions and 5 deletions

View File

@@ -202,8 +202,10 @@ class ChatChannel(Channel):
reply = self._generate_reply(new_context)
else:
return
elif context.type == ContextType.IMAGE or context.type == ContextType.FUNCTION \
or context.type == ContextType.FILE: # 图片/文件消息及函数调用等,当前无默认逻辑
elif context.type == ContextType.IMAGE: # 图片消息,当前仅做下载保存到本地的逻辑
cmsg = context["msg"]
cmsg.prepare()
elif context.type == ContextType.FUNCTION or context.type == ContextType.FILE: # 文件消息及函数调用等,当前无默认逻辑
pass
else:
logger.error("[WX] unknown context type: {}".format(context.type))