ehForwarderBot / efb-qq-slave

EFB QQ Slave, a channel for EH Forwarder Bot. EFB QQ从端
GNU General Public License v3.0
448 stars 48 forks source link

TypeError: string indices must be integers #36

Closed bao3 closed 5 years ago

bao3 commented 5 years ago

可以启动,但是启动后很快就收到这个错误,因此我在 TG 上使用 /chat ,结果是没有任何事情发生。这会是什么问题?

Exception in thread Thread-2:
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/usr/local/lib/python3.6/threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/lib/python3.6/site-packages/efb_qq_slave/__init__.py", line 81, in poll
    self.init_client_manager()
  File "/usr/local/lib/python3.6/site-packages/efb_qq_slave/__init__.py", line 72, in init_client_manager
    self.QQClientMgr = ClientMgr(self.config['Client'], self.config, self)
  File "/usr/local/lib/python3.6/site-packages/efb_qq_slave/ClientMgr.py", line 22, in __init__
    self.client = cls(name, config, channel)
  File "/usr/local/lib/python3.6/site-packages/efb_qq_slave/Clients/CoolQ/CoolQ.py", line 58, in __init__
    self.coolq_bot = CQHttp(api_root=self.client_config['api_root'],
TypeError: string indices must be integers
bao3 commented 5 years ago

在上述情况下,如果我在 TG 里使用 /chat,则发生:


2019-08-17 03:21:15,309 [ERROR]: telegram.ext.dispatcher (dispatcher.process_update; dispatcher.py:301)
    An uncaught error was raised while processing the update
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/telegram/ext/dispatcher.py", line 279, in process_update
    handler.handle_update(update, self)
  File "/usr/local/lib/python3.6/site-packages/telegram/ext/commandhandler.py", line 173, in handle_update
    return self.callback(dispatcher.bot, update, **optional_args)
  File "/usr/local/lib/python3.6/site-packages/efb_telegram_master/chat_binding.py", line 666, in start_chat_list
    return self.chat_head_req_generate(bot, target, pattern=" ".join(args), chats=chats)
  File "/usr/local/lib/python3.6/site-packages/efb_telegram_master/chat_binding.py", line 715, in chat_head_req_generate
    source_chats=chats)
  File "/usr/local/lib/python3.6/site-packages/efb_telegram_master/chat_binding.py", line 318, in slave_chats_pagination
    slave_chats = slave.get_chats()
  File "/usr/local/lib/python3.6/site-packages/efb_qq_slave/__init__.py", line 94, in get_chats
    return self.QQClient.get_chats()
AttributeError: 'function' object has no attribute 'get_chats'
milkice233 commented 5 years ago

配置文件有误,请检查

bao3 commented 5 years ago

@milkice233 感谢指点。 错误原因:

1. config.yml 文件自己修改过,后来直接复制了这个 repo 的就没问题
2. 自己没有注意到需要自己下载 coolq 的 HTTP 插件。没有这个是不可能成功的。

希望后来人,可以看到这个,少走弯路。 可以 close 了。