Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

邀请进群不会触发邀请事件 #1033

Closed
Nambers opened this issue Feb 19, 2021 · 7 comments
Closed

邀请进群不会触发邀请事件 #1033

Nambers opened this issue Feb 19, 2021 · 7 comments
Labels
z:duplicate 状态: 重复

Comments

@Nambers
Copy link
Contributor

Nambers commented Feb 19, 2021

邀请bot进入一个232人的群不会触发邀请事件,也不会直接进群
而且在群少于一定人数的时候也不会触发邀请事件,直接入群
可能的原因:
QQ换了邀请方式,改成给bot发送个xml邀请链接?

我写了个很粗略的解决补丁,希望修复

globalEventChannel.subscribeAlways<FriendMessageEvent> {
            //好友信息

            //针对失效功能的临时补丁
            //[mirai:service:128,<?xml version='1.0' encoding='UTF-8' standalone='yes' ?>
            //<msg serviceID="128" templateID="12345" action="native" brief="[链接]邀请你加入群聊" sourceMsgId="0" url="">
            //<item layout="2"><picture cover=""/><title>邀请你加入群聊</title><summary /></item>
            //<data groupcode="1044565129" groupname="mirai 非官方 开发群" msgseq="1613736417225458" msgtype="2"/>
            //</msg>]
            if(this.message.contentToString().startsWith("<?xml version='1.0' encoding='UTF-8' standalone='yes' ?><msg serviceID=\"128\"")){
                val mes = "<data[^>]+>".toRegex().find(this.message.contentToString())?.value
                val groupid = mes?.let { it1 -> Regex("groupcode=\"[0-9]+\"").find(it1)?.value
                    ?.replace("\"", "")
                    ?.replace("groupcode=", "") }
                val ida = mes?.let{it3->Regex("msgseq=\"[0-9]+\"").find(it3)?.value
                    ?.replace("\"", "")
                    ?.replace("msgseq=", "") }
                val groupname = mes?.let{it2->Regex("groupname=\"(.*)\" msgseq").find(it2)?.value
                    ?.replace("\"", "")
                    ?.replace("msgseq", "")
                    ?.replace("groupname=", "") }
                if (ida != null && groupid != null && groupname != null) {
                        BotInvitedJoinGroupRequestEvent(this.bot,ida.toLong(),this.sender.id,groupid.toLong(),groupname,this.sender.nick)
                            .broadcast()
                }
                return@subscribeAlways
            }
}

当时日志:

2021-02-19 21:04:02 I/Bot 692928873: Login successful
2021-02-19 21:04:02 I/Bot 692928873: v2.4.1
2021-02-19 21:04:04 D/Net 692928873: Received unknown commandName: ConfigPushSvc.PushDomain
2021-02-19 21:04:04 V/Net 692928873: Recv: ConfigPushSvc.PushReq.PushReqResponse.ConfigPush
2021-02-19 21:04:05 V/Net 692928873: Saving bdh session to cache
2021-02-19 21:04:05 V/Net 692928873: Send: ConfigPushSvc.PushResp
2021-02-19 21:04:05 I/Net 692928873: ConfigPushSvc.PushReq: Config updated.
2021-02-19 21:04:11 V/Net 692928873: Recv: RequestPushNotify(uin=692928873, ctype=1, strService=MessageSvc, strCmd=PushNotify, usMsgType=87, stMsgInfo=net.mamoe.mirai.internal.network.protocol.data.jce.MsgInfo@60a47bf9)
2021-02-19 21:04:11 V/Net 692928873: Send: MessageSvc.PbGetMsg
2021-02-19 21:04:11 V/Net 692928873: Recv: RequestPushNotify(uin=692928873, ctype=1, strService=MessageSvc, strCmd=PushNotify, usMsgType=166, stMsgInfo=net.mamoe.mirai.internal.network.protocol.data.jce.MsgInfo@63c5ccb8)
2021-02-19 21:04:11 V/Net 692928873: Send: MessageSvc.PbGetMsg
2021-02-19 21:04:11 V/Net 692928873: Send: MessageSvc.PbDeleteMsg
2021-02-19 21:04:11 V/Net 692928873: Send: ProfileService.Pb.ReqSystemMsgNew.Group
2021-02-19 21:04:11 V/Net 692928873: Send: MessageSvc.PbDeleteMsg
2021-02-19 21:04:11 V/Bot 692928873: Eritque arcus(1930893235) -> [mirai:service:128,<?xml version='1.0' encoding='UTF-8' standalone='yes' ?><msg serviceID="128" templateID="12345" action="native" brief="[链接]邀请你加入群聊" sourceMsgId="0" url=""><item layout="2"><picture cover=""/><title>邀请你加入群聊</title><summary /></item><data groupcode="1044565129" groupname="mirai 非官方 开发群" msgseq="1613739848897496" msgtype="2"/></msg>]

