befantasy
befantasy
> @befantasy I am unable to implement statistics sensors. Can you share your definitions? Finally, I chose utility meter integration + [apexcharts-card](https://github.com/RomRider/apexcharts-card) frontend to solve this problem. It's more flexible....
是的,现在基本不封IP,而是封端口。 所以最好是tcping端口来判断。
我也想知道这个。 仿照IMAGE_URL,对比了一下代码,我感觉修改以下几个文件就可以。增加FILE的class ReplyType(Enum) https://github.com/zhayujie/chatgpt-on-wechat/blob/176941ea3bdb0be0ede18a04f4e418e8886e5213/bridge/reply.py#L10 https://github.com/zhayujie/chatgpt-on-wechat/blob/176941ea3bdb0be0ede18a04f4e418e8886e5213/channel/wechat/wechat_channel.py#L193 https://github.com/zhayujie/chatgpt-on-wechat/blob/176941ea3bdb0be0ede18a04f4e418e8886e5213/channel/chat_channel.py#L236
> 你只增加类型是没用的,本身项目不支持文件解析。 > 不过你可以尝试一下 都是itchat提供的支持,调用的itchat。之前Video_URL也有别的fork项目这么加的。
刚才试了试,没成功。可能还有哪里有遗漏或错误的。 主要是缓存文件并发送这一段,用chatgpt仿照IMAGE_URL写的,可能不对。 gpt给的两种写法都试了。 elif reply.type == ReplyType.FILE: file_url = reply.content file_res = requests.get(file_url, stream=True) file_storage = io.BytesIO() for block in file_res.iter_content(1024): file_storage.write(block) file_storage.seek(0) itchat.send_file(file_storage, toUserName=receiver) logger.info("[WX] sendFile url={}, receiver={}".format(file_url, receiver))...
你这个感觉是写的有问题,得开debug才能看的完整。 你都改了哪里?
> 你这样肯定不行啊。 你要发的文件在哪?通过哪个插件来发?
这个问题我研究明白了,提交了个PR。同时修改了一下keywords插件,作为示例了。 https://github.com/zhayujie/chatgpt-on-wechat/pull/1427
我这里测试是可以的呀,群聊里的session id是一个@的,和用户id一样。 不过我没开group_chat_in_one_session。没测试group_chat_in_one_session开启的情况。