JQ-Networks/UnifiedMessageRelay

转发至qq失效

kasora opened this issue · 24 comments

telegram发送消息至telegram-bot的时候产生了日志,但是qq-bot并没有反应
并且qq发送消息至qq-bot时没有日志产生,telegram-bot也没有反应。

使用docker构建
https://github.com/Z4HD/coolq-telegram-bot-docker/blob/master/README.md
按照这个步骤来的
json格式会产生错误。所以使用了py格式
容器内文件结构

root@0cf65405cb44:/home/user/coolq-telegram-bot# ls
Architecture.md  bot.log       cqhttp     global_vars.py  LICENSE  message.db  __pycache__  README-zh_CN.md   sample.json
bot_constant.py  ChangeLog.md  daemon.py  image           main     plugins     README.md    requirements.txt  tools

bot_constant.py内容

root@0cf65405cb44:/home/user/coolq-telegram-bot# cat bot_constant.py 
# -*- coding: utf-8 -*-

DEBUG_MODE = True  # log will not take up much place, but it is necessary when locating problems

BAIDU_API = 'asdasdaasd'

# cq-http-api server config
API_ROOT = 'http://127.0.0.1:5700/'  # should be the same as cq-http-api api address
ACCESS_TOKEN = 'access_token'  # should be the same as cq-http-api config
SECRET = 'secret '  # should be the same as cq-http-api config

# cq-http-api client config, should be the same as cq-http-api post config
HOST = '127.0.0.1'
PORT = 8080

TOKEN = '42144xxx:xxxxxxxxxxxxxxxxxxxx'
QQ_BOT_ID = 'xxxxxx'
FORWARD_LIST = [
]
SERVER_PIC_URL = 'http://expample.com/image/'
CQ_ROOT = '/home/user/coolq/'
# if you need socks5 proxy, setup proxy_url as below
# PROXY_URL = 'socks5://127.0.0.1:1080/'
# if you don't need socks5 proxy, set an empty variable
PROXY_URL = ''

python3 daemon.py run跑起来没有报错

root@0cf65405cb44:/home/user/coolq-telegram-bot# python3 daemon.py run
[CTBMain][INFO] (daemon.py:148): Now running in debug mode...
[telegram.ext.dispatcher][DEBUG] (dispatcher.py:131): Setting singleton dispatcher as <telegram.ext.dispatcher.Dispatcher object at 0x7f20c8196080>
[JobQueue][DEBUG] (jobqueue.py:309): JobQueue thread started
[telegram.ext.updater][DEBUG] (updater.py:147): dispatcher - started
[telegram.ext.updater][DEBUG] (updater.py:147): updater - started
[telegram.ext.updater][DEBUG] (updater.py:276): Updater thread started
[telegram.bot][DEBUG] (bot.py:59): Entering: set_webhook
[telegram.vendor.ptb_urllib3.urllib3.connectionpool][DEBUG] (connectionpool.py:835): Starting new HTTPS connection (1): api.telegram.org
[telegram.ext.dispatcher][DEBUG] (dispatcher.py:209): Dispatcher started
Bottle v0.12.13 server starting up (using WSGIRefServer())...
Listening on http://127.0.0.1:8080/
Hit Ctrl-C to quit.