复现

从群内邀请

版本

  • mirai-core: 2.4.0

补充信息

@Nambers Nambers added the x:question 标签: 需要更多信息 label Feb 19, 2021
@sandtechnology
Copy link
Collaborator

#959

@Nambers
Copy link
Contributor Author

Nambers commented Feb 19, 2021

#959

好的好的,那这个会修复吗?还是这边不会提供支持只能我们自己处理

@sandtechnology
Copy link
Collaborator

Send: ProfileService.Pb.ReqSystemMsgNew.Group

我觉得应该只是处理不当而已 不需要进行消息解析

@Nambers
Copy link
Contributor Author

Nambers commented Feb 19, 2021

Send: ProfileService.Pb.ReqSystemMsgNew.Group

我觉得应该只是处理不当而已 不需要进行消息解析

okok 也就是说,mirai这边还是会提供这个的解析支持?
此外,我邀请bot到小群的时候,日志有点异常

2021-02-19 21:36:15 V/Net 692928873: Send: MessageSvc.PbGetMsg
2021-02-19 21:36:15 V/Net 692928873: Send: MessageSvc.PbDeleteMsg
2021-02-19 21:36:15 V/Net 692928873: Send: friendlist.GetTroopListReqV2
2021-02-19 21:36:15 V/Net 692928873: Send: MessageSvc.PbDeleteMsg
2021-02-19 21:36:15 V/Net 692928873: Send: ProfileService.Pb.ReqSystemMsgNew.Group
2021-02-19 21:36:15 V/Net 692928873: Recv: FriendList.GetFriendGroupList.Response
2021-02-19 21:36:15 V/Net 692928873: Send: friendlist.GetTroopMemberListReq
2021-02-19 21:36:15 V/Net 692928873: Recv: FriendList.GetTroopMemberList.Response
2021-02-19 21:36:15 V/Bot 692928873: Event: BotJoinGroupEvent.Invite(invitor=NormalMember(1930893235))
2021-02-19 21:36:16 D/Net 692928873: Unknown Transformers528 0x14 template
templId=10063
PermList=[TemplParam#567400855 {
            name=69 6E 76 69 74 65 5F 71 71 5F 6E 69 63 6B
            value=45 72 69 74 71 75 65 20 61 72 63 75 73
    }]

我觉得这就是为什么小群收不到事件的可能原因?

@sandtechnology
Copy link
Collaborator

猜想是系统消息同步问题 有关于这个(#610)的玩意坑了很久 因为使用频率不高一直没人处理(
这个日志没有问题的 只是群内提示没做解析而已

@Nambers
Copy link
Contributor Author

Nambers commented Feb 19, 2021

猜想是系统消息同步问题 有关于这个(#610)的玩意坑了很久 因为使用频率不高一直没人处理(
这个日志没有问题的 只是群内提示没做解析而已

okok 610 hhh那这个问题确实出现很久了,我之前用的时候,也会出现有些群进不来什么的,那真的是远古遗留问题了

@Him188
Copy link
Member

Him188 commented Feb 21, 2021

合并在 #959 处理

@Him188 Him188 added z:duplicate 状态: 重复 and removed x:question 标签: 需要更多信息 labels Feb 21, 2021
@Him188 Him188 closed this as completed Feb 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
z:duplicate 状态: 重复
Projects
None yet
Development

No branches or pull requests

3 participants