Giter Club home page Giter Club logo

efb-qq-slave'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-slave's People

Contributors

blueset avatar hinatakato avatar milkice233 avatar ojhdt avatar reallyimeric avatar seiuneko avatar shejialuo avatar stellarpurr avatar tttpob avatar xixiha5230 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  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  avatar  avatar  avatar  avatar

efb-qq-slave's Issues

Add audio support

因为如果要加入语音支持的话,必须要替换酷Q原文件,感觉有点脏所以暂时不考虑实现。有需求的可以在下面提出。

启动ehforwarderbot报错

ehforwarderbot.main (main.init; main.py:85)
Initializing slave milkice.qq...
Traceback (most recent call last):
File "/usr/local/bin/ehforwarderbot", line 11, in
sys.exit(main())
File "/usr/local/lib/python3.6/dist-packages/ehforwarderbot/main.py", line 269, in main
init(conf)
File "/usr/local/lib/python3.6/dist-packages/ehforwarderbot/main.py", line 91, in init
coordinator.add_channel(cls(instance_id=instance_id))
File "/usr/local/lib/python3.6/dist-packages/efb_qq_slave/init.py", line 43, in init
self.load_config()
File "/usr/local/lib/python3.6/dist-packages/efb_qq_slave/init.py", line 69, in load_config
self.config: Dict[str, Any] = yaml.load(f)
File "/usr/lib/python3/dist-packages/yaml/init.py", line 72, in load
return loader.get_single_data()
File "/usr/lib/python3/dist-packages/yaml/constructor.py", line 35, in get_single_data
node = self.get_single_node()
File "/usr/lib/python3/dist-packages/yaml/composer.py", line 36, in get_single_node
document = self.compose_document()
File "/usr/lib/python3/dist-packages/yaml/composer.py", line 55, in compose_document
node = self.compose_node(None, None)
File "/usr/lib/python3/dist-packages/yaml/composer.py", line 84, in compose_node
node = self.compose_mapping_node(anchor)
File "/usr/lib/python3/dist-packages/yaml/composer.py", line 127, in compose_mapping_node
while not self.check_event(MappingEndEvent):
File "/usr/lib/python3/dist-packages/yaml/parser.py", line 98, in check_event
self.current_event = self.state()
File "/usr/lib/python3/dist-packages/yaml/parser.py", line 439, in parse_block_mapping_key
"expected , but found %r" % token.id, token.start_mark)
yaml.parser.ParserError: while parsing a block mapping
in "/root/.ehforwarderbot/profiles/default/milkice.qq/config.yaml", line 1, column 1
expected , but found ''
in "/root/.ehforwarderbot/profiles/default/milkice.qq/config.yaml", line 2, column 5

http上报404问题

log
[2019-04-08 15:28:39.322] [I] [HTTP] 开启 HTTP 服务器成功,开始监听 http://[::]:5700
[2019-04-08 15:28:39.326] [W] [HTTP] 通过 HTTP 上报数据到 http://xxx:5700 失败,状态码:404

Cannot send message to groups

I cannot send messages to groups whether in unlinked chat with the bot, or the linked chat.

But I can see the messges from the groups, and can view/send messages with friends.

mirai 启动ehforwarderbot报错

Snipaste_2020-09-10_11-34-53
报错信息为
yaml.scanner.ScannerError: mapping values are not allowed here
in "/root/.ehforwarderbot/profiles/default/milkice.qq/config.yaml", line 2, column 9
见上图

Snipaste_2020-09-10_11-31-40
在启动miriai之后,出现两条[ERROR]信息为
[ERROR] [CQHTTPMirai] Exception in ReportService
[ERROR] [CQHTTPMirai] java.net.ConnectException: Failed to connect to
/127.0.0.1:8000
见上图

发图失败

Message is not sent.

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

efb-telegram-master的update_info功能支持

master有一个很好用的功能
链接聊天到群组后,输入/update_info后就可以修改改群组名称为从端获取到的name 以及 profile picture到群组信息中。十分方便。
而qq-slave会报:
Error occurred while update chat information.
'ETMChat' object has no attribute 'channel_id'
的错误,求大佬支持。谢谢

TypeError: string indices must be integers, return status 500

https://github.com/milkice233/efb-qq-slave/blob/ae62beb1ecf09657eeb25297796d8bd508a2cf1a/efb_qq_slave/Clients/CoolQ/CoolQ.py#L77

