mirror of
https://github.com/zhayujie/chatgpt-on-wechat.git
synced 2026-07-21 14:17:11 +08:00
feat: itchat support picture msg
This commit is contained in:
@@ -22,6 +22,10 @@ class WeChatMessage(ChatMessage):
|
||||
self.ctype = ContextType.VOICE
|
||||
self.content = TmpDir().path() + itchat_msg['FileName'] # content直接存临时目录路径
|
||||
self._prepare_fn = lambda: itchat_msg.download(self.content)
|
||||
elif itchat_msg['Type'] == PICTURE and itchat_msg['MsgType'] == 3:
|
||||
self.ctype = ContextType.IMAGE
|
||||
self.content = TmpDir().path() + itchat_msg['FileName'] # content直接存临时目录路径
|
||||
self._prepare_fn = lambda: itchat_msg.download(self.content)
|
||||
else:
|
||||
raise NotImplementedError("Unsupported message type: {}".format(itchat_msg['Type']))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user