Git Product home page Git Product logo

tg-efb-qq-docker's Introduction

TG-EFB-QQ-Docker

EFB 和 Go-CQHTTP 的 Docker Compose 部署方式

这是什么

使用 Bot 在 Telegram 及 QQ 间转发消息,基本可以做到去 QQ 化,仅在 Telegram 上与 QQ 好友/群组互动

本项目使用 Docker Compose 简化了 Telegram BotQQ Bot 的安装与配置,仅需要 Docker Compose 与流畅的国际互联网连接即可使用

使用项目

使用

克隆项目

# 克隆
git clone -b go-cqhttp https://github.com/xzsk2/TG-EFB-QQ-Docker.git
# 进入文件夹
cd TG-EFB-QQ-Docker

修改配置文件

可参考 Telegram收发QQ信息-EFB和GO-CQHTTP的Docker部署教程 及各项目的文档

  1. 修改 blueset.telegram/config.yaml 内的 tokenadmins,如不能访问Telegram则需要在此配置代理

  2. 编辑 gocq/config.yml 配置文件

    account:         # 账号相关
      uin: 000000000 # QQ 账号
      password: ''   # QQ 密码,为空时使用扫码登录
  3. (可选)修改登陆协议,运行如下命令,待提示生成 device.jsonctrl+c 退出,编辑 gocq/device.json,参考 设备信息

    docker run --rm -it --name="gocq" -v $PWD/gocq:/data xzsk2/gocqhttp-docker:latest

运行

docker-compose up -d

如需扫码登陆输入 docker logs gocq 查看二维码

停止

docker-compose down

自动更新

docker run -d \
    --name watchtower \
    --restart unless-stopped \
    -v /var/run/docker.sock:/var/run/docker.sock \
    containrrr/watchtower -c \
    --interval 3600 \
    efb gocq

若Docker镜像未及时跟进上游项目更新,欢迎提交 Issue

其他问题

所有消息挤在一个对话如何分开

参考 绑定会话

VPS上登陆异常

当前设备网络不稳定或处于复杂网络环境,为了你的帐号安全,建议将两个设备连接同一网络或将被扫描设备连接你的手机热点后,重新扫码登录。

在本地直接下载使用 go-cqhttp 配置运行,登陆成功后将生成的 device.json 上传到远程服务器对应位置重新登陆

⚠️配置文件更新相关⚠️

go-cqhttpv1.0.0-rc2 修改了部分配置

  • f63c59f HTTP和正向WS使用了新配置文件格式(保留了对老版本的兼容)

新版配置文件兼容旧版,但为了避免旧配置文件兼容的废弃,可以参考 95f3890 更新配置文件

2021/11/21

如果你在 2021/11/21 前即 9a84c3f 前拉取过本项目且正在使用,请进行如下配置文件的修改,否则 go-cqhttp 更新后将无法正常使用

如果你未使用或正准备本项目请略过本段,目前的仓库已经应用了新的配置文件,你可以直接使用本项目即可

go-cqhttpv1.0.0-beta8 开始修改了部分配置文件,请检查你的 gocq/config.yml 文件的最后一段是否为

      post:
      #- url: '' # 地址
      #  secret: ''           # 密钥
      - url: 127.0.0.1:8000 # 地址
        secret: ''          # 密钥

修改第四行的url如下

      post:
      #- url: '' # 地址
      #  secret: ''           # 密钥
      - url: http://127.0.0.1:8000/ # 地址
        secret: ''          # 密钥

完整的配置文件参考 config.yml9a84c3f

tg-efb-qq-docker's People

Contributors

sakarie9 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

tg-efb-qq-docker's Issues

再问一个问题

CoolQAPIFailureException('CoolQ HTTP API encountered an error!\nStatus Code:200 Return Code:100')
这个报错也是腾讯风控的问题吗?
私聊是可以发出去消息的

求更新最新版,现版本登录失败

现在登录报错
[2021-12-12 15:35:39] [ERROR]: Protocol -> decrypt payload error: unknown flag
[2021-12-12 15:35:54] [ERROR]: Protocol -> decrypt payload error: unknown flag
[2021-12-12 15:36:09] [FATAL]: 登录时发生致命错误: Packet timed out
好像在最新版的beta8-fix2已修复这个问题

无法接收图片