2019-08-25T14-17-43+08

traceback ouput

2019-08-25 06:15:59,555 [DEBUG]: efb_qq_slave.Clients.CoolQ.CoolQ (CoolQ.handle_msg; CoolQ.py:71)
    {'anonymous': None, 'font': 1328896, 'group_id': ******, 'message': '******', 'message_id': 141, 'message_type': 'group', 'post_type': 'message', 'raw_message': '******', 'self_id': ******, 'sender': {'age': 0, 'area
': '', 'card': '******', 'level': '话唠', 'nickname': '******', 'role': 'member', 'sex': 'unknown', 'title': '', 'user_id': ******}, 'sub_type': 'normal', 'time': 1566713759, 'user_id': ******}
2019-08-25 06:15:59,558 [DEBUG]: root (CoolQ.handle_msg; CoolQ.py:78)
    start
2019-08-25 06:15:59,558 [DEBUG]: root (CoolQ.handle_msg; CoolQ.py:79)
    0
2019-08-25 06:15:59,558 [DEBUG]: root (CoolQ.handle_msg; CoolQ.py:80)
    ******
2019-08-25 06:15:59,558 [DEBUG]: root (CoolQ.handle_msg; CoolQ.py:81)
    end
2019-08-25 06:15:59,559 [ERROR]: cqhttp (app.log_exception; app.py:1891)
    Exception on / [POST]
Traceback (most recent call last):
  File "/usr/lib/python3.7/site-packages/flask/app.py", line 2446, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/lib/python3.7/site-packages/flask/app.py", line 1951, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/lib/python3.7/site-packages/flask/app.py", line 1820, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/usr/lib/python3.7/site-packages/flask/app.py", line 1949, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/lib/python3.7/site-packages/flask/app.py", line 1935, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/usr/lib/python3.7/site-packages/cqhttp/__init__.py", line 100, in _handle
    response = handler(payload)
  File "/usr/lib/python3.7/site-packages/cqhttp/__init__.py", line 36, in wrapper
    return func(*args, **kwargs)
  File "/usr/lib/python3.7/site-packages/efb_qq_slave/Clients/CoolQ/CoolQ.py", line 82, in handle_msg
    msg_type = msg_element[i]['type']
TypeError: string indices must be integers
2019-08-25 06:34:15,536 [INFO]: werkzeug (_internal._log; _internal.py:122)
    127.0.0.1 - - [25/Aug/2019 06:34:15] "POST / HTTP/1.1" 500 -


ehforwarderbot -V

EH Forwarder Bot
Version: 2.0.0b20.dev3
Python version:
3.7.4 (default, Jul 16 2019, 07:12:58)
[GCC 9.1.0]
Running on profile "default".

Master channel:
    Telegram Master (blueset.telegram) 2.0.0b26.dev5 # Default instance

Slave channel:
    QQ Slave (milkice.qq) 2.0.0a10 # Default instance

Middlewares:
    No middleware is enabled.

pacman -Qi python-efb-qq-slave-git python-efb-telegram-master-git python-ehforwarderbot-git coolq-pro-bin coolq-cqhttp-api-bin

名字           : python-efb-qq-slave-git
版本           : r95.ae62beb-1
描述           : EFB QQ Slave, a channel for EH Forwarder Bot.
架构           : any
URL            : https://github.com/milkice233/efb-qq-slave
软件许可       : GPL3
组             : 无
提供           : python-efb-qq-slave
依赖于         : python>=3.6  python-ehforwarderbot  python-telegram-bot  python-requests  python-magic  python-pyaml  python-pillow
python-cqhttp  ffmpeg
可选依赖       : 无
依赖它         : 无
被可选依赖     : 无
与它冲突       : python-efb-qq-slave
取代           : 无
安装后大小     : 189.00 KiB
打包者         : Unknown Packager
编译日期       : 2019年08月25日 星期日 02时26分27秒
安装日期       : 2019年08月25日 星期日 02时34分20秒
安装原因       : 单独指定安装
安装脚本       : 否
验证者         : 无

名字           : python-efb-telegram-master-git
版本           : r192.7ab5eab-1
描述           : EFB Telegram Master, a channel for EH Forwarder Bot.
架构           : any
URL            : https://github.com/blueset/efb-telegram-master
软件许可       : AGPL-3
组             : efb
提供           : python-efb-telegram-master
依赖于         : python-yaml  python-ehforwarderbot  python-telegram-bot  python-magic-ahupp  python-moviepy  python-imageio-ffmpeg  p
ython-peewee  python-requests  python-pydub  python-retrying  python-language-tags
可选依赖       : 无
依赖它         : 无
被可选依赖     : 无
与它冲突       : python-efb-telegram-master
取代           : 无
安装后大小     : 841.00 KiB
打包者         : Unknown Packager
编译日期       : 2019年08月25日 星期日 02时22分51秒
安装日期       : 2019年08月25日 星期日 02时34分39秒
安装原因       : 单独指定安装
安装脚本       : 否
验证者         : 无

名字           : python-ehforwarderbot-git
版本           : r429.400de55-1
描述           : An extensible message tunneling chat bot framework. Delivers messages to and from multiple platforms and remotely con
trol your accounts.
架构           : any
URL            : https://github.com/blueset/ehForwarderBot
软件许可       : AGPL-3
组             : efb
提供           : python-ehforwarderbot
依赖于         : python-ruamel-yaml  python-bullet  python-cjkwrap  python-typing-extensions
可选依赖       : 无
依赖它         : python-efb-qq-slave-git  python-efb-telegram-master-git
被可选依赖     : 无
与它冲突       : python-ehforwarderbot
取代           : 无
安装后大小     : 407.00 KiB
打包者         : Unknown Packager
编译日期       : 2019年08月25日 星期日 01时53分25秒
安装日期       : 2019年08月25日 星期日 02时34分20秒
安装原因       : 单独指定安装
安装脚本       : 是
验证者         : 无

名字           : coolq-pro-bin
版本           : 5.14.10-1
描述           : 一款智能机器人软件,由应用提供群管理、智能对话、好友互动、生活助理等智能功能。
架构           : any
URL            : https://cqp.cc/t/14901
软件许可       : custom
组             : 无
提供           : coolq
依赖于         : wine
可选依赖       : 无
依赖它         : coolq-cqhttp-api-bin  coolq-vnc
被可选依赖     : 无
与它冲突       : 无
取代           : 无
安装后大小     : 2.33 MiB
打包者         : Unknown Packager
编译日期       : 2019年08月25日 星期日 04时31分16秒
安装日期       : 2019年08月25日 星期日 04时31分28秒
安装原因       : 单独指定安装
 安装脚本       : 否
验证者         : 无

名字           : coolq-cqhttp-api-bin
版本           : 4.10.1-1
描述           : CoolQ 插件实现通过 HTTP 上报事件信息及调用接口
架构           : any
URL            : https://github.com/richardchien/coolq-http-api
软件许可       : GPL3
组             : 无
提供           : coolq-cqhttp-api
依赖于         : coolq
可选依赖       : 无
依赖它         : 无
被可选依赖     : 无
与它冲突       : 无
取代           : 无
安装后大小     : 1180.00 KiB
打包者         : Unknown Packager
编译日期       : 2019年08月25日 星期日 03时58分42秒
安装日期       : 2019年08月25日 星期日 04时11分30秒
安装原因       : 单独指定安装
安装脚本       : 否
验证者         : 无


milkice.qq/config.yaml

Client: CoolQ                         # 指定要使用的 QQ 客户端(此处为CoolQ)
CoolQ:
    type: HTTP                        # 指定 efb-qq-slave 与 酷Q 通信的方式 现阶段仅支持HTTP
    access_token: *****
    api_root: http://127.0.0.1:5700/  # 酷Q API接口地址/端口
    host: 127.0.0.1                  # efb-qq-slave 所监听的地址用于接收消息
    port: 8000                        # 同上
    is_pro: True                     # 若为酷Q Pro则为true,反之为false
    air_option:                       # 包含于 air_option 的配置选项仅当 is_pro 为 false 时才有效
        upload_to_smms: True          # 将来自 EFB主端(通常是Telegram) 的图片上传到 sm.ms 服务器并以链接的形式发送到 QQ 端

io.github.richardchien.coolqhttpapi/config.json

{
    "general": {
        "host": "127.0.0.1",
        "post_url": "http://127.0.0.1:8000",
        "access_token": "*****"
    }
}

(迫于开学 可能下星期六晚才能回复 抱歉

依赖版本号检查导致启动失败

错误信息是
pkg_resources.ContextualVersionConflict: (h11 0.9.0 (/usr/local/lib/python3.6/dist-packages), Requirement.parse('h11~=0.8.1'), {'wsproto'})
应该是本地的版本号比较高

无法接收图片

容器内 /coolq/data/image/ 中有 cqimg 文件,但 Telegram 端图片消息显示 [Download image failed, please check on your QQ client] 。

系统 Debian 8

CoolQ 配置
docker run -ti --rm --name cqhttp-test --net="host"
-v $(pwd)/coolq:/root/coolq # mount coolq folder
-p 9000:9000 # 网页noVNC端口
-p 5700:5700 # 酷Q对外提供的API接口的端口
-e VNC_PASSWD=******** # 请修改 VNC 密码!!!!
-e COOLQ_PORT=5700 # 酷Q对外提供的API接口的端口
-e COOLQ_ACCOUNT=******** # 在此输入要登录的QQ号,虽然可选但是建议填入
-e CQHTTP_POST_URL=http://127.0.0.1:8000 # efb-qq-slave监听的端口/地址 用于接受传入的消息
-e CQHTTP_SERVE_DATA_FILES=yes # 允许以HTTP方式访问酷Q数据文件
-e CQHTTP_ACCESS_TOKEN=ac0f790e1fb74ebcaf45da77a6f9de47 # Access Token
-e CQHTTP_POST_MESSAGE_FORMAT=array # 回传消息时使用数组(必选)
richardchien/cqhttp:latest

EFB配置
Client: CoolQ
CoolQ:
type: HTTP
access_token: ac0f790e1fb74ebcaf45da77a6f9de47
api_root: http://127.0.0.1:5700/
host: 127.0.0.1
port: 8000
is_pro: false
air_option:
upload_to_smms: true

telegram端无法接收到好友的消息

好友发来的消息无法在telegram端收到,也没有任何提示,但在telegram端可以成功给好友发送消息。
我看了下mirai运行的信息,如下第一张图
如下第二张图是EQS运行的信息

Snipaste_2020-09-10_19-35-15

image

TG能发送消息,但是接收不到

服务器上的COOLQ能看见QQ发过来的消息,但是TG上的BOT没有显示;
TG的BOT发送消息,服务器上的COOLQ能看见BOT发过来的消息,QQ客户端也能看见。
efb都已重新卸载安装一遍,目前版本:
qq- slave:2.0.0a10
tg-master : 2.0.0b22
ebf : 2.0.0b15

docker-compose

自用的时候 写了docker-compose文件 https://github.com/Earth-Online/efb-qq-docker 可以添加到readme docker安装

Telegram Group 消息link到 QQ Group 的时候添加发送人姓名

你好,我已经成功linkTelegram GroupQQ Group之间的相互转发通信。

问题

telegram的消息从group转发到qq group的时候,没有发送人的姓名,反之则有。
如图:
image

期望

QQ Group的转发消息前面能加上 WangJi: 的前缀,标明发送人

是否漏掉了一些配置项?烦请指点一下。

建议合并分支

前几天更新了ehforwarderbot,发现结构变化太大了,efb-qq-slave直接崩了,我下载了最新的那个分支,替换了site-package里面对应的文件夹才行。估计蛮多小伙伴都会更新ehforwarderbot,所以还是建议作者合并一下分支,或者版本管理一下?谢了

Todo List

  • [酷Q] 当用户接收到好友名片时,支持直接从 Telegram 添加好友 (qq_contact_wrapper)(不可实现)
  • [酷Q] 实现语音收发,如果暂时不支持语音的话向 主端 发送消息告知用户收到一条语音
  • [酷Q] 富文本(rich)消息支持(暂时未能成功复现富文本,因而处理富文本消息时会爆exception)
  • [酷Q] 对于音乐分享类消息,适配更多音乐分享类消息(需要更多样例)
  • [EQS] 加上漏加的 版本信息
  • [EQS] 在at消息中,若at的人并不是用户自身同时也不是at全体用户,则将 @blahblah 的超链接设置为可以被用户点击打开并跳转到相应QQ Chat的形式(表述不清= =)
  • [酷Q] 回复他人的消息会触发原消息引用,实现原消息内容截断功能(防止原消息过长导致的刷屏)
  • [酷Q] 当回复他人消息时,将原消息中的html标签去除(比如at),只保留纯文本消息(主端 issue)
  • [EQS] 实现群文件自动下载功能 (已实现一半,大小>50M的文件无法下载,中文文件名文件无法下载(上游问题))
  • [EQS] 实现加群处理请求(创建虚拟chat user并将所有加群请求囊括其中,同时实现自定义命令以屏蔽特定群组之通知)
  • [EQS] 编写dockerfile帮助自动化安装 (https://github.com/Earth-Online/efb-qq-coolq-docker)
  • [EQS] 关键词/贴纸包黑名单
  • [EQS] 处理消息时直接丢另外一个线程返回 防止堵塞导致消息丢失
  • [EQS] 撤回消息似乎有点问题 (似乎是 CoolQ 上游问题)
  • [EQS] 优化签到消息
  • [EQS] 从主端传来的GIF需要压缩 缩小尺寸 减帧 以适应QQ的10fps GIF播放速度
  • [EQS] 多语言支持
  • [EQS] /update_info 支持(更新群名片+头像)
  • [酷Q] 增加群公告提醒(自动@所有人+发送公告内容)
  • [酷Q] 提前调用 can_send_images 以判断是否可直接发送图片
  • [EQS] 可以自定义屏蔽群组中的人 或者只传送群组中的特定成员的消息发送到主端

自己留着备忘,当然同时欢迎 contribution

群文件下载

想要提供一个群文件下载功能.看了一下http api列表没有这个功能.如果用web群空间下载的话, 需要提供群号和文件id, 文件id可以在事件里找到. 作者有什么好办法优雅实现么

TypeError: string indices must be integers

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

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

有些收到的图片没有后缀名

图片

log:
2019-11-25 08:29:44,847 [INFO]: werkzeug (internal.log; internal.py:122)
192.168.44.1 - - [25/Nov/2019 08:29:44] "POST / HTTP/1.1" 200 -
2019-11-25 08:29:44,848 [DEBUG]: peewee (peewee.execute_sql; peewee.py:2993)
('SELECT "t1"."id", "t1"."master_uid", "t1"."slave_uid" FROM "chatassoc" AS "t1" WHERE ("t1"."slave_uid" = ?)', ['milkice.qq private
'])
2019-11-25 08:29:44,848 [DEBUG]: efb_telegram_master.slave_message (slave_message.get_slave_msg_dest; slave_message.py:247)
[b0805a8f-5218-4010-91ab-44c4dd4d2c94_50176_0] The message should deliver to blueset.telegram -

2019-11-25 08:29:44,849 [DEBUG]: peewee (peewee.execute_sql; peewee.py:2993)
('SELECT "t1"."id", "t1"."master_uid", "t1"."slave_uid" FROM "chatassoc" AS "t1" WHERE ("t1"."master_uid" = ?)', ['blueset.telegram -*****'])
2019-11-25 08:29:44,849 [DEBUG]: efb_telegram_master.slave_message (slave_message.get_slave_msg_dest; slave_message.py:255)
[b0805a8f-5218-4010-91ab-44c4dd4d2c94_50176_0] Message is in chat <EFBChat: ***** (private
) @ QQ Slave (Notification: ALL)>
2019-11-25 08:29:44,849 [DEBUG]: efb_telegram_master.slave_message (slave_message.get_slave_msg_dest; slave_message.py:268)
[b0805a8f-5218-4010-91ab-44c4dd4d2c94_50176_0] Message is sent to Telegram chat -
, with header "".
2019-11-25 08:29:45,385 [DEBUG]: efb_telegram_master.slave_message (slave_message.slave_message_image; slave_message.py:393)
[b0805a8f-5218-4010-91ab-44c4dd4d2c94_50176_0] Message is of MsgType.Image type; Path: /tmp/tmpwk6_gxgj; MIME: image/jpeg
2019-11-25 08:29:45,385 [DEBUG]: efb_telegram_master.slave_message (slave_message.slave_message_image; slave_message.py:395)
[b0805a8f-5218-4010-91ab-44c4dd4d2c94_50176_0] Size of /tmp/tmpwk6_gxgj is 33076.
2019-11-25 08:29:46,620 [DEBUG]: efb_telegram_master.slave_message (slave_message.dispatch_message; slave_message.py:202)
[b0805a8f-5218-4010-91ab-44c4dd4d2c94_50176_0] Message is sent to the user with telegram message id -*****.232391.
2019-11-25 08:29:46,621 [DEBUG]: efb_telegram_master.slave_message (slave_message.dispatch_message; slave_message.py:207)
[b0805a8f-5218-4010-91ab-44c4dd4d2c94_50176_0] Pickle size: 694
2019-11-25 08:29:46,621 [DEBUG]: peewee (peewee.execute_sql; peewee.py:2993)
('SELECT "t1"."id", "t1"."slave_channel_id", "t1"."slave_channel_emoji", "t1"."slave_chat_uid", "t1"."slave_chat_group_id", "t1"."slave_chat_name", "t1"."slave_chat_alias", "t1"."slave_chat_type", "t1"."pickle" FROM "slavechatinfo" AS "t1" WHERE ((("t1"."slave_channel_id" = ?) AND ("t1"."slave_chat_uid" = ?)) AND ("t1"."slave_chat_group_id" IS ?)) LIMIT ?', ['milkice.qq', 'private
', None, 1])
2019-11-25 08:29:46,622 [DEBUG]: peewee (peewee.execute_sql; peewee.py:2993)
('UPDATE "slavechatinfo" SET "slave_channel_id" = ?, "slave_channel_emoji" = ?, "slave_chat_uid" = ?, "slave_chat_group_id" = ?, "slave_chat_name" = ?, "slave_chat_alias" = ?, "slave_chat_type" = ?, "pickle" = ? WHERE ("slavechatinfo"."id" = ?)', ['milkice.qq', '🐧', 'private_
', None, '', '', 'User', <memory at 0x7f914415aac8>, 305])
2019-11-25 08:29:46,632 [DEBUG]: peewee (peewee.execute_sql; peewee.py:2993)
('INSERT INTO "msglog" ("master_msg_id", "master_msg_id_alt", "slave_message_id", "text", "slave_origin_uid", "slave_origin_display_name", "slave_member_uid", "slave_member_display_name", "media_type", "mime", "file_id", "msg_type", "pickle", "sent_to", "time") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', ['-
.232391', None, 'b0805a8f-5218-4010-91ab-44c4dd4d2c94_50176_0', '发送图片。', 'milkice.qq private_', '', 'private_**', '', 'Document', None, 'BQADAQADhwADWmvhRoQS985jz1fBFgQ', 'Image', <memory at 0x7f914415aac8>, 'slave', datetime.datetime(2019, 11, 25, 8, 29, 46, 632570)])

api_query函数未返回值导致get_friend函数抛出异常

    def coolq_api_query(self, func_name, **kwargs):
        """ # Do not call get_status too frequently
        if self.check_running_status():
            return self._coolq_api_wrapper(func_name, **kwargs)
        """
        if self.is_logged_in and self.is_connected:
            return self._coolq_api_wrapper(func_name, **kwargs)
        elif self.repeat_counter < 3:
            self.deliver_alert_to_master(self._('Your status is offline.\n'
                                                'You may try login with /0_login'))
            self.repeat_counter += 1

这个函数在未登陆时返回的是NULL.

    def update_friend_list(self):
        # Warning: Experimental API
        self.friend_list = self.coolq_api_query('_get_friend_list')
        self.logger.debug('Update friend list completed. Entries: %s', len(self.friend_list))

认为这个函数必然会有一个返回值
所以在未登录成功时调用/link 会导致抛出异常

bot_1     |   File "/usr/local/lib/python3.6/site-packages/efb_qq_slave/Clients/CoolQ/CoolQ.py", line 580, in update_friend_list
bot_1     |     self.logger.debug('Update friend list completed. Entries: %s', len(self.friend_list))
bot_1     | TypeError: object of type 'NoneType' has no len()

卡在处理中…

qq公众号*扰问题

qq课堂,qq游戏之类私聊*扰有点烦人

腾讯课堂: (unsupported)
[Here comes the Rich Text, dumping...] 
text:UG设计大咖成长秘籍!《年后涨薪必修课》 2月27日
url:http://q.url.cn/url/Jump?url=https%3A%2F%2Fm.ke.qq.com%2FcourseDetail.html%3Fcourse_id%3D100422834%26_bid%3D167%26_wv%3D1%26from%3D800001669%26callApp%3D1%26mp_sourceid%3D0.0.0&_wv=1&rdm=52f54c

又屏蔽不了,暂时没找到合理的解决方案.

API 过期

/efb_qq_slave/Clients/CoolQ/Utils.py
def download_file_from_qzone

qun.qzone.qq.com

这个域名已经没了

ehforwarderbot无法启动 提示无法载入EFBChannel模块

报错信息如下:

Traceback (most recent call last):
  File "/usr/local/bin/ehforwarderbot", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.6/dist-packages/ehforwarderbot/__main__.py", line 263, in main
    conf = config.load_config()
  File "/usr/local/lib/python3.6/dist-packages/ehforwarderbot/config.py", line 60, in load_config
    channel = utils.locate_module(i, 'slave')
  File "/usr/local/lib/python3.6/dist-packages/ehforwarderbot/utils.py", line 145, in locate_module
    return i.load()
  File "/usr/local/lib/python3.6/dist-packages/pkg_resources/__init__.py", line 2443, in load
    return self.resolve()
  File "/usr/local/lib/python3.6/dist-packages/pkg_resources/__init__.py", line 2449, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/local/lib/python3.6/dist-packages/efb_qq_slave/__init__.py", line 11, in <module>
    from ehforwarderbot import EFBChannel, ChannelType, EFBMsg, EFBStatus, EFBChat, MsgType
ImportError: cannot import name 'EFBChannel'

基本依赖已安装并满足要求,确认配置文件无误。

AttributeError: 'function' object has no attribute 'get_chats'

问题描述

启动服务后向Telegram机器人发送任何指令均无作用,且转发服务无法运行。VNC成功运行且已登陆QQ账号,酷Q机器人正常运行并可执行互动式向导,在ehforwarderbot日志中发现AttributeError。

重现步骤

  1. sslocal -c /etc/shadowsocks/config.json &
    docker run -ti --rm --name cqhttp-test --net="host" \
     -v $(pwd)/coolq:/home/user/coolq     \
     -p 9000:9000                                         \
     -p 5700:5700                                         \
     -e VNC_PASSWD=blahblah                    \
     -e COOLQ_PORT=5700                         \
     -e COOLQ_ACCOUNT=123456789    \
     -e CQHTTP_POST_URL=http://127.0.0.1:8000    \
     -e CQHTTP_SERVE_DATA_FILES=yes     \
     -e CQHTTP_ACCESS_TOKEN=ac0f790e1fb74ebcaf45da77a6f9de47  \
     -e CQHTTP_POST_MESSAGE_FORMAT=array   \
     richardchien/cqhttp:latest
  1. proxychains ehforwarderbot
  2. 向Telegram机器人发送“/chat”

日志

  • docker
WARNING: Published ports are discarded when using host network mode
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] 010-app: applying... 
[fix-attrs.d] 010-app: exited 0.
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 010-setup-vnc: executing... 
Would you like to enter a view-only password (y/n)? Password:Verify:[cont-init.d] 010-setup-vnc: exited 0.
[cont-init.d] 020-setup-sudo: executing... 
[cont-init.d] 020-setup-sudo: exited 0.
[cont-init.d] 110-get-coolq: executing... 
CoolQ already exists, skip download.
DEBUG: 插件版本已锁定,开始覆盖 cpk 文件……
INFO: CoolQ HTTP API 插件 bootstrap 完成。
[cont-init.d] 110-get-coolq: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
xauth:  file /home/user/.Xauthority does not exist
WebSocket server settings:
  - Listen on :9001
  - No SSL/TLS support (no cert file)
  - proxying from :9001 to 127.0.0.1:5911

New 'iZuf6i3xfl9zacvzwqpz8vZ:11 (user)' desktop is iZuf6i3xfl9zacvzwqpz8vZ:11

Creating default startup script /home/user/.vnc/xstartup
Creating default config /home/user/.vnc/config
Starting applications specified in /home/user/.vnc/xstartup
Log file is /home/user/.vnc/iZuf6i3xfl9zacvzwqpz8vZ:11.log

[CQDaemon] Starting CoolQ ....
[CQDaemon] Started CoolQ .
[2019-09-14 04:00:06.109] [I] [日志] 日志控制台开启成功
[2019-09-14 04:00:06.115] [I] [HTTP] 开启 HTTP 服务器成功,开始监听 http://[::]:5700
[2019-09-14 04:00:06.136] [I] [HTTP] 通过 HTTP 上报数据到 http://127.0.0.1:8000 成功,状态码:200
  • ehforwarderbot
ProxyChains-3.1 (http://proxychains.sf.net)
2019-09-14 10:59:08,037 [Level 99]: ehforwarderbot.__main__ (__main__.init; __main__.py:85)
     Initializing slave milkice.qq... 
2019-09-14 10:59:08,045 [Level 99]: ehforwarderbot.__main__ (__main__.init; __main__.py:96)
     Slave channel QQ Slave (milkice.qq) # Default profile is initialized. 
2019-09-14 10:59:08,045 [Level 99]: ehforwarderbot.__main__ (__main__.init; __main__.py:99)
     Initializing master blueset.telegram... 
|DNS-request| api.telegram.org 
|S-chain|-<>-127.0.0.1:1080-<><>-4.2.2.2:53-<><>-OK
|DNS-response| api.telegram.org is 149.154.167.220
|S-chain|-<>-127.0.0.1:1080-<><>-149.154.167.220:443-<><>-OK
2019-09-14 10:59:10,373 [Level 99]: ehforwarderbot.__main__ (__main__.init; __main__.py:109)
     Master channel Telegram Master (blueset.telegram) # Default profile is initialized. 
2019-09-14 10:59:10,373 [Level 99]: ehforwarderbot.__main__ (__main__.init; __main__.py:111)
     All channels initialized. 
2019-09-14 10:59:10,373 [Level 99]: ehforwarderbot.__main__ (__main__.init; __main__.py:125)
     All middlewares are initialized. 
|S-chain|-<>-127.0.0.1:1080- * Serving Flask app "cqhttp" (lazy loading)
 * Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 * Debug mode: off
<><>-127.0.0.1:5700-<><>-OK
|DNS-request| api.telegram.org 
|S-chain|-<>-127.0.0.1:1080-<><>-4.2.2.2:53-<><>-OK
|DNS-response| api.telegram.org is 149.154.167.220
|S-chain|-<>-127.0.0.1:1080-<><>-149.154.167.220:443-<><>-OK
2019-09-14 11:00:55,508 [ERROR]: telegram.ext.dispatcher (dispatcher.process_update; dispatcher.py:301)
    An uncaught error was raised while processing the update
Traceback (most recent call last):
  File "/home/nutr1t07/.local/lib/python3.6/site-packages/telegram/ext/dispatcher.py", line 279, in process_update
    handler.handle_update(update, self)
  File "/home/nutr1t07/.local/lib/python3.6/site-packages/telegram/ext/commandhandler.py", line 173, in handle_update
    return self.callback(dispatcher.bot, update, **optional_args)
  File "/home/nutr1t07/.local/lib/python3.6/site-packages/efb_telegram_master/chat_binding.py", line 678, in start_chat_list
    return self.chat_head_req_generate(bot, target, pattern=" ".join(args), chats=chats)
  File "/home/nutr1t07/.local/lib/python3.6/site-packages/efb_telegram_master/chat_binding.py", line 727, in chat_head_req_generate
    source_chats=chats)
  File "/home/nutr1t07/.local/lib/python3.6/site-packages/efb_telegram_master/chat_binding.py", line 330, in slave_chats_pagination
    slave_chats = slave.get_chats()
  File "/home/nutr1t07/.local/lib/python3.6/site-packages/efb_qq_slave/__init__.py", line 94, in get_chats
    return self.QQClient.get_chats()
AttributeError: 'function' object has no attribute 'get_chats'

环境

  • Ubuntu 18.04.3 LTS (GNU/Linux 4.15.0-63-generic x86_64)
  • ehforwarderbot 2.0.0b19
  • efb-telegram-master 2.0.0b25
  • efb-qq-slave 2.0.0a10
  • richardchien/cqhttp:latest 2019-09-09T13:40:03.884800217Z

并依照 https://milkice.me/2018/09/17/efb-how-to-send-and-receive-messages-from-qq-on-telegram/ 步骤安装。

config error?

When launching efb:
It says:
yaml.scanner.ScannerError: mapping values are not allowed here
in "/root/.ehforwarderbot/profiles/default/milkice.qq/config.yaml", line 4, column 29

I copied your config but it doesn't work, I got wechat working but not this one.

群里被at后显示错乱

显示(xxxx是tgid)
<a href="tg://user?id=xxxxxxxx">&lt;a hre</a>
内容均无法显示,但tg聊天界面右下角会提示被at了
群里的回复也是相似的错乱

尝试 Link 时报错

在群组中发出 link 指令(start@xxx_bot ) 之后,报错

错误: 未指定消息接收者。
请回复一条过去的消息。(MS02)

尝试多次未果,不知道是哪里的问题。

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.