itchatmp icon indicating copy to clipboard operation
itchatmp copied to clipboard

使用被动回复,抛出‘TypeError'异常

Open ShenKeeeew opened this issue 7 years ago • 1 comments

使用被动回复接口时,抛出异常,比较奇怪的是有时出错,有时正常,是不是网络问题的锅? 代码如下: @itchatmp.msg_register(itchatmp.content.LINK) def linx_reply(msg): if u'红包' in msg['Title']: red_dict[msg['FromUserName']] = msg['Url'] #下面方法为向某网站api接口请求数据 conunt_left = connect_mtdhb.update_counts() return u'系统可用红包点数为 ' + str(conunt_left) + ',请输入红包密令' 异常日志如下: Traceback (most recent call last): File "/usr/local/lib/python3.6/site-packages/tornado/web.py", line 1592, in _execute result = yield result File "/usr/local/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run value = future.result() File "/usr/local/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run yielded = self.gen.throw(*exc_info) File "/usr/local/lib/python3.6/site-packages/itchatmp/components/register.py", line 236, in post (rawReply, rawReply.get('ToUserName', ''))) File "/usr/local/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run value = future.result() File "/usr/local/lib/python3.6/concurrent/futures/_base.py", line 425, in result return self.__get_result() File "/usr/local/lib/python3.6/concurrent/futures/_base.py", line 384, in __get_result raise self._exception File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run result = self.fn(*self.args, **self.kwargs) TypeError: send() missing 1 required positional argument: 'toUserName'

ShenKeeeew avatar Oct 15 '18 02:10 ShenKeeeew

去年10月都没人回复啊?我也是遇到类似错误,不知道如何解决,调试两天了

archerhu77 avatar Dec 03 '19 06:12 archerhu77