yyuueexxiinngg / onebot-kotlin

OneBot标准的Kotlin实现及mirai插件 - 原cqhttp-mirai
GNU Affero General Public License v3.0
584 stars 139 forks source link

[BUG]处理群成员增加和减少消息时似乎有问题 #76

Closed a08381 closed 4 years ago

a08381 commented 4 years ago

QQ截图20200827171001

 17:02:07 [INFO] [BOT 1297189421] Event: MessageSvcPbGetMsg.Response(syncFlagFromServer=CONTINUE, messages=<Iterable>))
 17:02:07 [INFO] [NETWORK] Send: MessageSvc.PbGetMsg
 17:02:07 [INFO] [BOT 1297189421] Event: MemberJoinEvent.Active(member=1982480105)
 17:02:07 [INFO] [BOT 1297189421] Event: MessageSvcPbGetMsg.Response(syncFlagFromServer=CONTINUE, messages=<Iterable>))
 17:02:07 [INFO] [NETWORK] Send: MessageSvc.PbGetMsg
 17:02:07 [INFO] [NETWORK] Send: MessageSvc.PbDeleteMsg
 17:02:07 [INFO] [BOT 1297189421] Event: MessageSvcPbGetMsg.Response(syncFlagFromServer=CONTINUE, messages=<Iterable>))
 17:02:07 [INFO] [NETWORK] Send: MessageSvc.PbGetMsg
 17:02:07 [INFO] [NETWORK] Send: MessageSvc.PbDeleteMsg
 17:02:07 [INFO] [BOT 1297189421] Event: MessageSvcPbGetMsg.Response(syncFlagFromServer=CONTINUE, messages=<Iterable>))
 17:02:07 [INFO] [NETWORK] Send: MessageSvc.PbGetMsg
 17:02:07 [INFO] [NETWORK] Send: MessageSvc.PbDeleteMsg
 17:02:07 [INFO] [BOT 1297189421] Event: MessageSvcPbGetMsg.Response(syncFlagFromServer=CONTINUE, messages=<Iterable>))
 17:02:07 [INFO] [NETWORK] Send: MessageSvc.PbGetMsg
 17:02:07 [INFO] [NETWORK] Send: MessageSvc.PbDeleteMsg
 17:02:07 [INFO] [BOT 1297189421] Event: MessageSvcPbGetMsg.Response(syncFlagFromServer=CONTINUE, messages=<Iterable>))
 17:02:07 [INFO] [NETWORK] Send: MessageSvc.PbGetMsg
 17:02:07 [INFO] [NETWORK] Send: MessageSvc.PbDeleteMsg
 17:02:07 [INFO] [NETWORK] MessageSvcPushNotify: result != 0, result = 1, errorMsg=

复现

拉人进群时触发,后台有触发MemberJoinEvent,但是没有发送到反向ws服务器的日志 配置文件中debug已开 反向ws服务器的后端使用的是Bluefissure/OtterBot

版本

cqhttp-mirai- 0.2.3-embedded

#c7a1428

mirai-core-

mirai-console-

a08381 commented 4 years ago

OtterBot的相关部分代码为:L328

    def on_notice(self, receive, **kwargs):
        bot = self.bot
        if receive["notice_type"] == "group_increase":
            group_id = receive["group_id"]
            user_id = receive["user_id"]
            try:
                group = QQGroup.objects.get(group_id=group_id)
                welcome_msg = group.welcome_msg.strip()
                if welcome_msg:
                    msg = "[CQ:at,qq=%s]" % (user_id) + welcome_msg
                    self.api_caller.send_message(
                        "group",
                        group_id,
                        msg,
                        post_type=receive.get("reply_api_type", "websocket"),
                        chatId=receive.get("chatId", ""),
                        channel_id=receive.get("channel_id", ""),
                        nonce=receive.get("nonce", ""),
                    )
            except Exception as e:
                traceback.print_exc()
yyuueexxiinngg commented 4 years ago

事件发送本来就没有log出来, 现在Action版增加了事件log, 请再测试下是否会触发事件发送

https://github.com/yyuueexxiinngg/cqhttp-mirai/actions/runs/227442342

a08381 commented 4 years ago

OtterBot和这边一起更新后恢复正常,初步判定是OtterBot的问题,先关了