tg端显示[Download image failed, please check on your QQ client]
gocq后台logs显示获取到了gchat.qpic.cn的图片

回复消息报 httperror 错误,请问是否需要打开防火墙的某些端口?

接受消息没有问题,确认了 efb/profiles/default/blueset.telegram/config.yaml 中的 admins 与我的 id 相等。

回复任何消息和指令都无效,bot 没有任何反应。

使用 docker log efbv2 查看日志, 发现其反复报如下错误:

2021-07-11 05:00:19,672 [ERROR]: telegram.ext.updater (updater._network_loop_retry; updater.py:391)
    Error while getting Updates: urllib3 HTTPError ('Connection aborted.', OSError(0, 'Error'))
2021-07-11 05:00:19,673 [ERROR]: efb_telegram_master (__init__.error; __init__.py:477)
    Poor internet connection detected.
Number of network error occurred since last startup: 656
urllib3 HTTPError ('Connection aborted.', OSError(0, 'Error'))
Update: None

能将消息转发到 tg bot 说明可以访问到 tg 服务器,是否需要打开某些端口才能回复消息?

部署成功后,无法发送图片

tg报错:
Message is not sent. CoolQDisconnectedException('Unable to connect to CoolQ Client!Error Message:\nHTTP request failed')

gocq log
[2022-11-19 18:35:22] [WARNING]: 警告: 私聊 *** 图片上传失败: upload failed: connect error: dial tcp 180.109.192.140:443: i/o timeout [2022-11-19 18:35:22] [WARNING]: 好友消息发送失败: 消息为空

efb log:

2022-11-19 10:35:07,734 [ERROR]: efb_telegram_master.master_message (master_message.process_telegram_message; master_message.py:422)
    Message is not sent. (update: {'message': {'group_chat_created': False, 'chat': {'title': '🐧👤 小小', 'type': 'group', 'all_members_are_administrators': True, 'id': -573349043}, 'supergroup_chat_created': False, 'message_id': 2981, 'caption_entities': [], 'channel_chat_created': False, 'photo': [{'file_unique_id': 'AQADBrMxGzACyVd4', 'height': 71, 'file_size': 1454, 'width': 90, 'file_id': 'AgACAgUAAxkBAAILpWN4sVTjuusUgMaNrPlw6kIuH0x9AAIGszEbMALJV-EL6vl6JzbNAQADAgADcwADKwQ'}, {'file_unique_id': 'AQADBrMxGzACyVdy', 'height': 251, 'file_size': 23807, 'width': 320, 'file_id': 'AgACAgUAAxkBAAILpWN4sVTjuusUgMaNrPlw6kIuH0x9AAIGszEbMALJV-EL6vl6JzbNAQADAgADbQADKwQ'}, {'file_unique_id': 'AQADBrMxGzACyVd9', 'height': 628, 'file_size': 101254, 'width': 800, 'file_id': 'AgACAgUAAxkBAAILpWN4sVTjuusUgMaNrPlw6kIuH0x9AAIGszEbMALJV-EL6vl6JzbNAQADAgADeAADKwQ'}, {'file_unique_id': 'AQADBrMxGzACyVd-', 'height': 1005, 'file_size': 154450, 'width': 1280, 'file_id': 'AgACAgUAAxkBAAILpWN4sVTjuusUgMaNrPlw6kIuH0x9AAIGszEbMALJV-EL6vl6JzbNAQADAgADeQADKwQ'}], 'entities': [], 'new_chat_photo': [], 'delete_chat_photo': False, 'new_chat_members': [], 'date': 1668854100, 'from': {'last_name': 'yu', 'username': 'chengzilee', 'language_code': 'zh-hans', 'is_bot': False, 'first_name': 'Duo', 'id': 2139115741}}, 'update_id': 109876112}, exception: Unable to connect to CoolQ Client!Error Message:
HTTP request failed)
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/httpcore/backends/asyncio.py", line 33, in read
    return await self._stream.receive(max_bytes=max_bytes)
  File "/usr/local/lib/python3.9/site-packages/anyio/_backends/_asyncio.py", line 1265, in receive
    await self._protocol.read_event.wait()
  File "/usr/local/lib/python3.9/asyncio/locks.py", line 226, in wait
    await fut
