Giter Club home page Giter Club logo

efb-qq-plugin-go-cqhttp's Introduction

EH Forwarder Bot

Python >= 3.6

GitHub Discussions

Telegram

Documentation

Tests status

PyPI release

Downloads per month

Codacy grade

Translate this project

Banner

Codename EH Forwarder Bot (EFB) is an extensible message tunneling chat bot framework which delivers messages to and from multiple platforms and remotely control your accounts.

Read the Documentation. For tips, tricks and community contributed articles, see project wiki.

Getting Started

  1. Install the framework:

    pip3 install ehforwarderbot
  2. Install modules from the module repository.
  3. Enable and set up modules:

    efb-wizard
  4. Launch EFB:

    ehforwarderbot

Feel like contributing?

Everyone is welcomed to raise an issue or submit a pull request, just remember to read through and follow the contribution guideline before you do so.

License

EFB framework is licensed under GNU Affero General Public License 3.0 or later versions:

EH Forwarder Bot: An extensible message tunneling chat bot framework.
Copyright (C) 2016 - 2020 Eana Hufwe, and the EH Forwarder Bot contributors
All rights reserved.

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.

Translation support

EFB supports translated user interface prompts, by setting the locale environmental variable (LANGUAGE, LC_ALL, LC_MESSAGES or LANG) to one of our supported languages. Our documentation is also available in different languages. You can help to translate this project into your languages on our Crowdin page.

efb-qq-plugin-go-cqhttp's People

Contributors

0honus0 avatar ashinch avatar cgluwxh avatar milkice233 avatar ojhdt avatar omg-xtao avatar pre-commit-ci[bot] avatar sakarie9 avatar shejialuo avatar xiexiaopeng2002 avatar xyenon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

efb-qq-plugin-go-cqhttp's Issues

依旧无法接收文件

