cixingguangming55555 / wechat-bot

带二次开发接口的PC微信聊天机器人
MIT License
2.4k stars 657 forks source link

偶尔会以下错误,似乎是ws那边的bug #151

Closed shirubei closed 1 year ago

shirubei commented 2 years ago

感谢您分享的程序。在运用中,偶尔会出现以下错误,不是很频繁,还无法确定是什么原因或者说规律吧。似乎是ws那边的bug on_error:'str' object cannot be interpreted as an integer

cixingguangming55555 commented 2 years ago

应该是你客户端代码的问题吧

shirubei commented 2 years ago

应该是你客户端代码的问题吧 多谢回复,我的on_error只写了下面2行。我的理解是,花括号里的error是ws传给我的。 不知道这样的认识是否正确。如有误,请指正。谢谢!

def on_error(ws, error): output(f'on_error:{error}')

另外,调用到on_error的只有以下这一行 ws = websocket.WebSocketApp(SERVER, on_open = on_open, on_message = on_message, on_error = on_error, on_close = on_close)

shirubei commented 2 years ago

应该是你客户端代码的问题吧

查到规律了,就是每次往群里加人的时候,一定报这个错误。

shirubei commented 1 year ago

不好意思,是我代码的问题。