소스 검색

Update wechat_channel.py to support ReplyType.FILE

befantasy 2 년 전
부모
커밋
6bd286e8d5
1개의 변경된 파일4개의 추가작업 그리고 0개의 파일을 삭제
  1. 4 0
      channel/wechat/wechat_channel.py

+ 4 - 0
channel/wechat/wechat_channel.py

@@ -208,3 +208,7 @@ class WechatChannel(ChatChannel):
             image_storage.seek(0)
             itchat.send_image(image_storage, toUserName=receiver)
             logger.info("[WX] sendImage, receiver={}".format(receiver))
+        elif reply.type == ReplyType.FILE:  # 新增文件回复类型
+            file_storage = reply.content
+            itchat.send_file(file_storage, toUserName=receiver)
+            logger.info("[WX] sendFile, receiver={}".format(receiver))