JQ-Networks/UnifiedMessageRelay

debian 7 wheezy下同时转发多个群聊出现unhandled exception

hyzaoia opened this issue · 4 comments

在FORWARD_LIST中按如下方式添加了三个群的转发:

FORWARD_LIST = [
    {'QQ': *****3978,
     'TG': -2*****106,
     'DRIVE_MODE': False,
     'IMAGE_LINK': True},
    {'QQ': *****7300,
     'TG': -2*****139,
     'DRIVE_MODE': False,
     'IMAGE_LINK': True},
    {'QQ': 5*****399,
     'TG': -31*****01,
     'DRIVE_MODE': False,
     'IMAGE_LINK': True} 
]

尝试启动的时候会出现以下错误:

[CTB.root][ERROR] (daemon.py:51): Unhandled exception: Traceback (most recent call last):
  File "daemon.py", line 158, in <module>
    main()
  File "daemon.py", line 154, in main
    daemon.run()
  File "daemon.py", line 120, in run
    import plugins  # load all plugins
  File "/root/ForapheQQbot/coolq-telegram-bot/plugins/__init__.py", line 1, in <module>
    import plugins.qq_namelist
  File "/root/ForapheQQbot/coolq-telegram-bot/plugins/qq_namelist.py", line 52, in <module>
    reload_all_qq_namelist()
  File "/root/ForapheQQbot/coolq-telegram-bot/plugins/qq_namelist.py", line 22, in reload_all_qq_namelist
    reload_qq_namelist(i)
  File "/root/ForapheQQbot/coolq-telegram-bot/plugins/qq_namelist.py", line 17, in reload_qq_namelist
    global_vars.group_members[forward_index] = global_vars.qq_bot.get_group_member_list(group_id=FORWARD_LIST[forward_index]['QQ'])
  File "/root/ForapheQQbot/coolq-telegram-bot/cqhttp/__init__.py", line 41, in __call__
    raise Error(resp.status_code, data.get('retcode'))
cqhttp.Error: (200, 102)

此时bot仍然能够收到tg端发送的指令,并且转发也不进行,即使使用了!!update namelist也无效
看样子是qq_namelist读取的循环出现问题。

OS: Linux Debian 7 x64 (wheezy)
Wine 3.0.2
CoolQ Air
Xrdp
Python 3.6.3

同时在ctrl+c强制结束的时候也会出现不同的提示

Exception ignored in: <module 'threading' from '/usr/local/lib/python3.6/threading.py'>
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/threading.py", line 1294, in _shutdown
    t.join()
  File "/usr/local/lib/python3.6/threading.py", line 1056, in join
    self._wait_for_tstate_lock()
  File "/usr/local/lib/python3.6/threading.py", line 1072, in _wait_for_tstate_lock
    elif lock.acquire(block, timeout):
KeyboardInterrupt

不知道是什么问题,是FORWARD_LIST的错误还是代码issue?搜寻网络没有得到有用的结果。

只转发一个群聊的时候可以正常使用,两边的转发和日志都很正常。

Z4HD commented

你遇到了 CQ码= 102的错误,建议重启无果后检查你的Bot能否在要进行消息转发的QQ群中正常发言。

QQ <=?=> CQ <=✔=> CTB <=✔=> TG


下个版本(3.4)会考虑handle这个问题。

@hyzaoia 102为coolq异常的代码,重新登录coolq试试,还不行的话睡一觉起来再试

@Z4HD 转发一个群的时候可以正常发言,没有尝试直接通过cq发言,明天(今天?)试试
@jqqqqqqqqqq 睡觉起来尝试一下
现在的解决办法是放一大堆名为bot_constant.py.something的配置文件 )

睡一觉起来就好了(笑),close,如果能考虑把handle这个问题的代码加入下一个版本就太好了