Skip to content

Commit

Permalink
wechatmp: voice input support
Browse files Browse the repository at this point in the history
  • Loading branch information
JS00000 committed Apr 11, 2023
1 parent 68ef5aa commit 8fa3da9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion channel/wechatmp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ sudo iptables-save > /etc/iptables/rules.v4
公共api有访问频率限制(免费账号每分钟最多20次ChatGPT的API调用),这在服务多人的时候会遇到问题。因此这里多加了一个设置私有api_key的功能。目前通过godcmd插件的命令来设置私有api_key。

## 测试范围
目前在`RoboStyle`这个公众号上进行了测试(基于[wechatmp-stable分支](https://github.com/JS00000/chatgpt-on-wechat/tree/wechatmp-stable),而[master分支](https://github.com/zhayujie/chatgpt-on-wechat)含有最新功能,但是稳定性有待测试),感兴趣的可以关注并体验。开启了godcmd, Banwords, role, dungeon, finish这五个插件,其他的插件还没有测试。百度的接口暂未测试。语音对话没有测试。图片直接以链接形式回复(没有临时素材上传接口的权限)。
目前在`RoboStyle`这个公众号上进行了测试基于[wechatmp分支](https://github.com/JS00000/chatgpt-on-wechat/tree/wechatmp),感兴趣的可以关注并体验。开启了godcmd, Banwords, role, dungeon, finish这五个插件,其他的插件还没有测试。百度的接口暂未测试。语音对话没有测试。图片直接以链接形式回复(没有临时素材上传接口的权限)。

## TODO
* 服务号交互完善
Expand Down
2 changes: 1 addition & 1 deletion channel/wechatmp/ServiceAccount.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def POST(self):
webData = web.data()
# logger.debug("[wechatmp] Receive request:\n" + webData.decode("utf-8"))
wechatmp_msg = receive.parse_xml(webData)
if wechatmp_msg.msg_type == 'text':
if wechatmp_msg.msg_type == 'text' or wechatmp_msg.msg_type == 'voice':
from_user = wechatmp_msg.from_user_id
message = wechatmp_msg.content.decode("utf-8")
message_id = wechatmp_msg.msg_id
Expand Down
2 changes: 1 addition & 1 deletion channel/wechatmp/SubscribeAccount.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def POST(self):
webData = web.data()
logger.debug("[wechatmp] Receive request:\n" + webData.decode("utf-8"))
wechatmp_msg = receive.parse_xml(webData)
if wechatmp_msg.msg_type == 'text':
if wechatmp_msg.msg_type == 'text' or wechatmp_msg.msg_type == 'voice':
from_user = wechatmp_msg.from_user_id
to_user = wechatmp_msg.to_user_id
message = wechatmp_msg.content.decode("utf-8")
Expand Down

0 comments on commit 8fa3da9

Please sign in to comment.