@@ -46,35 +46,6 @@ def _download_file():
4646 else :
4747 logger .info (f"[FeiShu] Failed to download file, key={ file_key } , res={ response .text } " )
4848 self ._prepare_fn = _download_file
49-
50- # elif msg.type == "voice":
51- # self.ctype = ContextType.VOICE
52- # self.content = TmpDir().path() + msg.media_id + "." + msg.format # content直接存临时目录路径
53- #
54- # def download_voice():
55- # # 如果响应状态码是200,则将响应内容写入本地文件
56- # response = client.media.download(msg.media_id)
57- # if response.status_code == 200:
58- # with open(self.content, "wb") as f:
59- # f.write(response.content)
60- # else:
61- # logger.info(f"[wechatcom] Failed to download voice file, {response.content}")
62- #
63- # self._prepare_fn = download_voice
64- # elif msg.type == "image":
65- # self.ctype = ContextType.IMAGE
66- # self.content = TmpDir().path() + msg.media_id + ".png" # content直接存临时目录路径
67- #
68- # def download_image():
69- # # 如果响应状态码是200,则将响应内容写入本地文件
70- # response = client.media.download(msg.media_id)
71- # if response.status_code == 200:
72- # with open(self.content, "wb") as f:
73- # f.write(response.content)
74- # else:
75- # logger.info(f"[wechatcom] Failed to download image file, {response.content}")
76- #
77- # self._prepare_fn = download_image
7849 else :
7950 raise NotImplementedError ("Unsupported message type: Type:{} " .format (msg_type ))
8051
0 commit comments