mirror of
https://github.com/zhayujie/chatgpt-on-wechat.git
synced 2026-06-02 09:48:22 +08:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
02a95345aa | ||
|
|
6076e2ed0a |
@@ -73,8 +73,15 @@ def qrCallback(uuid,status,qrcode):
|
||||
import qrcode
|
||||
url = f"https://login.weixin.qq.com/l/{uuid}"
|
||||
|
||||
qr_api="https://api.isoyu.com/qr/?m=1&e=L&p=20&url={}".format(url)
|
||||
print("You can also scan QRCode in the website below:\n{}".format(qr_api))
|
||||
qr_api1="https://api.isoyu.com/qr/?m=1&e=L&p=20&url={}".format(url)
|
||||
qr_api2="https://api.qrserver.com/v1/create-qr-code/?size=400×400&data={}".format(url)
|
||||
qr_api3="https://api.pwmqr.com/qrcode/create/?url={}".format(url)
|
||||
qr_api4="https://my.tv.sohu.com/user/a/wvideo/getQRCode.do?text={}".format(url)
|
||||
print("You can also scan QRCode in any website below:")
|
||||
print(qr_api3)
|
||||
print(qr_api4)
|
||||
print(qr_api2)
|
||||
print(qr_api1)
|
||||
|
||||
qr = qrcode.QRCode(border=1)
|
||||
qr.add_data(url)
|
||||
|
||||
@@ -73,6 +73,9 @@ class WechatyChannel(ChatChannel):
|
||||
file_path = reply.content
|
||||
sil_file = os.path.splitext(file_path)[0] + '.sil'
|
||||
voiceLength = int(any_to_sil(file_path, sil_file))
|
||||
if voiceLength >= 60000:
|
||||
voiceLength = 60000
|
||||
logger.info('[WX] voice too long, length={}, set to 60s'.format(voiceLength))
|
||||
# 发送语音
|
||||
t = int(time.time())
|
||||
msg = FileBox.from_file(sil_file, name=str(t) + '.sil')
|
||||
@@ -113,7 +116,6 @@ class WechatyChannel(ChatChannel):
|
||||
return
|
||||
logger.debug('[WX] message:{}'.format(cmsg))
|
||||
room = msg.room() # 获取消息来自的群聊. 如果消息不是来自群聊, 则返回None
|
||||
|
||||
isgroup = room is not None
|
||||
ctype = cmsg.ctype
|
||||
context = self._compose_context(ctype, cmsg.content, isgroup=isgroup, msg=cmsg)
|
||||
|
||||
Reference in New Issue
Block a user