asyncio.exceptions.CancelledError

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 8, in map_exceptions
    yield
  File "/usr/local/lib/python3.9/site-packages/httpcore/backends/asyncio.py", line 35, in read
    return b""
  File "/usr/local/lib/python3.9/site-packages/anyio/_core/_tasks.py", line 118, in __exit__
    raise TimeoutError
TimeoutError

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 90, in handle_async_request
    return await self._connection.handle_async_request(request)
  File "/usr/local/lib/python3.9/site-packages/httpcore/_async/http11.py", line 105, in handle_async_request
    raise exc
  File "/usr/local/lib/python3.9/site-packages/httpcore/_async/http11.py", line 84, in handle_async_request
    ) = await self._receive_response_headers(**kwargs)
  File "/usr/local/lib/python3.9/site-packages/httpcore/_async/http11.py", line 148, in _receive_response_headers
    event = await self._receive_event(timeout=timeout)
  File "/usr/local/lib/python3.9/site-packages/httpcore/_async/http11.py", line 177, in _receive_event
    data = await self._network_stream.read(
  File "/usr/local/lib/python3.9/site-packages/httpcore/backends/asyncio.py", line 35, in read
    return b""
  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 12, in map_exceptions
    raise to_exc(exc)
httpcore.ReadTimeout

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 1842, in post
    return await self.request(
  File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 1527, 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 1614, in send
    response = await self._send_handling_auth(
  File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 1642, in _send_handling_auth
    response = await self._send_handling_redirects(
  File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 1679, in _send_handling_redirects
    response = await self._send_single_request(request)
  File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 1716, 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.ReadTimeout

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_telegram_master/master_message.py", line 405, in process_telegram_message
    slave_msg = coordinator.send_message(m)
  File "/usr/local/lib/python3.9/site-packages/ehforwarderbot/coordinator.py", line 113, in send_message
    return slaves[msg.deliver_to.channel_id].send_message(msg)
  File "/usr/local/lib/python3.9/site-packages/efb_qq_slave/__init__.py", line 80, in send_message
    return self.QQClient.send_message(msg)
  File "/usr/local/lib/python3.9/site-packages/efb_qq_plugin_go_cqhttp/GoCQHttp.py", line 701, in send_message
    msg.uid = asyncio.run(self.coolq_send_message(chat_type[0], chat_type[1], text))
  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 804, in coolq_send_message
    res = await self.coolq_api_query("send_msg", message_type=msg_type, **{keyword + "_id": uid}, message=message)
  File "/usr/local/lib/python3.9/site-packages/efb_qq_plugin_go_cqhttp/GoCQHttp.py", line 838, in coolq_api_query
    return await self._coolq_api_wrapper(func_name, **kwargs)
  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

配置文件

account: # 账号相关
  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
  # 是否允许发送临时会话消息
  allow-temp-session: false

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: true
  # 为Reply附加更多信息
  extra-reply-data: true
  # 跳过 Mime 扫描, 忽略错误数据
  skip-mime-scan: false

output:
  log-level: warn
  log-aging: 15
  log-force-new: true
  log-colorful: true
  debug: false # 开启调试模式

# 默认中间件锚点
default-middlewares: &default
  access-token: ''
  filter: ''
  rate-limit:
    enabled: false # 是否启用限速
    frequency: 1  # 令牌回复频率, 单位秒
    bucket: 1     # 令牌桶大小

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

  # 媒体文件缓存, 删除此项则使用缓存文件(旧版行为)
  cache:
    image: data/image.db
    video: data/video.db

# 连接服务列表
servers:
  # 添加方式,同一连接方式可添加多个,具体配置说明请查看文档
  #- http: # http 通信
  #- ws:   # 正向 Websocket
  #- ws-reverse: # 反向 Websocket
  #- pprof: #性能分析服务器

  - http: # HTTP 通信设置
      address: 127.0.0.1:5700 # HTTP监听地址
      timeout: 5      # 反向 HTTP 超时时间, 单位秒,<5 时将被忽略
      long-polling:   # 长轮询拓展
        enabled: false       # 是否开启
        max-queue-size: 2000 # 消息队列大小,0 表示不限制队列大小,谨慎使用
      middlewares:
        <<: *default # 引用默认中间件
      post:           # 反向HTTP POST地址列表
      #- url: ''                # 地址
      #  secret: ''             # 密钥
      #  max-retries: 3         # 最大重试,0 时禁用
      #  retries-interval: 1500 # 重试时间,单位毫秒,0 时立即
      #- url: http://127.0.0.1:5701/ # 地址
      #  secret: ''                  # 密钥
      #  max-retries: 10             # 最大重试,0 时禁用
      #  retries-interval: 1000      # 重试时间,单位毫秒,0 时立即
      - url: http://127.0.0.1:8000/ # 地址
        secret: ''          # 密钥

环境信息
圣何塞 vps ubuntu-20

问题:
可以正常收发文字信息和qq发来的图片,但无法通过tg发送图片及视频

google以及查看相关问题的issue后 配置文件中多次修改地址docker-compose up && docker-compose down 仍无法解决,相关端口都已放行

wsl2 中 gocq 连接上报服务器失败

[2021-11-08 16:45:28] [INFO]: アトリは、高性能ですから!
[2021-11-08 16:45:28] [INFO]: HTTP POST上报器已启动: 127.0.0.1:11451
[2021-11-08 16:45:28] [INFO]: CQ HTTP 服务器已启动: 127.0.0.1:15722
[2021-11-08 16:45:28] [INFO]: 正在检查更新.
[2021-11-08 16:45:33] [WARNING]: 上报Event到 HTTP 服务器 127.0.0.1:11451 时出现错误: Post "http://127.0.0.1:11451": dial tcp 127.0.0.1:11451: connect: connection refused 将重试.
[2021-11-08 16:45:33] [WARNING]: 上报Event数据 {"interval":5000,"meta_event_type":"heartbeat","post_type":"meta_event","self_id":386897035,"status":{"app_enabled":true,"app_good":true,"app_initialized":true,"good":true,"online":true,"plugins_good":null,"stat":{"packet_received":57,"packet_sent":52,"packet_lost":0,"message_received":0,"message_sent":0,"disconnect_times":1,"lost_times":0,"last_message_time":0}},"time":1636389933}
到 127.0.0.1:11451 失败: Post "http://127.0.0.1:11451": dial tcp 127.0.0.1:11451: connect: connection refused
[2021-11-08 16:45:33] [INFO]: 检查更新完成. 当前已运行最新版本.
[2021-11-08 16:45:38] [WARNING]: 上报Event到 HTTP 服务器 127.0.0.1:11451 时出现错误: Post "http://127.0.0.1:11451": dial tcp 127.0.0.1:11451: connect: connection refused 将重试.

不管是原来的端口还是我修改之后的端口连接都一直失败。开了 debug 模式也看不到其他的日志。

不知道需不需要在系统中再设置什么其他的东西?

VDS中上报服务器失败

前几天是是启动成功的,后来被风控了,过了几天干脆bot完全没反应了,重新启动docker也是同样的上报服务器错误。试着重装了一次,依旧如此。
efb似乎是启动成功的

root@iugiu72023:~/TG-EFB-QQ-Docker/efb/profiles/default/blueset.telegram# docker logs efb
sleep for 20sec
2021-11-21 03:59:45,415 [Level 99]: ehforwarderbot.main (main.init; main.py:129)
Initializing slave milkice.qq...
2021-11-21 03:59:45,863 [Level 99]: ehforwarderbot.main (main.init; main.py:137)
Slave channel QQ Slave (milkice.qq) # Default profile is initialized.
2021-11-21 03:59:45,864 [Level 99]: ehforwarderbot.main (main.init; main.py:142)
Initializing master blueset.telegram...
2021-11-21 03:59:46,123 [Level 99]: ehforwarderbot.main (main.init; main.py:149)
Master channel Telegram Master (blueset.telegram) # Default profile is initialized.
2021-11-21 03:59:46,124 [Level 99]: ehforwarderbot.main (main.init; main.py:155)
All channels initialized.
2021-11-21 03:59:46,124 [Level 99]: ehforwarderbot.main (main.init; main.py:169)
All middlewares are initialized.
[21/Nov/2021:03:59:46] ENGINE Bus STARTING
[21/Nov/2021:03:59:46] ENGINE Started monitor thread 'Autoreloader'.
[21/Nov/2021:03:59:46] ENGINE Serving on http://127.0.0.1:8000
[21/Nov/2021:03:59:46] ENGINE Bus STARTED

GOCQ已经开启了debug模式
root@iugiu72023:~/TG-EFB-QQ-Docker/efb/profiles/default/blueset.telegram# docker logs gocq
[2021-11-21 11:59:23] [INFO]: 当前版本:v1.0.0-beta7-fix2
[2021-11-21 11:59:23] [INFO]: 用户交流群: 721829413
[2021-11-21 11:59:23] [INFO]: 将使用 device.json 内的设备信息运行Bot.
[2021-11-21 11:59:23] [INFO]: 开始尝试登录并同步消息...
[2021-11-21 11:59:23] [INFO]: 使用协议: iPad
[2021-11-21 11:59:27] [INFO]: Protocol -> connect to server: 120.232.130.20:80
[2021-11-21 11:59:31] [INFO]: 收到服务器地址更新通知, 根据配置文件已忽略.
[2021-11-21 11:59:35] [INFO]: 登录成功 欢迎使用: XX
[2021-11-21 11:59:35] [INFO]: 开始加载好友列表...
[2021-11-21 11:59:35] [INFO]: 共加载 37 个好友.
[2021-11-21 11:59:35] [INFO]: 开始加载群列表...
[2021-11-21 11:59:38] [INFO]: 共加载 17 个群.
[2021-11-21 11:59:38] [INFO]: 信息数据库初始化完成.
[2021-11-21 11:59:38] [INFO]: 资源初始化完成, 开始处理信息.
[2021-11-21 11:59:38] [INFO]: アトリは、高性能ですから!
[2021-11-21 11:59:38] [INFO]: HTTP POST上报器已启动: 127.0.0.1:8000
[2021-11-21 11:59:38] [INFO]: 正在检查更新.
[2021-11-21 11:59:38] [INFO]: CQ HTTP 服务器已启动: 127.0.0.1:5700
[2021-11-21 11:59:39] [INFO]: 当前有更新的 go-cqhttp 可供更新, 请前往 https://github.com/Mrs4s/go-cqhttp/releases 下载.
[2021-11-21 11:59:39] [INFO]: 当前版本: v1.0.0-beta7-fix2 最新版本: v1.0.0-beta8-fix1
[2021-11-21 11:59:43] [WARNING]: 上报Event到 HTTP 服务器 127.0.0.1:8000 时出现错误: Post "http://127.0.0.1:8000": dial tcp 127.0.0.1:8000: connect: connection refused 将重试.
[2021-11-21 11:59:43] [WARNING]: 上报Event数据 {"interval":5000,"meta_event_type":"heartbeat","post_type":"meta_event","self_id":923266670,"status":{"app_enabled":true,"app_good":true,"app_initialized":true,"good":true,"online":true,"plugins_good":null,"stat":{"packet_received":49,"packet_sent":43,"packet_lost":0,"message_received":0,"message_sent":0,"disconnect_times":1,"lost_times":0,"last_message_time":0}},"time":1637467183}
到 127.0.0.1:8000 失败: Post "http://127.0.0.1:8000": dial tcp 127.0.0.1:8000: connect: connection refused

看到gocq最新版文档还是开发版不太稳定,所以没升级。是否与这个有关?

新的EFB-QQ-Slave版本

🐧💻 CoolQ Alert, System:
New version(2.0.1) of EFB-QQ-Slave has released! Please manually update EQS by stopping ehForwarderbot first and then execute <code>pip3 install --upgrade efb-qq-slave</code>

希望能及时更新

消息撤回失败

在tg执行撤回消息时提示撤回成功并且日志也显示撤回成功,但是在qq里并没有撤回,不知道我这是否是个例

EFB-QQ-Slave有更新啦

🐧💻 CoolQ Alert, System:
New version(2.0.1) of EFB-QQ-Slave has released! Please manually update EQS by stopping ehForwarderbot first and then execute pip3 install --upgrade efb-qq-slave

如何取消群消息的通知呢?

抱歉我没找到取消群通知的方法,我有一个群很热闹开了接收消息但不提醒,只要群里有消息Bot就会一直响

使用最新版的go-cqhttp,可以发消息,不能收

2023-06-28 06:27:30,391 [ERROR]: asyncio (base_events.default_exception_handler; base_events.py:1753)
Task exception was never retrieved
future: <Task finished name='Task-813' coro=<GoCQHttp.init..handle_msg.._handle_msg() done, defined at /usr/local/lib/python3.9/site-packages/efb_qq_plugin_go_cqhttp/GoCQHttp.py:191> exception=TypeError('string indices must be integers')>
Traceback (most recent call last):
File "/usr/local/lib/python3.9/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 "/usr/local/lib/python3.9/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 "/usr/local/lib/python3.9/site-packages/efb_qq_plugin_go_cqhttp/GoCQHttp.py", line 117, in message_element_wrapper
msg_type = msg_element["type"]
TypeError: string indices must be integers

使用docker-compose启动之后efb报错

按照教程修改完配置之后,使用docker-compose启动,
第一个报错无法连接到127.0.0.1:8080
查看端口,mirai未在8080启动
docker-compose.yml指定8080端口映射之后mirai在本机8080端口启动成功
但是docker-compose启动之后仍然提示无法连接到8080端口,
尝试指定ip地址为localhost 或者 mirai均未成功,
之后指定为eth0 网卡对应ip,貌似可以连接到8080端口
然后出现第二个报错
第二个报错提示/auth post failed http status 404

2021-05-30 04:15:27,183 [Level 99]: ehforwarderbot.__main__ (__main__.init; __main__.py:129)
     Initializing slave milkice.qq...
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/efb_qq_slave/ClientMgr.py", line 32, in __init__
    self.client = cls(name, config, channel)
  File "/usr/local/lib/python3.8/site-packages/efb_qq_plugin_mirai/mirai.py", line 65, in __init__
    self.loop.run_until_complete(self.bot.handshake())
  File "/usr/local/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
    return future.result()
  File "/usr/local/lib/python3.8/site-packages/mirai_core/bot.py", line 58, in handshake
    await self.auth()
  File "/usr/local/lib/python3.8/site-packages/mirai_core/bot.py", line 65, in auth
    result = await self.session.post('/auth', data={'authKey': self.auth_key})
  File "/usr/local/lib/python3.8/site-packages/mirai_core/network.py", line 101, in post
    return await HttpClient._check_response(response, url, 'post')
  File "/usr/local/lib/python3.8/site-packages/mirai_core/network.py", line 44, in _check_response
    raise ServerException(f'{url} {method} failed, status code: {result.status}')
mirai_core.exceptions.ServerException: /auth post failed, status code: 404

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.8/site-packages/ehforwarderbot/__main__.py", line 339, in main
    init(conf)
  File "/usr/local/lib/python3.8/site-packages/ehforwarderbot/__main__.py", line 135, in init
    coordinator.add_channel(cls(instance_id=instance_id))
  File "/usr/local/lib/python3.8/site-packages/efb_qq_slave/__init__.py", line 44, in __init__
    self.init_client_manager()
  File "/usr/local/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 "/usr/local/lib/python3.8/site-packages/efb_qq_slave/ClientMgr.py", line 35, in __init__
    raise Exception("Specified client not found!")
Exception: Specified client not found!

TG-EFB-QQ-Docker版本:

  • git最新版

环境信息:

  • windows10 insider build 21390
  • wsl2 os kenel 5.10.16.3-microsoft-standard-WSL2
  • wsl2 os Manjaro Linux on Windows 10 x86_64

无法运行

输入
docker run --rm -it --name="gocq" -v $PWD/gocq:/data xzsk2/gocqhttp-docker:latest
提示
C:\Program Files\Docker Toolbox\docker.exe: Error response from daemon: invalid mode: \Users\Administrator\Documents\cmder\vendor\git-for-windows\data. See 'C:\Program Files\Docker Toolbox\docker.exe run --help'.

更换为
docker run --rm -it --name="gocq" -v /$PWD/gocq:/data xzsk2/gocqhttp-docker:latest
错误变成
New state of 'nil' is invalid.

想问下机器人的command

搭建完成后接收消息没什么问题,就是第一次用这玩意,不太清楚TG机器人的command,以及怎么发送消息.
希望大佬指点下迷津,感激不尽.

go-cqhttp 分支的文件发送不支持

请问go-cqhttp 分支是不是没有默认打开文件的发送功能呢,还是bug?文件可以接受,语音确实可以发送,但还是不能发送文件,bot提示从端qq slave不支持file消息,配置部分只修改了blueset.telegram/config.yaml 内的 token adminsgocq/config.yml 配置文件中的账号,gocq/device.json中改为了mac登录

无法生成config.json文件

在配置好 blueset.telegram中的token以及admin,与gocp中的account: ui之后运行

sudo docker run --rm -it --name="gocq" -v $PWD/gocq:/data xzsk2/gocqhttp-docker:latest

并按照要求,我选择了http通信协议:

image

但是并没有生成config.json文件

image

在接下来执行 docker-compose up -d 遇到了循环要求选择通信协议的问题,无法实现登陆,如下:

image

发送长消息报错

`Message is not sent.

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

报错:dial tcp 127.0.0.1:8000: connect: connection refused

[2022-07-30 20:47:51] [INFO]: アトリは、高性能ですから!
[2022-07-30 20:47:51] [INFO]: 正在检查更新.
[2022-07-30 20:47:51] [INFO]: HTTP POST上报器已启动: http://127.0.0.1:8000/
[2022-07-30 20:47:51] [INFO]: CQ HTTP 服务器已启动: 127.0.0.1:5700
[2022-07-30 20:47:51] [INFO]: 检查更新完成. 当前已运行最新版本.
[2022-07-30 20:47:51] [INFO]: 开始诊断网络情况
[2022-07-30 20:47:54] [INFO]: 网络诊断完成. 未发现问题
[2022-07-30 20:47:56] [WARNING]: 上报 Event 数据到 http://127.0.0.1:8000/ 失败: Post "http://127.0.0.1:8000/": dial tcp 127.0.0.1:8000: connect: connection refused 将进行第 1 次重试
[2022-07-30 20:47:57] [WARNING]: 上报 Event 数据到 http://127.0.0.1:8000/ 失败: Post "http://127.0.0.1:8000/": dial tcp 127.0.0.1:8000: connect: connection refused 将进行第 2 次重试
[2022-07-30 20:47:57] [WARNING]: 上报 Event 数据到 http://127.0.0.1:8000/ 失败: Post "http://127.0.0.1:8000/": dial tcp 127.0.0.1:8000: connect: connection refused 将进行第 1 次重试
[2022-07-30 20:47:59] [WARNING]: 上报 Event 数据到 http://127.0.0.1:8000/ 失败: Post "http://127.0.0.1:8000/": dial tcp 127.0.0.1:8000: connect: connection refused 将进行第 3 次重试
[2022-07-30 20:47:59] [WARNING]: 上报 Event 数据到 http://127.0.0.1:8000/ 失败: Post "http://127.0.0.1:8000/": dial tcp 127.0.0.1:8000: connect: connection refused 将进行第 2 次重试

为什么停止后自动更新无效

04:03:41->pwd
/root/TG-EFB-QQ-Docker
[root@CloudCone]
05:35:36->docker-compose down
Stopping efb ... done
Stopping gocq ... done
Removing efb ... done
Removing gocq ... done
[root@CloudCone]
05:36:10->

docker run -d \
--name watchtower \
--restart unless-stopped \
-v /var/run/docker.sock:/var/run/docker.sock \
containrrr/watchtower -c \
--interval 3600 \
efb gocq

802b8fba3c7e6ab02f4cceee7b7d1239068c06857614e1e3b3ed6dd386b4db54
[root@CloudCone]
05:36:14->pip3 install --upgrade efb-qq-slave
Requirement already satisfied: efb-qq-slave in /usr/local/lib/python3.8/dist-packages (2.0.1)
xxxx
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

还是提示
New version(2.0.1) of EFB-QQ-Slave has released! Please manually update EQS by stopping ehForwarderbot first and then execute pip3 install --upgrade efb-qq-slave

qq群发不了消息

已经挂了1个月了,qq群还是无法发消息,查看日志还是提示:群消息发送失败: 账号可能被风控

登录失败:qq版本过低

目前已经不能正常登录,遇到如下报错
root@debian:~/TG-EFB-QQ-Docker# docker run --rm -it --name="gocq" -v $PWD/gocq:/data xzsk2/gocqhttp-docker:latest -update-protocol
[2023-06-15 23:19:13] [INFO]: 当前版本:v1.0.1
[2023-06-15 23:19:13] [INFO]: 将使用 device.json 内的设备信息运行Bot.
[2023-06-15 23:19:13] [INFO]: Bot将在5秒后登录并开始信息处理, 按 Ctrl+C 取消.
[2023-06-15 23:19:18] [INFO]: 开始尝试登录并同步消息...
[2023-06-15 23:19:18] [INFO]: 使用协议: iPad 8.9.33.614
[2023-06-15 23:19:19] [INFO]: 正在检查协议更新...
[2023-06-15 23:19:20] [INFO]: Protocol -> connect to server: 43.154.240.13:8080
[2023-06-15 23:19:21] [WARNING]: 登录失败: 你当前使用的QQ版本过低,请前往QQ官网im.qq.com下载最新版QQ后重试。 Code: 45
[2023-06-15 23:19:21] [WARNING]: 你的账号涉嫌违规被限制在非常用设备登录, 请在手机QQ登录并根据提示完成认证
[2023-06-15 23:19:21] [WARNING]: 或使用 -update-protocol 升级到最新协议后重试
[2023-06-15 23:19:21] [INFO]: 按 Enter 继续....

EFB 报错 Connection refused

5700端口connection refused,netstat -lntp 显示没有程序在监听5700端口,可能是gocq那边的问题?
logs:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/urllib3/connection.py", line 174, in _new_conn
    conn = connection.create_connection(
  File "/usr/local/lib/python3.9/site-packages/urllib3/util/connection.py", line 96, in create_connection
    raise err
  File "/usr/local/lib/python3.9/site-packages/urllib3/util/connection.py", line 86, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 699, in urlopen
    httplib_response = self._make_request(
  File "/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 394, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/usr/local/lib/python3.9/site-packages/urllib3/connection.py", line 239, in request
    super(HTTPConnection, self).request(method, url, body=body, headers=headers)
  File "/usr/local/lib/python3.9/http/client.py", line 1285, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/local/lib/python3.9/http/client.py", line 1331, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.9/http/client.py", line 1280, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.9/http/client.py", line 1040, in _send_output
    self.send(msg)
  File "/usr/local/lib/python3.9/http/client.py", line 980, in send
    self.connect()
  File "/usr/local/lib/python3.9/site-packages/urllib3/connection.py", line 205, in connect
    conn = self._new_conn()
  File "/usr/local/lib/python3.9/site-packages/urllib3/connection.py", line 186, in _new_conn
    raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7fb7314711f0>: Failed to establish a new connection: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/requests/adapters.py", line 439, in send
    resp = conn.urlopen(
  File "/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 755, in urlopen
    retries = retries.increment(
  File "/usr/local/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 0x7fb7314711f0>: Failed to establish a new connection: [Errno 111] Connection refused'))

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 644, in _coolq_api_wrapper
    res = func(**kwargs)
  File "/usr/local/lib/python3.9/site-packages/cqhttp/__init__.py", line 21, in do_call
    resp = requests.post(url, json=kwargs, headers=headers)
  File "/usr/local/lib/python3.9/site-packages/requests/api.py", line 117, in post
    return request('post', url, data=data, json=json, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/requests/api.py", line 61, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 542, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 655, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/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 0x7fb7314711f0>: Failed to establish a new connection: [Errno 111] Connection refused'))

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 682, in check_status_periodically
    flag = self.check_running_status()
  File "/usr/local/lib/python3.9/site-packages/efb_qq_plugin_go_cqhttp/GoCQHttp.py", line 659, in check_running_status
    res = self._coolq_api_wrapper('get_status')
  File "/usr/local/lib/python3.9/site-packages/efb_qq_plugin_go_cqhttp/GoCQHttp.py", line 646, 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 0x7fb7314711f0>: Failed to establish a new connection: [Errno 111] Connection refused'))

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 370, in __init__
    self.check_status_periodically(threading.Event())
  File "/usr/local/lib/python3.9/site-packages/efb_qq_plugin_go_cqhttp/GoCQHttp.py", line 685, in check_status_periodically
    self.deliver_alert_to_master(self._("We're unable to communicate with CoolQ Client.\n"
  File "/usr/local/lib/python3.9/site-packages/efb_qq_plugin_go_cqhttp/GoCQHttp.py", line 723, 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 795, 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 0x7fb7314711f0>: Failed to establish a new connection: [Errno 111] Connection refused'))

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!

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.