[CTBMain][INFO] (daemon.py:108): Coolq-http-api status: ok
[CTBMain][INFO] (daemon.py:111): Coolq air detected
[CTBPlugin.plugins.qq_namelist][DEBUG] (qq_namelist.py:11): plugins.qq_namelist loading
[CTBMain.main.command][DEBUG] (command.py:55): Registering new command: update namelist(update_namelist)
[CTBMain.main.command][DEBUG] (command.py:73): update namelist(update_namelist) added to global_vars
[CTBPlugin.plugins.show_group_id][DEBUG] (show_group_id.py:13): plugins.show_group_id loading
[CTBMain.main.command][DEBUG] (command.py:55): Registering new command: show group id(show_tg_group_id)
[CTBMain.main.command][DEBUG] (command.py:73): show group id(show_tg_group_id) added to global_vars
[CTBMain.main.command][DEBUG] (command.py:55): Registering new command: show group id(show_qq_group_id)
[CTBMain.main.command][DEBUG] (command.py:73): show group id(show_qq_group_id) added to global_vars
[CTBPlugin.plugins.for_fun][DEBUG] (for_fun.py:9): plugins.for_fun loading
[CTBMain.main.command][DEBUG] (command.py:55): Registering new command: dice(dice)
[CTBMain.main.command][DEBUG] (command.py:73): dice(dice) added to global_vars
[CTBMain.main.command][DEBUG] (command.py:55): Registering new command: rps(rps)
[CTBMain.main.command][DEBUG] (command.py:73): rps(rps) added to global_vars
[CTBMain.main.command][DEBUG] (command.py:55): Registering new command: alipay(show_red_pack)
[CTBMain.main.command][DEBUG] (command.py:73): alipay(show_red_pack) added to global_vars
[CTBPlugin.plugins.recall][DEBUG] (recall.py:10): plugins.recall loading
[CTBMain.main.command][DEBUG] (command.py:55): Registering new command: recall(recall)
[CTBMain.main.command][DEBUG] (command.py:73): recall(recall) added to global_vars
[CTBPlugin.plugins._002_water_meter_control][DEBUG] (_002_water_meter_control.py:12): plugins._002_water_meter_control loading
[CTBPlugin.plugins._002_water_meter_control][DEBUG] (_002_water_meter_control.py:19): Begin loading water meter config
[CTBPlugin.plugins._002_water_meter_control][DEBUG] (_002_water_meter_control.py:116): plugins._002_water_meter_control loaded
[CTBPlugin.plugins._000_admins][DEBUG] (_000_admins.py:12): plugins._000_admins loading
[CTBPlugin.plugins._000_admins][DEBUG] (_000_admins.py:19): Begin loading admin list
[CTBPlugin.plugins._000_admins][DEBUG] (_000_admins.py:93): plugins._000_admins loaded
[CTBPlugin.plugins._001_group_invite][DEBUG] (_001_group_invite.py:13): plugins._001_group_invite loading
[CTBPlugin.plugins._1002_command][DEBUG] (_1002_command.py:12): plugins._1002_command loading
[CTBMain.main.command][DEBUG] (command.py:55): Registering new command: show commands(command_qq)
[CTBMain.main.command][DEBUG] (command.py:73): show commands(command_qq) added to global_vars
[CTBMain.main.command][DEBUG] (command.py:55): Registering new command: show commands(command_tg)
[CTBMain.main.command][DEBUG] (command.py:73): show commands(command_tg) added to global_vars
[CTBMain.main.command][DEBUG] (command.py:55): Registering new command: help(command_qq)
[CTBMain.main.command][DEBUG] (command.py:73): help(command_qq) added to global_vars
[CTBMain.main.command][DEBUG] (command.py:55): Registering new command: help(command_tg)
[CTBMain.main.command][DEBUG] (command.py:73): help(command_tg) added to global_vars
[CTBPlugin.plugins._1001_filter_old_message][DEBUG] (_1001_filter_old_message.py:12): plugins._1001_filter_old_message loading
[CTBPlugin.plugins._1005_drive_mode][DEBUG] (_1005_drive_mode.py:13): plugins._1005_drive_mode loading
[CTBMain.main.command][DEBUG] (command.py:55): Registering new command: drive mode on(drive_mode_on)
[CTBMain.main.command][DEBUG] (command.py:73): drive mode on(drive_mode_on) added to global_vars
[CTBMain.main.command][DEBUG] (command.py:55): Registering new command: drive mode off(drive_mode_off)
[CTBMain.main.command][DEBUG] (command.py:73): drive mode off(drive_mode_off) added to global_vars
[CTBPlugin.plugins._1006_water_meter_filter][DEBUG] (_1006_water_meter_filter.py:11): plugins._1006_water_meter_filter loading
[CTBPlugin.plugins._1100_text_forward][DEBUG] (_1100_text_forward.py:23): plugins._1100_text_forward loading
[CTBMain.main.command][DEBUG] (command.py:55): Registering new command: image link on(pic_link_on)
[CTBMain.main.command][DEBUG] (command.py:73): image link on(pic_link_on) added to global_vars
[CTBMain.main.command][DEBUG] (command.py:55): Registering new command: image link off(pic_link_off)
[CTBMain.main.command][DEBUG] (command.py:73): image link off(pic_link_off) added to global_vars
[CTBPlugin.plugins._1101_other_qq_group_events][DEBUG] (_1101_other_qq_group_events.py:9): plugins._1101_other_qq_group_events loading
[telegram.vendor.ptb_urllib3.urllib3.connectionpool][DEBUG] (connectionpool.py:412): https://api.telegram.org:443 "POST /bot421442752:AAGrcaZSjNmmfa7cOxVaCv5lAo66l1_q6js/setWebhook HTTP/1.1" 200 68
[telegram.bot][DEBUG] (bot.py:61): True
[telegram.bot][DEBUG] (bot.py:62): Exiting: set_webhook
[telegram.bot][DEBUG] (bot.py:59): Entering: get_updates

