python3.12.4 使用GetListenMessage()方法监听新消息出现如下错误
Traceback (most recent call last):
File "C:\Users\jhb\wx_robot\pythonProject1\demo.py", line 21, in
msgs = wx.GetListenMessage()
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\jhb\wx_robot\pythonProject1.venv\Lib\site-packages\wxauto\wxauto.py", line 592, in GetListenMessage
msg = chat.GetNewMessage(savepic=chat.savepic)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\jhb\wx_robot\pythonProject1.venv\Lib\site-packages\wxauto\elements.py", line 339, in GetNewMessage
if newmsgs[0].type == 'sys' and newmsgs[0].content == self._lang('查看更多消息'):
IndexError: list index out of range
在339后打印了一下发现是个空列表
加了一条判断后if len(newmsgs) > 0:能跑起来
python3.12.4 使用GetListenMessage()方法监听新消息出现如下错误 Traceback (most recent call last): File "C:\Users\jhb\wx_robot\pythonProject1\demo.py", line 21, in
msgs = wx.GetListenMessage()
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\jhb\wx_robot\pythonProject1.venv\Lib\site-packages\wxauto\wxauto.py", line 592, in GetListenMessage
msg = chat.GetNewMessage(savepic=chat.savepic)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\jhb\wx_robot\pythonProject1.venv\Lib\site-packages\wxauto\elements.py", line 339, in GetNewMessage
if newmsgs[0].type == 'sys' and newmsgs[0].content == self._lang('查看更多消息'):