2022-07-28 12:33:42,408 [DEBUG]: peewee (peewee.execute_sql; peewee.py:3185)
('INSERT INTO "msglog" ("master_msg_id", "master_msg_id_alt", "slave_message_id", "text", "slave_origin_uid", "slave_member_uid", "media_type", "mime", "file_id", "file_unique_id", "msg_type", "sent_to", "time") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', ['93189374.62', None, 'offline_file.1658982820', '小号小号(.) uploaded a file to you\nFilename: DSC07323.xmp\nFile size: 8751', 'milkice.qq offline_file', 'milkice.qq system offline_file', 'Text', None, None, None, 'Text', 'blueset.telegram', datetime.datetime(2022, 7, 28, 12, 33, 42, 406179)])
2022-07-28 12:33:42,451 [DEBUG]: efb_telegram_master.db (db.add_or_update_message_log; db.py:420)
[93189374.62] Database insert/update outcome: 1
2022-07-28 12:33:42,455 [DEBUG]: urllib3.connectionpool (connectionpool._new_conn; connectionpool.py:228)
Starting new HTTP connection (1): 14.22.6.247:80
2022-07-28 12:33:42,502 [DEBUG]: urllib3.connectionpool (connectionpool._make_request; connectionpool.py:456)
http://14.22.6.247:80 "GET /ftn_handler/ebce6c4164c601659ae029a5c4141e2bd18e9ac45a53f669ee82f5e62547973f2a60d859cd33de0d03882c3597bd678e72997a9070976e573affb08384b679ee HTTP/1.1" 200 8751
2022-07-28 12:33:42,559 [ERROR]: asyncio (base_events.default_exception_handler; base_events.py:1707)
Task exception was never retrieved
future: <Task finished name='Task-55' coro=<GoCQHttp.init..handle_offline_file_upload_msg.._handle_offline_file_upload_msg() done, defined at /usr/local/lib/python3.8/site-packages/efb_qq_plugin_go_cqhttp/GoCQHttp.py:356> exception=RuntimeError('asyncio.run() cannot be called from a running event loop')>
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/efb_qq_plugin_go_cqhttp/GoCQHttp.py", line 369, in _handle_offline_file_upload_msg
await self.async_download_file(**param_dict)
File "/usr/local/lib/python3.8/site-packages/efb_qq_plugin_go_cqhttp/GoCQHttp.py", line 1058, in async_download_file
efb_msg.chat = asyncio.run(self.chat_manager.build_efb_chat_as_private(context))
File "/usr/local/lib/python3.8/asyncio/runners.py", line 33, in run
raise RuntimeError(
RuntimeError: asyncio.run() cannot be called from a running event loop
/usr/local/lib/python3.8/asyncio/base_events.py:1844: RuntimeWarning: coroutine 'ChatManager.build_efb_chat_as_private' was never awaited
handle = self._ready.popleft()
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
2022-07-28 12:33:45,071 [INFO]: quart.app (init._handle_event; init.py:596)
received event: meta_event.heartbeat
[2022-07-28 12:33:45,071] INFO in init: received event: meta_event.heartbeat
2022-07-28 12:33:45,146 [DEBUG]: telegram.bot (bot.get_updates; bot.py:3068)
No new updates found.

依旧不能接收文件

提示qq slave不支持视频

如题,发送视频文件或其他文件都提示qq slave不支持,请问是什么原因呢,直接拉的docker-compose

初始化客户端报错 KeyError: 'Client'

从端是go-cqhttp并配置完成,启动go-cqhttp没有问题且可以正常接收群消息,错误日志如下
guys@guys-virtual-machine:~/.ehforwarderbot/profiles/default$ ehforwarderbot
2021-10-14 11:17:17,425 [Level 99]: ehforwarderbot.main (main.init; main.py:129)
正在初始化从端 milkice.qq#default…
Traceback (most recent call last):
File "/usr/local/bin/ehforwarderbot", line 8, in
sys.exit(main())
File "/usr/local/lib/python3.8/dist-packages/ehforwarderbot/main.py", line 335, in main
init(conf)
File "/usr/local/lib/python3.8/dist-packages/ehforwarderbot/main.py", line 135, in init
coordinator.add_channel(cls(instance_id=instance_id))
File "/usr/local/lib/python3.8/dist-packages/efb_qq_slave/init.py", line 44, in init
self.init_client_manager()
File "/usr/local/lib/python3.8/dist-packages/efb_qq_slave/init.py", line 73, in init_client_manager
self.QQClientMgr = ClientMgr(self.config['Client'], self.config, self)
KeyError: 'Client'

python3.9版本,唯独最后一步启动EFB出错了

efb与cqhttp断线,efb可以接收消息但无法发送

efb与cqhttp断线,efb提示断线,但是cqhttp的消息依旧可以发送到efb,efb无法发送到cqhttp
image
efb extra中查询到的命令/h_1_relogin无法重登

2021-07-02 02:26:11,192 [ERROR]: efb_telegram_master (__init__.error; __init__.py:552)
    Unhandled telegram bot error!
Update {'message': {'group_chat_created': False, 'supergroup_chat_created': False, 'text': '/h_1_relogin', 'channel_chat_created': False, 'date': 1625192770, 'new_chat_members': [], 'chat': {'type': 'private', 'id': xxxxx, 'username': 'xxxxx', 'first_name': 'xxxxx'}, 'message_id': 2252, 'new_chat_photo': [], 'entities': [{'type': 'bot_command', 'length': 12, 'offset': 0}], 'photo': [], 'caption_entities': [], 'delete_chat_photo': False, 'from': {'language_code': 'zh-hans', 'is_bot': False, 'id': xxxxx, 'username': 'xxxxx', 'first_name': 'xxxxx'}}, 'update_id': 532963185} caused error 'function' object has no attribute 'name'. Exception
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/efb_telegram_master/__init__.py", line 480, in error
    raise error
  File "/usr/local/lib/python3.9/site-packages/telegram/ext/dispatcher.py", line 555, in process_update
    handler.handle_update(update, self, check, context)
  File "/usr/local/lib/python3.9/site-packages/telegram/ext/handler.py", line 198, in handle_update
    return self.callback(update, context)
  File "/usr/local/lib/python3.9/site-packages/efb_telegram_master/commands.py", line 219, in extra_usage
    html.escape(command.name),
AttributeError: 'function' object has no attribute 'name'

efb、efb-telegram-master、efb-qq-slave都是pip install git+ 最新commit
= =

无法接收文件

/home/riley/.local/lib/python3.10/site-packages/efb_qq_plugin_go_cqhttp/GoCQHttp.py:369: RuntimeWarning: coroutine 'GoCQHttp.async_download_file' was never awaited
  self.async_download_file(**param_dict)
RuntimeWarning: Enable tracemalloc to get the object allocation traceback

从cqhttp到slave到plugin都是最新版

不支持回覆的消息

QQ 上收到「回覆」類型的消息(手機 QQ 上通過長按消息選擇「回覆」)會被直接無視掉,有點影響聊天。不知道做成對應的 EFB 式的回覆難度如何,但是簡化一下只是內容發出來的話應該不會有很大工作量。

改进:能否在接收暂不支持的消息类型时显示消息来源

在接收语音等暂不支持的消息类型时,会显示“不支持的消息类型”,但会转发该提示信息到tg主端,这样会导致不知道该不支持的消息来自哪个联系人或者哪个群组。这种情况下,往往要打开QQ,查找这条消息是否来自重要的联系人或者是值得关注的消息,在添加群组较多的时候,会造成混乱。
希望在显示不支持的消息类型的提示时,能够显示更丰富的信息,例如:来自于”联系人:名称“或者来自于“群组:名称”

无法发送QQ群聊消息

问题描述:

qq联系人: 发送/接受消息正常
qq群: 接受消息正常,发送消息失败

发送qq群消息失败log:

telegram log

Message is not sent.

CoolQAPIFailureException('CoolQ HTTP API encountered an error!\nStatus Code:200 Return Code:100')

ehforwarderbot log

Sep 12 23:37:20 one ehforwarderbot[647]: 2021-09-12 23:37:20,662 [ERROR]: efb_telegram_master.master_message (master_message.process_telegram_message; master_message.py:411)
Sep 12 23:37:20 one ehforwarderbot[647]:     Message is not sent. (update: {'update_id': 310439758, 'message': {'text': 'test message', 'delete_chat_photo': False, 'chat': {'type': 'private', 'first_name': 'Riley', 'id': xxxxxxxxx, 'last_name': 'Soong'}, 'group_chat_created': False, 'new_chat_members': [], 'message_id': 1716, 'new_chat_photo': [], 'reply_to_message': {'text': '🐧👥 xxx [xxx]:\nxxxxxxxxx', 'delete_chat_photo': False, 'chat': {'type': 'private', 'first_name': 'Riley', 'id': xxxxxxxxxx, 'last_name': 'Soong'}, 'group_chat_created': False, 'new_chat_members': [], 'message_id': 1502, 'new_chat_photo': [], 'caption_entities': [], 'photo': [], 'entities': [], 'supergroup_chat_created': False, 'date': 1631454950, 'channel_chat_created': False, 'from': {'id': xxxxxxxxxx, 'is_bot': True, 'username': 'xxxxxxxxx', 'first_name': 'QQ Console'}}, 'caption_entities': [], 'photo': [], 'entities': [], 'supergroup_chat_created': False, 'date': 1631461034, 'channel_chat_created': False, 'from': {'language_code': 'en', 'id': xxxxxxxxxxxx, 'is_bot': False, 'last_name': 'Soong', 'first_name': 'Riley'}}}, exception: CoolQ HTTP API encountered an error!
Sep 12 23:37:20 one ehforwarderbot[647]: Status Code:200 Return Code:100)
Sep 12 23:37:20 one ehforwarderbot[647]: Traceback (most recent call last):
Sep 12 23:37:20 one ehforwarderbot[647]:   File "/home/riley/.local/lib/python3.9/site-packages/efb_qq_plugin_go_cqhttp/GoCQHttp.py", line 644, in _coolq_api_wrapper
Sep 12 23:37:20 one ehforwarderbot[647]:     res = func(**kwargs)
Sep 12 23:37:20 one ehforwarderbot[647]:   File "/home/riley/.local/lib/python3.9/site-packages/cqhttp/__init__.py", line 25, in do_call
Sep 12 23:37:20 one ehforwarderbot[647]:     raise Error(resp.status_code, data.get('retcode'))
Sep 12 23:37:20 one ehforwarderbot[647]: cqhttp.Error: (200, 100)
Sep 12 23:37:20 one ehforwarderbot[647]: During handling of the above exception, another exception occurred:
Sep 12 23:37:20 one ehforwarderbot[647]: Traceback (most recent call last):
Sep 12 23:37:20 one ehforwarderbot[647]:   File "/usr/lib/python3.9/site-packages/efb_telegram_master/master_message.py", line 394, in process_telegram_message
Sep 12 23:37:20 one ehforwarderbot[647]:     slave_msg = coordinator.send_message(m)
Sep 12 23:37:20 one ehforwarderbot[647]:   File "/usr/lib/python3.9/site-packages/ehforwarderbot/coordinator.py", line 113, in send_message
Sep 12 23:37:20 one ehforwarderbot[647]:     return slaves[msg.deliver_to.channel_id].send_message(msg)
Sep 12 23:37:20 one ehforwarderbot[647]:   File "/home/riley/.local/lib/python3.9/site-packages/efb_qq_slave/__init__.py", line 80, in send_message
Sep 12 23:37:20 one ehforwarderbot[647]:     return self.QQClient.send_message(msg)
Sep 12 23:37:20 one ehforwarderbot[647]:   File "/home/riley/.local/lib/python3.9/site-packages/efb_qq_plugin_go_cqhttp/GoCQHttp.py", line 519, in send_message
Sep 12 23:37:20 one ehforwarderbot[647]:     msg.uid = self.coolq_send_message(chat_type[0], chat_type[1], msg.text)
Sep 12 23:37:20 one ehforwarderbot[647]:   File "/home/riley/.local/lib/python3.9/site-packages/efb_qq_plugin_go_cqhttp/GoCQHttp.py", line 638, in coolq_send_message
Sep 12 23:37:20 one ehforwarderbot[647]:     res = self.coolq_api_query('send_msg', message_type=msg_type, **{keyword + '_id': uid}, message=message)
Sep 12 23:37:20 one ehforwarderbot[647]:   File "/home/riley/.local/lib/python3.9/site-packages/efb_qq_plugin_go_cqhttp/GoCQHttp.py", line 671, in coolq_api_query
Sep 12 23:37:20 one ehforwarderbot[647]:     return self._coolq_api_wrapper(func_name, **kwargs)
Sep 12 23:37:20 one ehforwarderbot[647]:   File "/home/riley/.local/lib/python3.9/site-packages/efb_qq_plugin_go_cqhttp/GoCQHttp.py", line 654, in _coolq_api_wrapper
Sep 12 23:37:20 one ehforwarderbot[647]:     raise api_ex
Sep 12 23:37:20 one ehforwarderbot[647]: efb_qq_plugin_go_cqhttp.Exceptions.CoolQAPIFailureException: CoolQ HTTP API encountered an error!
Sep 12 23:37:20 one ehforwarderbot[647]: Status Code:200 Return Code:100

ehforwarder-cqhttp log

Sep 12 23:37:19 one go-cqhttp[485]: [2021-09-12 23:37:19] [WARNING]: 群消息发送失败: 账号可能被风控.

后续又试了一次手动调用并开启debug,仍然失败:ehforwarder-cqhttp log

Sep 13 00:02:55 one go-cqhttp[10727]: [2021-09-13 00:02:55] [DEBUG]: HTTPServer接收到API调用: send_group_msg
Sep 13 00:02:55 one go-cqhttp[10727]: [2021-09-13 00:02:55] [DEBUG]: Protocol -> rev pkt: MessageSvc.PbSendMsg seq: 13922
Sep 13 00:02:56 one go-cqhttp[10727]: [2021-09-13 00:02:56] [DEBUG]: Protocol -> rev pkt: Heartbeat.Alive seq: 13923
Sep 13 00:03:00 one go-cqhttp[10727]: [2021-09-13 00:03:00] [DEBUG]: Protocol -> rev pkt: OidbSvc.0x88d_0 seq: 13924
Sep 13 00:03:00 one go-cqhttp[10727]: [2021-09-13 00:03:00] [DEBUG]: Protocol -> rev pkt: MessageSvc.PbGetGroupMsg seq: 13925
Sep 13 00:03:00 one go-cqhttp[10727]: [2021-09-13 00:03:00] [WARNING]: 群消息发送失败: 账号可能被风控.

配置文件

milkice.qq/config.yaml

 Client: GoCQHttp                      # 指定要使用的 QQ 客户端(此处为 GoCQHttp)
 GoCQHttp:
     type: HTTP                        # 指定 efb-qq-plugin-go-cqhttp 与 GoCQHttp 通信的方式 现阶段仅支持 HTTP
     access_token:
     api_root: http://127.0.0.1:5700/  # GoCQHttp API接口地址/端口
     host: 127.0.0.1                   # efb-qq-slave 所监听的地址用于接收消息
     port: 8000                        # 同上

cqhttp/config.yml

# go-cqhttp 默认配置文件

account: # 账号相关
  uin: xxxxxxxxxxxxx # QQ账号
  password: '' # 密码为空时使用扫码登录
  encrypt: false  # 是否开启密码加密
  status: 0      # 在线状态 请参考 https://docs.go-cqhttp.org/guide/config.html#在线状态
  relogin: # 重连设置
    delay: 3   # 首次重连延迟, 单位秒
    interval: 3   # 重连间隔
    max-times: 0  # 最大重连次数, 0为无限制

  # 是否使用服务器下发的新地址进行重连
  # 注意, 此设置可能导致在海外服务器上连接情况更差
  use-sso-address: true

heartbeat:
  # 心跳频率, 单位秒
  # -1 为关闭心跳
  interval: 5

message:
  # 上报数据类型
  # 可选: string,array
  post-format: array
  # 是否忽略无效的CQ码, 如果为假将原样发送
  ignore-invalid-cqcode: false
  # 是否强制分片发送消息
  # 分片发送将会带来更快的速度
  # 但是兼容性会有些问题
  force-fragment: false
  # 是否将url分片发送
  fix-url: false
  # 下载图片等请求网络代理
  proxy-rewrite: ''
  # 是否上报自身消息
  report-self-message: false
  # 移除服务端的Reply附带的At
  remove-reply-at: false
  # 为Reply附加更多信息
  extra-reply-data: true
  # 跳过 Mime 扫描, 忽略错误数据
  skip-mime-scan: false

output:
  # 日志等级 trace,debug,info,warn,error
  log-level: warn
  # 日志时效 单位天. 超过这个时间之前的日志将会被自动删除. 设置为 0 表示永久保留.
  log-aging: 15
  # 是否在每次启动时强制创建全新的文件储存日志. 为 false 的情况下将会在上次启动时创建的日志文件续写
  log-force-new: true
  # 是否启用 DEBUG
  debug: false # 开启调试模式

# 默认中间件锚点
default-middlewares: &default
  # 访问密钥, 强烈推荐在公网的服务器设置
  access-token: ''
  # 事件过滤器文件目录
  filter: ''
  # API限速设置
  # 该设置为全局生效
  # 原 cqhttp 虽然启用了 rate_limit 后缀, 但是基本没插件适配
  # 目前该限速设置为令牌桶算法, 请参考:
  # https://baike.baidu.com/item/%E4%BB%A4%E7%89%8C%E6%A1%B6%E7%AE%97%E6%B3%95/6597000?fr=aladdin
  rate-limit:
    enabled: false # 是否启用限速
    frequency: 1  # 令牌回复频率, 单位秒
    bucket: 1     # 令牌桶大小

database: # 数据库相关设置
  leveldb:
    # 是否启用内置leveldb数据库
    # 启用将会增加10-20MB的内存占用和一定的磁盘空间
    # 关闭将无法使用 撤回 回复 get_msg 等上下文相关功能
    enable: true

# 连接服务列表
servers:
  # 添加方式,同一连接方式可添加多个,具体配置说明请查看文档
  #- http: # http 通信
  #- ws:   # 正向 Websocket
  #- ws-reverse: # 反向 Websocket
  #- pprof: #性能分析服务器
  # HTTP 通信设置
  - http:
      # 服务端监听地址
      host: 127.0.0.1
      # 服务端监听端口
      port: 5700
      # 反向HTTP超时时间, 单位秒
      # 最小值为5,小于5将会忽略本项设置
      timeout: 5
      # 长轮询拓展
      long-polling:
        # 是否开启
        enabled: false
        # 消息队列大小,0 表示不限制队列大小,谨慎使用
        max-queue-size: 2000
      middlewares:
        <<: *default # 引用默认中间件
      # 反向HTTP POST地址列表
      post:
        - url: 'http://127.0.0.1:8000' # 地址
          secret: ''                   # 密钥保持为空
      #- url: '' # 地址
      #  secret: ''           # 密钥
      #- url: 127.0.0.1:5701 # 地址
      #  secret: ''          # 密钥

請求支援解析配置文件中的 hostname

2023-03-11 04:34:56,444 [Level 99]: ehforwarderbot.__main__ (__main__.init; __main__.py:129)
     Initializing slave milkice.qq... 
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/anyio/_core/_sockets.py", line 186, in connect_tcp
    addr_obj = ip_address(remote_host)
  File "/usr/local/lib/python3.9/ipaddress.py", line 53, in ip_address
    raise ValueError(f'{address!r} does not appear to be an IPv4 or IPv6 address')
ValueError: 'gocq' does not appear to be an IPv4 or IPv6 address

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/httpcore/_exceptions.py", line 10, in map_exceptions
    yield
  File "/usr/local/lib/python3.9/site-packages/httpcore/backends/asyncio.py", line 111, in connect_tcp
    stream: anyio.abc.ByteStream = await anyio.connect_tcp(
  File "/usr/local/lib/python3.9/site-packages/anyio/_core/_sockets.py", line 189, in connect_tcp
    gai_res = await getaddrinfo(
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.9/socket.py", line 954, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name does not resolve

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/httpx/_transports/default.py", line 60, in map_httpcore_exceptions
    yield
  File "/usr/local/lib/python3.9/site-packages/httpx/_transports/default.py", line 353, in handle_async_request
    resp = await self._pool.handle_async_request(req)
  File "/usr/local/lib/python3.9/site-packages/httpcore/_async/connection_pool.py", line 253, in handle_async_request
    raise exc
  File "/usr/local/lib/python3.9/site-packages/httpcore/_async/connection_pool.py", line 237, in handle_async_request
    response = await connection.handle_async_request(request)
  File "/usr/local/lib/python3.9/site-packages/httpcore/_async/connection.py", line 86, in handle_async_request
    raise exc
  File "/usr/local/lib/python3.9/site-packages/httpcore/_async/connection.py", line 63, in handle_async_request
    stream = await self._connect(request)
  File "/usr/local/lib/python3.9/site-packages/httpcore/_async/connection.py", line 111, in _connect
    stream = await self._network_backend.connect_tcp(**kwargs)
  File "/usr/local/lib/python3.9/site-packages/httpcore/backends/auto.py", line 29, in connect_tcp
    return await self._backend.connect_tcp(
  File "/usr/local/lib/python3.9/site-packages/httpcore/backends/asyncio.py", line 111, in connect_tcp
    stream: anyio.abc.ByteStream = await anyio.connect_tcp(
  File "/usr/local/lib/python3.9/contextlib.py", line 137, in __exit__
    self.gen.throw(typ, value, traceback)
  File "/usr/local/lib/python3.9/site-packages/httpcore/_exceptions.py", line 14, in map_exceptions
    raise to_exc(exc)
httpcore.ConnectError: [Errno -2] Name does not resolve

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/aiocqhttp/api_impl.py", line 66, in call_action
    resp = await client.post(self._api_root + action,
  File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 1848, in post
    return await self.request(
  File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 1533, in request
    return await self.send(request, auth=auth, follow_redirects=follow_redirects)
  File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 1620, in send
    response = await self._send_handling_auth(
  File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 1648, in _send_handling_auth
    response = await self._send_handling_redirects(
  File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 1685, in _send_handling_redirects
    response = await self._send_single_request(request)
  File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 1722, in _send_single_request
    response = await transport.handle_async_request(request)
  File "/usr/local/lib/python3.9/site-packages/httpx/_transports/default.py", line 353, in handle_async_request
    resp = await self._pool.handle_async_request(req)
  File "/usr/local/lib/python3.9/contextlib.py", line 137, in __exit__
    self.gen.throw(typ, value, traceback)
  File "/usr/local/lib/python3.9/site-packages/httpx/_transports/default.py", line 77, in map_httpcore_exceptions
    raise mapped_exc(message) from exc
httpx.ConnectError: [Errno -2] Name does not resolve

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/efb_qq_plugin_go_cqhttp/GoCQHttp.py", line 809, in _coolq_api_wrapper
    res = await self.coolq_bot.call_action(func_name, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/aiocqhttp/__init__.py", line 238, in call_action
    return await self._api.call_action(action=action, **params)
  File "/usr/local/lib/python3.9/site-packages/aiocqhttp/api_impl.py", line 185, in call_action
    result = await self._http_api.call_action(action, **params)
  File "/usr/local/lib/python3.9/site-packages/aiocqhttp/api_impl.py", line 75, in call_action
    raise NetworkError('HTTP request failed')
aiocqhttp.exceptions.NetworkError: HTTP request failed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/efb_qq_plugin_go_cqhttp/GoCQHttp.py", line 849, in check_status_periodically
    flag = await self.check_running_status()
  File "/usr/local/lib/python3.9/site-packages/efb_qq_plugin_go_cqhttp/GoCQHttp.py", line 826, in check_running_status
    res = await self._coolq_api_wrapper("get_status")
  File "/usr/local/lib/python3.9/site-packages/efb_qq_plugin_go_cqhttp/GoCQHttp.py", line 811, in _coolq_api_wrapper
    raise CoolQDisconnectedException(("Unable to connect to CoolQ Client!" "Error Message:\n{}").format(str(e)))
efb_qq_plugin_go_cqhttp.Exceptions.CoolQDisconnectedException: Unable to connect to CoolQ Client!Error Message:
HTTP request failed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/efb_qq_slave/ClientMgr.py", line 27, in __init__
    self.client = cls(name, config, channel)
  File "/usr/local/lib/python3.9/site-packages/efb_qq_plugin_go_cqhttp/GoCQHttp.py", line 531, in __init__
    asyncio.run(self.check_status_periodically(run_once=True))
  File "/usr/local/lib/python3.9/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/local/lib/python3.9/asyncio/base_events.py", line 647, in run_until_complete
    return future.result()
  File "/usr/local/lib/python3.9/site-packages/efb_qq_plugin_go_cqhttp/GoCQHttp.py", line 852, in check_status_periodically
    self.deliver_alert_to_master(
  File "/usr/local/lib/python3.9/site-packages/efb_qq_plugin_go_cqhttp/GoCQHttp.py", line 905, in deliver_alert_to_master
    self.send_msg_to_master(context)
  File "/usr/local/lib/python3.9/site-packages/efb_qq_plugin_go_cqhttp/GoCQHttp.py", line 977, in send_msg_to_master
    raise Exception(context["message"])
Exception: We're unable to communicate with CoolQ Client.
Please check the connection and credentials provided.
Unable to connect to CoolQ Client!Error Message:
HTTP request failed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/ehforwarderbot", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.9/site-packages/ehforwarderbot/__main__.py", line 335, in main
    init(conf)
  File "/usr/local/lib/python3.9/site-packages/ehforwarderbot/__main__.py", line 135, in init
    coordinator.add_channel(cls(instance_id=instance_id))
  File "/usr/local/lib/python3.9/site-packages/efb_qq_slave/__init__.py", line 44, in __init__
    self.init_client_manager()
  File "/usr/local/lib/python3.9/site-packages/efb_qq_slave/__init__.py", line 73, in init_client_manager
    self.QQClientMgr = ClientMgr(self.config['Client'], self.config, self)
  File "/usr/local/lib/python3.9/site-packages/efb_qq_slave/ClientMgr.py", line 30, in __init__
    raise Exception("Specified client not found!")
Exception: Specified client not found!

設置文件:

Client: GoCQHttp
GoCQHttp:
  type: HTTP                        # 指定 efb-qq-plugin-go-cqhttp 与 GoCQHttp 通信的方式 现阶段仅支持 HTTP
  access_token: xxx
  api_root: http://gocq:5700/  # GoCQHttp API接口地址/端口
  host: 0.0.0.0                   # efb-qq-slave 所监听的地址用于接收消息
  port: 5701                        # 同上

安装过程中出现Failed to build Pillow

使用pip install git+https://github.com/XYenon/efb-qq-plugin-go-cqhttp安装,过程中出现Failed to build Pillow
`
Building wheel for Pillow (setup.py) ... error
error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [175 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.8
creating build/lib.linux-x86_64-3.8/PIL
copying src/PIL/BdfFontFile.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/BlpImagePlugin.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/BmpImagePlugin.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/BufrStubImagePlugin.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/ContainerIO.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/CurImagePlugin.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/DcxImagePlugin.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/DdsImagePlugin.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/EpsImagePlugin.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/ExifTags.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/FitsStubImagePlugin.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/FliImagePlugin.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/FontFile.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/FpxImagePlugin.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/FtexImagePlugin.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/GbrImagePlugin.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/GdImageFile.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/GifImagePlugin.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/GimpGradientFile.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/GimpPaletteFile.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/GribStubImagePlugin.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/Hdf5StubImagePlugin.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/IcnsImagePlugin.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/IcoImagePlugin.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/ImImagePlugin.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/Image.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/ImageChops.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/ImageCms.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/ImageColor.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/ImageDraw.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/ImageDraw2.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/ImageEnhance.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/ImageFile.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/ImageFilter.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/ImageFont.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/ImageGrab.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/ImageMath.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/ImageMode.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/ImageMorph.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/ImageOps.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/ImagePalette.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/ImagePath.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/ImageQt.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/ImageSequence.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/ImageShow.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/ImageStat.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/ImageTk.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/ImageTransform.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/ImageWin.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/ImtImagePlugin.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/IptcImagePlugin.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/Jpeg2KImagePlugin.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/JpegImagePlugin.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/JpegPresets.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/McIdasImagePlugin.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/MicImagePlugin.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/MpegImagePlugin.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/MpoImagePlugin.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/MspImagePlugin.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/PSDraw.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/PaletteFile.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/PalmImagePlugin.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/PcdImagePlugin.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/PcfFontFile.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/PcxImagePlugin.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/PdfImagePlugin.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/PdfParser.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/PixarImagePlugin.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/PngImagePlugin.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/PpmImagePlugin.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/PsdImagePlugin.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/PyAccess.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/SgiImagePlugin.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/SpiderImagePlugin.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/SunImagePlugin.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/TarIO.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/TgaImagePlugin.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/TiffImagePlugin.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/TiffTags.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/WalImageFile.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/WebPImagePlugin.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/WmfImagePlugin.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/XVThumbImagePlugin.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/XbmImagePlugin.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/XpmImagePlugin.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/init.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/main.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/_binary.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/_tkinter_finder.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/_util.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/_version.py -> build/lib.linux-x86_64-3.8/PIL
copying src/PIL/features.py -> build/lib.linux-x86_64-3.8/PIL
running egg_info
writing src/Pillow.egg-info/PKG-INFO
writing dependency_links to src/Pillow.egg-info/dependency_links.txt
writing top-level names to src/Pillow.egg-info/top_level.txt
reading manifest file 'src/Pillow.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching '.c'
warning: no files found matching '
.h'
warning: no files found matching '.sh'
warning: no previously-included files found matching '.appveyor.yml'
warning: no previously-included files found matching '.clang-format'
warning: no previously-included files found matching '.coveragerc'
warning: no previously-included files found matching '.editorconfig'
warning: no previously-included files found matching '.readthedocs.yml'
warning: no previously-included files found matching 'codecov.yml'
warning: no previously-included files matching '.git
' found anywhere in distribution
warning: no previously-included files matching '.pyc' found anywhere in distribution
warning: no previously-included files matching '
.so' found anywhere in distribution
no previously-included directories found matching '.ci'
adding license file 'LICENSE'
writing manifest file 'src/Pillow.egg-info/SOURCES.txt'
running build_ext

  The headers or library files could not be found for jpeg,
  a required dependency when compiling Pillow from source.
  
  Please see the install instructions at:
     https://pillow.readthedocs.io/en/latest/installation.html
  
  Traceback (most recent call last):
    File "/tmp/pip-install-f8dxj38r/pillow_b8a5444cd30748ae8a41d2096105e73d/setup.py", line 989, in <module>
      setup(
    File "/usr/local/lib/python3.8/site-packages/setuptools/__init__.py", line 153, in setup
      return distutils.core.setup(**attrs)
    File "/usr/local/lib/python3.8/distutils/core.py", line 148, in setup
      dist.run_commands()
    File "/usr/local/lib/python3.8/distutils/dist.py", line 966, in run_commands
      self.run_command(cmd)
    File "/usr/local/lib/python3.8/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
    File "/usr/local/lib/python3.8/site-packages/wheel/bdist_wheel.py", line 299, in run
      self.run_command('build')
    File "/usr/local/lib/python3.8/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/usr/local/lib/python3.8/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
    File "/usr/local/lib/python3.8/distutils/command/build.py", line 135, in run
      self.run_command(cmd_name)
    File "/usr/local/lib/python3.8/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/usr/local/lib/python3.8/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
    File "/usr/local/lib/python3.8/site-packages/setuptools/command/build_ext.py", line 79, in run
      _build_ext.run(self)
    File "/usr/local/lib/python3.8/distutils/command/build_ext.py", line 340, in run
      self.build_extensions()
    File "/tmp/pip-install-f8dxj38r/pillow_b8a5444cd30748ae8a41d2096105e73d/setup.py", line 804, in build_extensions
      raise RequiredDependencyException(f)
  __main__.RequiredDependencyException: jpeg
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File "<string>", line 2, in <module>
    File "<pip-setuptools-caller>", line 34, in <module>
    File "/tmp/pip-install-f8dxj38r/pillow_b8a5444cd30748ae8a41d2096105e73d/setup.py", line 1009, in <module>
      raise RequiredDependencyException(msg)
  __main__.RequiredDependencyException:
  
  The headers or library files could not be found for jpeg,
  a required dependency when compiling Pillow from source.
  
  Please see the install instructions at:
     https://pillow.readthedocs.io/en/latest/installation.html
  
  
  [end of output]

`

群公告被显示为js数据,且内容不全

群消息中发布公告后,telegram接收到的是这样的形式:

{"app":"com.tencent.mannounce","config":{"ctime":1632017790,"forward":0,"token":"3d56417a2160c9f7cc4f3f09acdc44ff"},"desc":"群公告","extra":{"app_type":1,"appid":1101236949,"uin":1113447723},"meta":{"mannounce":{"cr":1,"encode":1,"fid":"4c02de36000000007e9d466181a70200","gc":"920519244","sign":"f0cc3e61506926cdd26900abd39a4f73","text":"6L+Z5piv5Y6f5p2l55qE5raI5oGv6L+Z5piv5Y6f5p2l55qE5raI5oGv6L+Z5piv5Y6f5p2l55qE5raI5oGv6L+Z5piv5Y6f5p2l55qE5raI5oGv6L+Z5piv5Y6f5p2l55qE5raI5oGv6L+Z5piv5Y6f5p2l55qE5raI5oGv6L+Z5piv5Y6f5p2l55qE5raI5oGv6L+Z5piv5Y6f5p2l55qE5raI5oGv6L+Z5piv5Y6f5p2l55qE5raI5oGv6L+Z5piv5Y6f5p2l55qE5raI5oGv6L+Z5piv5Y6f5p2l55qE5raI5oGv6L+Z5piv5Y6f5p2l55qE5raI5oGv6L+Z5piv5Y6f5p2l55qE5raI5oGv6L+Z5piv5Y6f5p2l55qE5raI5oGv6L+Z5piv5Y6f5p2l55qE5raI5oGv6L+Z5piv5Y6f5p2l55qE5raI5oGv6L+Z5piv5Y6f5p2l55qE5raI5oGv6L+Z5piv5Y6f5p2l55qE5raI5oGv6L+Z5piv5Y6f5p2l55qE5raI5oGv6L+Z5piv5Y6f5p2l55qE5raI5oGv6L+Z5piv5Y6f5p2l55qE5raI5oGvCg==","title":"576k5YWs5ZGK","tw":1,"uin":"1113447723"}},"prompt":"[群公告]这是原来的消息这是原来的消息这是原来的消息这是原来的消息这是原来的消息这是原来的消息这是原来的消 息这是原来的消息这是原来的消息这是原…","ver":"1.0.0.43","view":"main"}

这不是log,这就是telegram最终收到的信息。
而且可以看到text中是base64的加密信息,解密后可以得到完整的群公告。
但后面的prompt信息只显示了一定长度的信息,后面的信息被省略为...了。

希望能添加功能把com.tencent.mannounce应用转换为普通的text且保留完整信息。

收到的语音消息不能正常处理

Windows 10下运行EFB+ETM+EQS,当go-cqhttp收到语音消息时,EFB不能正常处理。
以下为错误信息

`2022-09-06 00:01:29,111 [ERROR]: efb_qq_plugin_go_cqhttp.MsgDecorator (MsgDecorator.qq_record_wrapper; MsgDecorator.py:72)
Failed to download voice
Traceback (most recent call last):
File "C:\Users\xyf20\AppData\Local\Programs\Python\Python39\lib\site-packages\efb_qq_plugin_go_cqhttp\Utils.py", line 764, in download_voice
pilk.decode(origin_file.name, pcm_file.name)
OSError: Error: could not open input file �

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\xyf20\AppData\Local\Programs\Python\Python39\lib\site-packages\efb_qq_plugin_go_cqhttp\MsgDecorator.py", line 63, in qq_record_wrapper
efb_msg.file = download_voice(data["url"])
File "C:\Users\xyf20\AppData\Local\Programs\Python\Python39\lib\site-packages\efb_qq_plugin_go_cqhttp\Utils.py", line 773, in download_voice
audio_file.close()
UnboundLocalError: local variable 'audio_file' referenced before assignment`

同时telegram侧收到如下消息
(不支持) [Voice Message] Please check it on your QQ

但是在Linux上跑EFB时,没有这个问题

初始化从端失败

这是efb的日志

2022-08-06 19:51:53,258 [Level 99]: ehforwarderbot.main (main.init; main.py:129)
正在初始化从端 milkice.qq…
Traceback (most recent call last):
File "/home/xh1045925330/anaconda3/envs/efb/lib/python3.8/site-packages/efb_qq_plugin_go_cqhttp/GoCQHttp.py", line 806, in _coolq_api_wrapper
res = await self.coolq_bot.call_action(func_name, **kwargs)
File "/home/xh1045925330/anaconda3/envs/efb/lib/python3.8/site-packages/aiocqhttp/init.py", line 238, in call_action
return await self._api.call_action(action=action, **params)
File "/home/xh1045925330/anaconda3/envs/efb/lib/python3.8/site-packages/aiocqhttp/api_impl.py", line 185, in call_action
result = await self._http_api.call_action(action, **params)
File "/home/xh1045925330/anaconda3/envs/efb/lib/python3.8/site-packages/aiocqhttp/api_impl.py", line 71, in call_action
raise HttpFailed(resp.status_code)
aiocqhttp.exceptions.HttpFailed: <HttpFailed, status_code=502>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/xh1045925330/anaconda3/envs/efb/lib/python3.8/site-packages/efb_qq_slave/ClientMgr.py", line 27, in init
self.client = cls(name, config, channel)
File "/home/xh1045925330/anaconda3/envs/efb/lib/python3.8/site-packages/efb_qq_plugin_go_cqhttp/GoCQHttp.py", line 528, in init
asyncio.run(self.check_status_periodically(run_once=True))
File "/home/xh1045925330/anaconda3/envs/efb/lib/python3.8/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/home/xh1045925330/anaconda3/envs/efb/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
return future.result()
File "/home/xh1045925330/anaconda3/envs/efb/lib/python3.8/site-packages/efb_qq_plugin_go_cqhttp/GoCQHttp.py", line 845, in check_status_periodically
flag = await self.check_running_status()
File "/home/xh1045925330/anaconda3/envs/efb/lib/python3.8/site-packages/efb_qq_plugin_go_cqhttp/GoCQHttp.py", line 822, in check_running_status
res = await self._coolq_api_wrapper("get_status")
File "/home/xh1045925330/anaconda3/envs/efb/lib/python3.8/site-packages/efb_qq_plugin_go_cqhttp/GoCQHttp.py", line 812, in _coolq_api_wrapper
ex.status_code, ex.retcode
AttributeError: 'HttpFailed' object has no attribute 'retcode'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/xh1045925330/anaconda3/envs/efb/bin/ehforwarderbot", line 8, in
sys.exit(main())
File "/home/xh1045925330/anaconda3/envs/efb/lib/python3.8/site-packages/ehforwarderbot/main.py", line 335, in main
init(conf)
File "/home/xh1045925330/anaconda3/envs/efb/lib/python3.8/site-packages/ehforwarderbot/main.py", line 135, in init
coordinator.add_channel(cls(instance_id=instance_id))
File "/home/xh1045925330/anaconda3/envs/efb/lib/python3.8/site-packages/efb_qq_slave/init.py", line 44, in init
self.init_client_manager()
File "/home/xh1045925330/anaconda3/envs/efb/lib/python3.8/site-packages/efb_qq_slave/init.py", line 73, in init_client_manager
self.QQClientMgr = ClientMgr(self.config['Client'], self.config, self)
File "/home/xh1045925330/anaconda3/envs/efb/lib/python3.8/site-packages/efb_qq_slave/ClientMgr.py", line 30, in init
raise Exception("Specified client not found!")
Exception: Specified client not found!

[Bug?] 发送合并转发消息时报错 KeyError: 'qq'

发送含大量消息的合并转发消息时报错。
经测试,转发消息量较少(<10)时可以成功转发,而转发消息量较大(>10)时则会报错。

错误日志:

2023-03-19 02:57:33,480 [ERROR]: asyncio (base_events.default_exception_handler; base_events.py:1707)
Task exception was never retrieved
future: <Task finished name='Task-104' coro=<GoCQHttp.init..handle_msg.._handle_msg() done, defined at /root/efb/lib/python3.8/site-packages/efb_qq_plugin_go_cqhttp/GoCQHttp.py:191> exception=KeyError('qq')>
Traceback (most recent call last):
File "/root/efb/lib/python3.8/site-packages/efb_qq_plugin_go_cqhttp/GoCQHttp.py", line 232, in _handle_msg
main_text, messages, at_dict = await message_elements_wrapper(context, msg_elements, chat)
File "/root/efb/lib/python3.8/site-packages/efb_qq_plugin_go_cqhttp/GoCQHttp.py", line 177, in message_elements_wrapper
sub_main_text, sub_messages, sub_at_list = await message_element_wrapper(context, msg_element, chat)
File "/root/efb/lib/python3.8/site-packages/efb_qq_plugin_go_cqhttp/GoCQHttp.py", line 164, in message_element_wrapper
main_text, messages, _ = await message_elements_wrapper(context, fmt_forward_msgs, chat)
File "/root/efb/lib/python3.8/site-packages/efb_qq_plugin_go_cqhttp/GoCQHttp.py", line 177, in message_elements_wrapper
sub_main_text, sub_messages, sub_at_list = await message_element_wrapper(context, msg_element, chat)
File "/root/efb/lib/python3.8/site-packages/efb_qq_plugin_go_cqhttp/GoCQHttp.py", line 150, in message_element_wrapper
ref_user = await self.get_user_info(msg_data["qq"])
KeyError: 'qq'

使用--verbose参数后日志:

2023-03-19 03:31:58,989 [DEBUG]: telegram.bot (bot.decorator; bot.py:135)
Exiting: get_updates
2023-03-19 03:31:58,990 [DEBUG]: telegram.bot (bot.decorator; bot.py:132)
Entering: get_updates
2023-03-19 03:32:06,262 [INFO]: quart.app (init._handle_event; init.py:596)
received event: message.private.friend
[2023-03-19 03:32:06,262] INFO in init: received event: message.private.friend
2023-03-19 03:32:06,264 [DEBUG]: efb_qq_plugin_go_cqhttp.GoCQHttp (GoCQHttp._handle_msg; GoCQHttp.py:192)
<Event, {'post_type': 'message', 'message_type': 'private', 'time': 1679196726, 'self_id': $some_id$, 'sub_type': 'friend', 'user_id': $some_id$, 'target_id': $some_id$, 'message': [{'type': 'forward', 'data': {'id': '$some_id$'}}], 'raw_message': '[CQ:forward,id=$some_id$]', 'font': 0, 'sender': {'age': 0, 'nickname': '$some_id$', 'sex': 'unknown', 'user_id': $some_id$}, 'message_id': -1273188789}>
2023-03-19 03:32:06,536 [INFO]: quart.app (init._handle_event; init.py:596)
received event: meta_event.heartbeat
[2023-03-19 03:32:06,536] INFO in init: received event: meta_event.heartbeat
2023-03-19 03:32:06,548 [ERROR]: asyncio (base_events.default_exception_handler; base_events.py:1707)
Task exception was never retrieved
future: <Task finished name='Task-456' coro=<GoCQHttp.init..handle_msg.._handle_msg() done, defined at /root/efb/lib/python3.8/site-packages/efb_qq_plugin_go_cqhttp/GoCQHttp.py:191> exception=KeyError('qq')>
Traceback (most recent call last):
File "/root/efb/lib/python3.8/site-packages/efb_qq_plugin_go_cqhttp/GoCQHttp.py", line 232, in _handle_msg
main_text, messages, at_dict = await message_elements_wrapper(context, msg_elements, chat)
File "/root/efb/lib/python3.8/site-packages/efb_qq_plugin_go_cqhttp/GoCQHttp.py", line 177, in message_elements_wrapper
sub_main_text, sub_messages, sub_at_list = await message_element_wrapper(context, msg_element, chat)
File "/root/efb/lib/python3.8/site-packages/efb_qq_plugin_go_cqhttp/GoCQHttp.py", line 164, in message_element_wrapper
main_text, messages, _ = await message_elements_wrapper(context, fmt_forward_msgs, chat)
File "/root/efb/lib/python3.8/site-packages/efb_qq_plugin_go_cqhttp/GoCQHttp.py", line 177, in message_elements_wrapper
sub_main_text, sub_messages, sub_at_list = await message_element_wrapper(context, msg_element, chat)
File "/root/efb/lib/python3.8/site-packages/efb_qq_plugin_go_cqhttp/GoCQHttp.py", line 150, in message_element_wrapper
ref_user = await self.get_user_info(msg_data["qq"])
KeyError: 'qq'
2023-03-19 03:32:06,568 [DEBUG]: httpx._client (_client._send_single_request; _client.py:1734)
HTTP Request: POST http://127.0.0.1:6700/get_forward_msg "HTTP/1.1 200 OK"
2023-03-19 03:32:06,573 [DEBUG]: root (GoCQHttp.message_element_wrapper; GoCQHttp.py:157)
Forwarded message: [$some_loooooog_message$]
2023-03-19 03:32:06,607 [DEBUG]: httpx._client (_client._send_single_request; _client.py:1734)
HTTP Request: POST http://127.0.0.1:6700/get_friend_list "HTTP/1.1 200 OK"
2023-03-19 03:32:06,611 [DEBUG]: efb_qq_plugin_go_cqhttp.GoCQHttp (GoCQHttp.update_friend_list; GoCQHttp.py:910)
Update friend list completed. Entries: 158
2023-03-19 03:32:06,646 [DEBUG]: httpx._client (_client._send_single_request; _client.py:1734)
HTTP Request: POST http://127.0.0.1:6700/get_friend_list "HTTP/1.1 200 OK"
2023-03-19 03:32:06,651 [DEBUG]: efb_qq_plugin_go_cqhttp.GoCQHttp (GoCQHttp.update_friend_list; GoCQHttp.py:910)
Update friend list completed. Entries: 158
2023-03-19 03:32:06,687 [DEBUG]: httpx._client (_client._send_single_request; _client.py:1734)
HTTP Request: POST http://127.0.0.1:6700/get_friend_list "HTTP/1.1 200 OK"
2023-03-19 03:32:06,692 [DEBUG]: efb_qq_plugin_go_cqhttp.GoCQHttp (GoCQHttp.update_friend_list; GoCQHttp.py:910)
Update friend list completed. Entries: 158
2023-03-19 03:32:06,727 [DEBUG]: httpx._client (_client._send_single_request; _client.py:1734)
HTTP Request: POST http://127.0.0.1:6700/get_friend_list "HTTP/1.1 200 OK"
2023-03-19 03:32:06,750 [DEBUG]: efb_qq_plugin_go_cqhttp.GoCQHttp (GoCQHttp.update_friend_list; GoCQHttp.py:910)
Update friend list completed. Entries: 158
2023-03-19 03:32:06,782 [DEBUG]: httpx._client (_client._send_single_request; _client.py:1734)
HTTP Request: POST http://127.0.0.1:6700/get_friend_list "HTTP/1.1 200 OK"
2023-03-19 03:32:06,787 [DEBUG]: efb_qq_plugin_go_cqhttp.GoCQHttp (GoCQHttp.update_friend_list; GoCQHttp.py:910)
Update friend list completed. Entries: 158
2023-03-19 03:32:06,822 [DEBUG]: httpx._client (_client._send_single_request; _client.py:1734)
HTTP Request: POST http://127.0.0.1:6700/get_friend_list "HTTP/1.1 200 OK"
2023-03-19 03:32:06,827 [DEBUG]: efb_qq_plugin_go_cqhttp.GoCQHttp (GoCQHttp.update_friend_list; GoCQHttp.py:910)
Update friend list completed. Entries: 158
2023-03-19 03:32:06,861 [DEBUG]: httpx._client (_client._send_single_request; _client.py:1734)
HTTP Request: POST http://127.0.0.1:6700/get_friend_list "HTTP/1.1 200 OK"
2023-03-19 03:32:06,865 [DEBUG]: efb_qq_plugin_go_cqhttp.GoCQHttp (GoCQHttp.update_friend_list; GoCQHttp.py:910)
Update friend list completed. Entries: 158
2023-03-19 03:32:06,904 [DEBUG]: httpx._client (_client._send_single_request; _client.py:1734)
HTTP Request: POST http://127.0.0.1:6700/get_friend_list "HTTP/1.1 200 OK"
2023-03-19 03:32:06,910 [DEBUG]: efb_qq_plugin_go_cqhttp.GoCQHttp (GoCQHttp.update_friend_list; GoCQHttp.py:910)
Update friend list completed. Entries: 158
2023-03-19 03:32:06,945 [DEBUG]: httpx._client (_client._send_single_request; _client.py:1734)
HTTP Request: POST http://127.0.0.1:6700/get_friend_list "HTTP/1.1 200 OK"
2023-03-19 03:32:06,967 [DEBUG]: efb_qq_plugin_go_cqhttp.GoCQHttp (GoCQHttp.update_friend_list; GoCQHttp.py:910)
Update friend list completed. Entries: 158
2023-03-19 03:32:06,998 [DEBUG]: httpx._client (_client._send_single_request; _client.py:1734)
HTTP Request: POST http://127.0.0.1:6700/get_friend_list "HTTP/1.1 200 OK"
2023-03-19 03:32:07,002 [DEBUG]: efb_qq_plugin_go_cqhttp.GoCQHttp (GoCQHttp.update_friend_list; GoCQHttp.py:910)
Update friend list completed. Entries: 158
2023-03-19 03:32:07,036 [DEBUG]: httpx._client (_client._send_single_request; _client.py:1734)
HTTP Request: POST http://127.0.0.1:6700/get_friend_list "HTTP/1.1 200 OK"
2023-03-19 03:32:07,040 [DEBUG]: efb_qq_plugin_go_cqhttp.GoCQHttp (GoCQHttp.update_friend_list; GoCQHttp.py:910)
Update friend list completed. Entries: 158
2023-03-19 03:32:07,077 [DEBUG]: httpx._client (_client._send_single_request; _client.py:1734)
HTTP Request: POST http://127.0.0.1:6700/get_friend_list "HTTP/1.1 200 OK"
2023-03-19 03:32:07,082 [DEBUG]: efb_qq_plugin_go_cqhttp.GoCQHttp (GoCQHttp.update_friend_list; GoCQHttp.py:910)
Update friend list completed. Entries: 158
2023-03-19 03:32:07,120 [DEBUG]: httpx._client (_client._send_single_request; _client.py:1734)
HTTP Request: POST http://127.0.0.1:6700/get_friend_list "HTTP/1.1 200 OK"
2023-03-19 03:32:07,124 [DEBUG]: efb_qq_plugin_go_cqhttp.GoCQHttp (GoCQHttp.update_friend_list; GoCQHttp.py:910)
Update friend list completed. Entries: 158
2023-03-19 03:32:07,161 [DEBUG]: httpx._client (_client._send_single_request; _client.py:1734)
HTTP Request: POST http://127.0.0.1:6700/get_friend_list "HTTP/1.1 200 OK"
2023-03-19 03:32:07,183 [DEBUG]: efb_qq_plugin_go_cqhttp.GoCQHttp (GoCQHttp.update_friend_list; GoCQHttp.py:910)
Update friend list completed. Entries: 158
2023-03-19 03:32:07,217 [DEBUG]: httpx._client (_client._send_single_request; _client.py:1734)
HTTP Request: POST http://127.0.0.1:6700/get_friend_list "HTTP/1.1 200 OK"
2023-03-19 03:32:07,222 [DEBUG]: efb_qq_plugin_go_cqhttp.GoCQHttp (GoCQHttp.update_friend_list; GoCQHttp.py:910)
Update friend list completed. Entries: 158
2023-03-19 03:32:07,255 [DEBUG]: httpx._client (_client._send_single_request; _client.py:1734)
HTTP Request: POST http://127.0.0.1:6700/get_friend_list "HTTP/1.1 200 OK"
2023-03-19 03:32:07,260 [DEBUG]: efb_qq_plugin_go_cqhttp.GoCQHttp (GoCQHttp.update_friend_list; GoCQHttp.py:910)
Update friend list completed. Entries: 158
2023-03-19 03:32:07,291 [DEBUG]: httpx._client (_client._send_single_request; _client.py:1734)
HTTP Request: POST http://127.0.0.1:6700/get_friend_list "HTTP/1.1 200 OK"
2023-03-19 03:32:07,296 [DEBUG]: efb_qq_plugin_go_cqhttp.GoCQHttp (GoCQHttp.update_friend_list; GoCQHttp.py:910)
Update friend list completed. Entries: 158
2023-03-19 03:32:07,329 [DEBUG]: httpx._client (_client._send_single_request; _client.py:1734)
HTTP Request: POST http://127.0.0.1:6700/get_friend_list "HTTP/1.1 200 OK"
2023-03-19 03:32:07,334 [DEBUG]: efb_qq_plugin_go_cqhttp.GoCQHttp (GoCQHttp.update_friend_list; GoCQHttp.py:910)
Update friend list completed. Entries: 158
2023-03-19 03:32:07,369 [DEBUG]: httpx._client (_client._send_single_request; _client.py:1734)
HTTP Request: POST http://127.0.0.1:6700/get_friend_list "HTTP/1.1 200 OK"
2023-03-19 03:32:07,390 [DEBUG]: efb_qq_plugin_go_cqhttp.GoCQHttp (GoCQHttp.update_friend_list; GoCQHttp.py:910)
Update friend list completed. Entries: 158
2023-03-19 03:32:07,423 [DEBUG]: httpx._client (_client._send_single_request; _client.py:1734)
HTTP Request: POST http://127.0.0.1:6700/get_friend_list "HTTP/1.1 200 OK"
2023-03-19 03:32:07,430 [DEBUG]: efb_qq_plugin_go_cqhttp.GoCQHttp (GoCQHttp.update_friend_list; GoCQHttp.py:910)
Update friend list completed. Entries: 158
2023-03-19 03:32:07,467 [DEBUG]: httpx._client (_client._send_single_request; _client.py:1734)
HTTP Request: POST http://127.0.0.1:6700/get_friend_list "HTTP/1.1 200 OK"
2023-03-19 03:32:07,472 [DEBUG]: efb_qq_plugin_go_cqhttp.GoCQHttp (GoCQHttp.update_friend_list; GoCQHttp.py:910)
Update friend list completed. Entries: 158
2023-03-19 03:32:07,505 [DEBUG]: httpx._client (_client._send_single_request; _client.py:1734)
HTTP Request: POST http://127.0.0.1:6700/get_friend_list "HTTP/1.1 200 OK"
2023-03-19 03:32:07,509 [DEBUG]: efb_qq_plugin_go_cqhttp.GoCQHttp (GoCQHttp.update_friend_list; GoCQHttp.py:910)
Update friend list completed. Entries: 158
2023-03-19 03:32:07,543 [DEBUG]: httpx._client (_client._send_single_request; _client.py:1734)
HTTP Request: POST http://127.0.0.1:6700/get_friend_list "HTTP/1.1 200 OK"
2023-03-19 03:32:07,548 [DEBUG]: efb_qq_plugin_go_cqhttp.GoCQHttp (GoCQHttp.update_friend_list; GoCQHttp.py:910)
Update friend list completed. Entries: 158
2023-03-19 03:32:07,583 [DEBUG]: httpx._client (_client._send_single_request; _client.py:1734)
HTTP Request: POST http://127.0.0.1:6700/get_friend_list "HTTP/1.1 200 OK"
2023-03-19 03:32:07,605 [DEBUG]: efb_qq_plugin_go_cqhttp.GoCQHttp (GoCQHttp.update_friend_list; GoCQHttp.py:910)
Update friend list completed. Entries: 158
2023-03-19 03:32:07,639 [DEBUG]: httpx._client (_client._send_single_request; _client.py:1734)
HTTP Request: POST http://127.0.0.1:6700/get_friend_list "HTTP/1.1 200 OK"
2023-03-19 03:32:07,644 [DEBUG]: efb_qq_plugin_go_cqhttp.GoCQHttp (GoCQHttp.update_friend_list; GoCQHttp.py:910)
Update friend list completed. Entries: 158
2023-03-19 03:32:07,681 [DEBUG]: httpx._client (_client._send_single_request; _client.py:1734)
HTTP Request: POST http://127.0.0.1:6700/get_friend_list "HTTP/1.1 200 OK"
2023-03-19 03:32:07,684 [DEBUG]: efb_qq_plugin_go_cqhttp.GoCQHttp (GoCQHttp.update_friend_list; GoCQHttp.py:910)
Update friend list completed. Entries: 158
2023-03-19 03:32:07,719 [DEBUG]: httpx._client (_client._send_single_request; _client.py:1734)
HTTP Request: POST http://127.0.0.1:6700/get_friend_list "HTTP/1.1 200 OK"
2023-03-19 03:32:07,725 [DEBUG]: efb_qq_plugin_go_cqhttp.GoCQHttp (GoCQHttp.update_friend_list; GoCQHttp.py:910)
Update friend list completed. Entries: 158
2023-03-19 03:32:07,754 [DEBUG]: httpx._client (_client._send_single_request; _client.py:1734)
HTTP Request: POST http://127.0.0.1:6700/get_friend_list "HTTP/1.1 200 OK"
2023-03-19 03:32:07,757 [DEBUG]: efb_qq_plugin_go_cqhttp.GoCQHttp (GoCQHttp.update_friend_list; GoCQHttp.py:910)
Update friend list completed. Entries: 158
2023-03-19 03:32:07,785 [DEBUG]: httpx._client (_client._send_single_request; _client.py:1734)
HTTP Request: POST http://127.0.0.1:6700/get_friend_list "HTTP/1.1 200 OK"
2023-03-19 03:32:07,803 [DEBUG]: efb_qq_plugin_go_cqhttp.GoCQHttp (GoCQHttp.update_friend_list; GoCQHttp.py:910)
Update friend list completed. Entries: 158
2023-03-19 03:32:07,804 [DEBUG]: root (GoCQHttp.message_element_wrapper; GoCQHttp.py:159)
Formated forwarded message: [$some_loooooog_message$]
2023-03-19 03:32:07,808 [DEBUG]: urllib3.connectionpool (connectionpool._new_conn; connectionpool.py:1003)
Starting new HTTPS connection (1): gchat.qpic.cn:443
2023-03-19 03:32:07,929 [DEBUG]: urllib3.connectionpool (connectionpool._make_request; connectionpool.py:456)
https://gchat.qpic.cn:443 "GET /gchatpic_new/0/0-0-3E408F36CA2E4C062603C154D242E2A1/0?term=2 HTTP/1.1" 200 61614
2023-03-19 03:32:07,949 [DEBUG]: urllib3.connectionpool (connectionpool._new_conn; connectionpool.py:1003)
Starting new HTTPS connection (1): gchat.qpic.cn:443
2023-03-19 03:32:08,086 [DEBUG]: urllib3.connectionpool (connectionpool._make_request; connectionpool.py:456)
https://gchat.qpic.cn:443 "GET /gchatpic_new/0/0-0-C5C819253241266A5F23582A2A247E06/0?term=2 HTTP/1.1" 200 11179
2023-03-19 03:32:08,101 [DEBUG]: urllib3.connectionpool (connectionpool._new_conn; connectionpool.py:1003)
Starting new HTTPS connection (1): gchat.qpic.cn:443
2023-03-19 03:32:08,265 [DEBUG]: urllib3.connectionpool (connectionpool._make_request; connectionpool.py:456)
https://gchat.qpic.cn:443 "GET /gchatpic_new/0/0-0-9A9CA95D4CAC4EC8FE200E4809620FB1/0?term=2 HTTP/1.1" 200 18353
2023-03-19 03:32:08,282 [DEBUG]: urllib3.connectionpool (connectionpool._new_conn; connectionpool.py:1003)
Starting new HTTPS connection (1): gchat.qpic.cn:443
2023-03-19 03:32:08,446 [DEBUG]: urllib3.connectionpool (connectionpool._make_request; connectionpool.py:456)
https://gchat.qpic.cn:443 "GET /gchatpic_new/0/0-0-2AAFA9AC3D3A4F087E8CE06CD5122782/0?term=2 HTTP/1.1" 200 78323
2023-03-19 03:32:08,501 [ERROR]: asyncio (base_events.default_exception_handler; base_events.py:1707)
Task exception was never retrieved
future: <Task finished name='Task-519' coro=<GoCQHttp.init..handle_msg.._handle_msg() done, defined at /root/efb/lib/python3.8/site-packages/efb_qq_plugin_go_cqhttp/GoCQHttp.py:191> exception=KeyError('qq')>
Traceback (most recent call last):
File "/root/efb/lib/python3.8/site-packages/efb_qq_plugin_go_cqhttp/GoCQHttp.py", line 232, in _handle_msg
main_text, messages, at_dict = await message_elements_wrapper(context, msg_elements, chat)
File "/root/efb/lib/python3.8/site-packages/efb_qq_plugin_go_cqhttp/GoCQHttp.py", line 177, in message_elements_wrapper
sub_main_text, sub_messages, sub_at_list = await message_element_wrapper(context, msg_element, chat)
File "/root/efb/lib/python3.8/site-packages/efb_qq_plugin_go_cqhttp/GoCQHttp.py", line 164, in message_element_wrapper
main_text, messages, _ = await message_elements_wrapper(context, fmt_forward_msgs, chat)
File "/root/efb/lib/python3.8/site-packages/efb_qq_plugin_go_cqhttp/GoCQHttp.py", line 177, in message_elements_wrapper
sub_main_text, sub_messages, sub_at_list = await message_element_wrapper(context, msg_element, chat)
File "/root/efb/lib/python3.8/site-packages/efb_qq_plugin_go_cqhttp/GoCQHttp.py", line 150, in message_element_wrapper
ref_user = await self.get_user_info(msg_data["qq"])
KeyError: 'qq'
2023-03-19 03:32:09,286 [DEBUG]: telegram.bot (bot.get_updates; bot.py:3068)
No new updates found.
2023-03-19 03:32:09,287 [DEBUG]: telegram.bot (bot.decorator; bot.py:134)
[]
2023-03-19 03:32:09,288 [DEBUG]: telegram.bot (bot.decorator; bot.py:135)
Exiting: get_updates
2023-03-19 03:32:09,288 [DEBUG]: telegram.bot (bot.decorator; bot.py:132)
Entering: get_updates
2023-03-19 03:32:19,585 [DEBUG]: telegram.bot (bot.get_updates; bot.py:3068)
No new updates found.
2023-03-19 03:32:19,586 [DEBUG]: telegram.bot (bot.decorator; bot.py:134)
[]
2023-03-19 03:32:19,587 [DEBUG]: telegram.bot (bot.decorator; bot.py:135)
Exiting: get_updates
2023-03-19 03:32:19,588 [DEBUG]: telegram.bot (bot.decorator; bot.py:132)
Entering: get_updates
2023-03-19 03:32:26,535 [INFO]: quart.app (init._handle_event; init.py:596)
received event: meta_event.heartbeat
[2023-03-19 03:32:26,535] INFO in init: received event: meta_event.heartbeat
2023-03-19 03:32:29,890 [DEBUG]: telegram.bot (bot.get_updates; bot.py:3068)
No new updates found.
2023-03-19 03:32:29,891 [DEBUG]: telegram.bot (bot.decorator; bot.py:134)
[]
2023-03-19 03:32:29,891 [DEBUG]: telegram.bot (bot.decorator; bot.py:135)
Exiting: get_updates
2023-03-19 03:32:29,892 [DEBUG]: telegram.bot (bot.decorator; bot.py:132)
Entering: get_updates

配置文件及参数:

Client: GoCQHttp # 指定要使用的 QQ 客户端(此处为 GoCQHttp)GoCQHttp:
type: HTTP # 指定 efb-qq-plugin-go-cqhttp 与 GoCQHttp 通信的方式 现阶段仅支>持 HTTP
access_token:
api_root: http://127.0.0.1:6700/ # GoCQHttp API接口地址/端口 host: 127.0.0.1 # efb-qq-slave 所监听的地址用于接收消息 port: 6701 # 同上

token: "$some_tokens$"
admins:
- $some_admins$
flags:
send_image_as_file: false
#将所有图像消息作为文件发送,以防止主动报文的图像压缩.需要更多的流量,可以开启,改为ture
animated_stickers: true
#启用对动画贴纸的实验性支持启用对动画贴纸的实验性支持,该依赖已包含在教程依赖 retry_on_error: true
request_kwargs:
proxy_url: http://127.0.0.1:20172

$ ehforwarderbot -V -p qq
EH Forwarder Bot
Version: 2.1.1
Python version:
3.8.10 (default, Nov 14 2022, 12:59:47)
[GCC 9.4.0]
Running on profile "qq".
Master channel:
Telegram Master (blueset.telegram) 2.3.1 # Default instance
Slave channel:
QQ Slave (milkice.qq) 2.0.2-dev # Default instance
Middleware:
KeywordMention Middleware (keywordmention.MatrixLauMiddleware) 2.1.0 # Default instance

最新版本 go-cqhttp 會導致無法啓動

[01/Dec/2021:04:57:44] ENGINE Bus STARTING
[01/Dec/2021:04:57:44] ENGINE Started monitor thread 'Autoreloader'.
[01/Dec/2021:04:57:44] ENGINE Serving on http://127.0.0.1:8000
[01/Dec/2021:04:57:44] ENGINE Bus STARTED
2021-12-01 04:57:44,736 [ERROR]: cqhttp (app.log_exception; app.py:1891)
    Exception on / [POST]
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 2447, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 1952, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 1821, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python3.8/dist-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 1950, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 1936, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/usr/local/lib/python3.8/dist-packages/cqhttp/__init__.py", line 91, in _handle
    type_ = event.get('post_type', '')
AttributeError: 'NoneType' object has no attribute 'get'

用的 go-cqhttp 模式,以下是配置文件:

Client: GoCQHttp                         # 指定要使用的 QQ 客户端(此处为CoolQ)
GoCQHttp:
  type: HTTP                        # 指定 efb-qq-plugin-go-cqhttp 与 GoCQHttp 通信的方式 现阶段仅支持 HTTP
  access_token: ############################
  api_root: http://127.0.0.1:5700/  # GoCQHttp API接口地址/端口
  host: 127.0.0.1                   # efb-qq-slave 所监听的地址用于接收消息
  port: 8000                        # 同上

報錯的 go-cqhttp 版本是 https://github.com/Mrs4s/go-cqhttp/releases/tag/v1.0.0-beta8-fix1
測試可用的版本是 https://github.com/Mrs4s/go-cqhttp/releases/tag/v1.0.0-beta3

go-cqhttp兼容性相关问题

1、在go-cqhttp 1.0beta7后追加了图片的子类后efb端无法发出图片,tg端显示

Message is not sent. CoolQAPIFailureException('CoolQ HTTP API encountered an error!\nStatus Code:200 Return Code:100')

1.0beta7上正常发送文字消息,回滚1.0beta6一切正常

2、插件基于的python cqhttp库早已停更,而go-cqhttp实现了原先cqhttp未有的功能,可能的话建议之后使用例如aiocqhttp/nonebot这类更新的库实现

[feature request]支持语音消息的接收

go-cqhttp原项目已支持,但是efb插件目前无法接收语音消息,会提示“不支持的消息类型,请在客户端查看”。
接收到的语音消息可能需要解码。#440

初始化客户端报错(mirai可以, 但是go-cqhttp不行)

输出:

$ ehforwarderbot --profile qq
2021-07-20 14:59:40,781 [Level 99]: ehforwarderbot.__main__ (__main__.init; __main__.py:129)
     正在初始化从端 milkice.qq…
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/urllib3/connection.py", line 169, in _new_conn
    conn = connection.create_connection(
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/urllib3/util/connection.py", line 96, in create_connection
    raise err
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/urllib3/util/connection.py", line 86, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 61] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/urllib3/connectionpool.py", line 699, in urlopen
    httplib_response = self._make_request(
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/urllib3/connectionpool.py", line 394, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/urllib3/connection.py", line 234, in request
    super(HTTPConnection, self).request(method, url, body=body, headers=headers)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1257, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1303, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1252, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1012, in _send_output
    self.send(msg)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 952, in send
    self.connect()
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/urllib3/connection.py", line 200, in connect
    conn = self._new_conn()
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/urllib3/connection.py", line 181, in _new_conn
    raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7f9f2b242ac0>: Failed to establish a new connection: [Errno 61] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/requests/adapters.py", line 439, in send
    resp = conn.urlopen(
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/urllib3/connectionpool.py", line 755, in urlopen
    retries = retries.increment(
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/urllib3/util/retry.py", line 574, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='127.0.0.1', port=5700): Max retries exceeded with url: /get_status (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f9f2b242ac0>: Failed to establish a new connection: [Errno 61] Connection refused'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/efb_qq_plugin_go_cqhttp/GoCQHttp.py", line 643, in _coolq_api_wrapper
    res = func(**kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/cqhttp/__init__.py", line 21, in do_call
    resp = requests.post(url, json=kwargs, headers=headers)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/requests/api.py", line 119, in post
    return request('post', url, data=data, json=json, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/requests/api.py", line 61, in request
    return session.request(method=method, url=url, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/requests/sessions.py", line 542, in request
    resp = self.send(prep, **send_kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/requests/sessions.py", line 655, in send
    r = adapter.send(request, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/requests/adapters.py", line 516, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=5700): Max retries exceeded with url: /get_status (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f9f2b242ac0>: Failed to establish a new connection: [Errno 61] Connection refused'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/efb_qq_plugin_go_cqhttp/GoCQHttp.py", line 681, in check_status_periodically
    flag = self.check_running_status()
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/efb_qq_plugin_go_cqhttp/GoCQHttp.py", line 658, in check_running_status
    res = self._coolq_api_wrapper('get_status')
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/efb_qq_plugin_go_cqhttp/GoCQHttp.py", line 645, in _coolq_api_wrapper
    raise CoolQDisconnectedException(self._('Unable to connect to CoolQ Client!'
efb_qq_plugin_go_cqhttp.Exceptions.CoolQDisconnectedException: Unable to connect to CoolQ Client!Error Message:
HTTPConnectionPool(host='127.0.0.1', port=5700): Max retries exceeded with url: /get_status (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f9f2b242ac0>: Failed to establish a new connection: [Errno 61] Connection refused'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/efb_qq_slave/ClientMgr.py", line 27, in __init__
    self.client = cls(name, config, channel)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/efb_qq_plugin_go_cqhttp/GoCQHttp.py", line 370, in __init__
    self.check_status_periodically(threading.Event())
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/efb_qq_plugin_go_cqhttp/GoCQHttp.py", line 684, in check_status_periodically
    self.deliver_alert_to_master(self._("We're unable to communicate with CoolQ Client.\n"
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/efb_qq_plugin_go_cqhttp/GoCQHttp.py", line 722, in deliver_alert_to_master
    self.send_msg_to_master(context)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/efb_qq_plugin_go_cqhttp/GoCQHttp.py", line 794, in send_msg_to_master
    raise Exception(context['message'])
Exception: We're unable to communicate with CoolQ Client.
Please check the connection and credentials provided.
Unable to connect to CoolQ Client!Error Message:
HTTPConnectionPool(host='127.0.0.1', port=5700): Max retries exceeded with url: /get_status (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f9f2b242ac0>: Failed to establish a new connection: [Errno 61] Connection refused'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.9/bin/ehforwarderbot", line 8, in <module>
    sys.exit(main())
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/ehforwarderbot/__main__.py", line 335, in main
    init(conf)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/ehforwarderbot/__main__.py", line 135, in init
    coordinator.add_channel(cls(instance_id=instance_id))
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/efb_qq_slave/__init__.py", line 44, in __init__
    self.init_client_manager()
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/efb_qq_slave/__init__.py", line 73, in init_client_manager
    self.QQClientMgr = ClientMgr(self.config['Client'], self.config, self)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/efb_qq_slave/ClientMgr.py", line 30, in __init__
    raise Exception("Specified client not found!")
Exception: Specified client not found!

配置文件:
image
图中下边的mirai可以, 但是go-cqhttp不行
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.