telegram上对bot发送消息时,日志中有显示,但是QQ中无反应

[telegram.ext.dispatcher][DEBUG] (dispatcher.py:227): Processing Update: {'update_id': 848917101, 'message': {'message_id': 207, 'date': 1523250724, 'chat': {'id': 221184198, 'type': 'private', 'username': 'kasora_san', 'first_name': 'kasora'}, 'text': 'hi', 'entities': [], 'caption_entities': [], 'photo': [], 'new_chat_members': [], 'new_chat_photo': [], 'delete_chat_photo': False, 'group_chat_created': False, 'supergroup_chat_created': False, 'channel_chat_created': False, 'from': {'id': 221184198, 'first_name': 'kasora', 'is_bot': False, 'username': 'kasora_san', 'language_code': 'zh-Hans-CN'}, 'new_chat_member': None}}
[telegram.ext.conversationhandler][DEBUG] (conversationhandler.py:247): selecting conversation (221184198, 221184198) with state None
[telegram.ext.dispatcher][DEBUG] (dispatcher.py:284): Stopping further handlers due to DispatcherHandlerStop
[telegram.bot][DEBUG] (bot.py:59): Entering: get_updates

qq发送时日志没有动静,tg也没有收到消息。
访问主机的9000端口输入密码后可以看到已登录的wine-qq的界面。

任何思路或者建议都很有价值。感谢

配置文件没有写 FORWARD_LIST

@xyf1219 。。我大概理解错了这个项目的功能。目前是只支持tg群组到qq群的双向转发么?如果想做 单个QQ到单个tg的转发 例如 所有发往qq-bot的消息由tg-bot转发到tg 这样可行么?

👆这是ctbx的功能(

@wtdcode 好的。感谢指路

但是ctbx目前QQ->Tg的图片转发功能还存在一定问题所以没有Release, 请多多关注这个项目 :p

@wtdcode ok。有消息就很满意了。

@kasora
不太明白你为什么要私聊 bot 转发到 tg 群组……
可以说一下使用情景?

@xyf1219 呃。我想要的是点对点的消息转发,不涉及群组。
情景的话,因为使用linux。不管是wineqq还是appimage都显得很难受,所以准备把QQ直接当做bot挂在服务器上,如果有人私聊就转发到tg上处理。
所以曲线救国的办法就是tgbot和自己建个群组。将私聊扔进群组。
也许有些更好的办法?

@kasora 点对点转发的话ctbx也可以支持,不过可能需要等等因为我最近没什么空(当然也欢迎PR

@kasora ctb没有接管功能,只有群和群的桥接,这是出于安全考虑的(比如防止被ban啥的)

@jqqqqqqqqqq 好的。

@kasora
跟我一样的想法耶 同 linux 用户~

不过感觉私聊的话不太优雅 主要是多人会话的情况下(不过也比开虚拟机方便多了摔(

@xyf1219 关键性问题还有一个,tg 短时间创建太多群会 spam。。。所以吧,这个也很难优雅。。。我就挂接了几个常用群
所以,最好的解决方案是拿出手机打开qq

@jqqqqqqqqqq 所以你应该放弃ctb来跟我一起写ctbx 😆

@wtdcode 这不是语言或者框架导致的差异,而是 Telegram 的限制

@wtdcode 我就是懒得写 CPP,来打我啊(

@jqqqqqqqqqq 我的意思是来写点对点啊x

@jqqqqqqqqqq 点对点的话其实我是推荐本地自建 irc server 的

@wtdcode 我在忙毕设,估计得且一段时间

@billchenchina 你们 QQ 都不斗图的么(

@billchenchina irc server怎么玩,CQ这边能直接用?

@wtdcode 嘛..不太了解

反正之前在 github 看到过 qq 的 irc client,具体忘了

@jqqqqqqqqqq 斗图就好好斗,(回 QQ 啊)反正我是不会买 coolq pro 的,更不会(私聊情况下)给别人发图片 link 的(大雾

@billchenchina 你不觉得,使用 tg 表情包斗图简直开挂么(