offu/WeRoBot

发送语音消息报错

Opened this issue · 0 comments

Traceback (most recent call last):
File "/www/server/pyporject_evn/gzh_com_venv/bin/bottle.py", line 995, in _handle
out = route.call(**args)
File "/www/server/pyporject_evn/gzh_com_venv/bin/bottle.py", line 2025, in wrapper
rv = callback(*a, **ka)
File "/www/server/pyporject_evn/gzh_com_venv/lib/python3.8/site-packages/werobot/contrib/bottle.py", line 55, in werobot_view
return robot.get_encrypted_reply(message)
File "/www/server/pyporject_evn/gzh_com_venv/lib/python3.8/site-packages/werobot/robot.py", line 616, in get_encrypted_reply
return self.crypto.encrypt_message(reply)
File "/www/server/pyporject_evn/gzh_com_venv/lib/python3.8/site-packages/werobot/crypto/init.py", line 133, in encrypt_message
encrypt = to_text(self.prp_crypto.encrypt(reply, self.app_id))
File "/www/server/pyporject_evn/gzh_com_venv/lib/python3.8/site-packages/werobot/crypto/init.py", line 53, in encrypt
struct.pack(b"I", socket.htonl(len(to_binary(text)))),
File "/www/server/pyporject_evn/gzh_com_venv/lib/python3.8/site-packages/werobot/utils.py", line 66, in to_binary
return bytes(value)
TypeError: 'str' object cannot be interpreted as an integer
Traceback (most recent call last):
File "/www/server/pyporject_evn/gzh_com_venv/bin/bottle.py", line 995, in _handle
out = route.call(**args)
File "/www/server/pyporject_evn/gzh_com_venv/bin/bottle.py", line 2025, in wrapper
rv = callback(*a, **ka)
File "/www/server/pyporject_evn/gzh_com_venv/lib/python3.8/site-packages/werobot/contrib/bottle.py", line 55, in werobot_view
return robot.get_encrypted_reply(message)
File "/www/server/pyporject_evn/gzh_com_venv/lib/python3.8/site-packages/werobot/robot.py", line 616, in get_encrypted_reply
return self.crypto.encrypt_message(reply)
File "/www/server/pyporject_evn/gzh_com_venv/lib/python3.8/site-packages/werobot/crypto/init.py", line 133, in encrypt_message
encrypt = to_text(self.prp_crypto.encrypt(reply, self.app_id))
File "/www/server/pyporject_evn/gzh_com_venv/lib/python3.8/site-packages/werobot/crypto/init.py", line 53, in encrypt
struct.pack(b"I", socket.htonl(len(to_binary(text)))),
File "/www/server/pyporject_evn/gzh_com_venv/lib/python3.8/site-packages/werobot/utils.py", line 66, in to_binary
return bytes(value)
TypeError: 'str' object cannot be interpreted as an integer


* **复现步骤**

* **其他信息**
<!-- 如对 bug 修复的建议、相关 issue 或 PR 的引用等信息 -->