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

[Callback]OnJoinGroup有时候不会触发 #128

Open
Sora233 opened this issue Feb 24, 2021 · 10 comments
Open

[Callback]OnJoinGroup有时候不会触发 #128

Sora233 opened this issue Feb 24, 2021 · 10 comments
Labels
bug Something isn't working

Comments

@Sora233
Copy link
Contributor

Sora233 commented Feb 24, 2021

邀请加群当需要管理员同意时,会触发OnGroupInvited, 有时候管理员同意之后没有触发OnJoinGroup(已经开始接受这个群的消息了),日志里没有关于这个callback的信息。

@Sora233
Copy link
Contributor Author

Sora233 commented Feb 24, 2021

整个日志中没有event error,大概过程是这样

// 邀请时触发了OnGroupInvited callback
time="2021-02-24T09:52:09+08:00" level=info msg="new group invited GroupCode=xxx"
// 中间没有callback日志
// 一段时间后管理员同意了请求,开始收到群聊天内容
time="2021-02-24T09:53:17+08:00" level=info msg="[Image:{...}] GroupCode=xxx"
// 后面也没有callback日志

callback的设置方式

	bot.OnGroupInvited(func(qqClient *client.QQClient, request *client.GroupInvitedRequest) {
		log := logger.WithField("group_code", request.GroupCode).
			WithField("group_name", request.GroupName).
			WithField("invitor_uin", request.InvitorUin).
			WithField("invitor_nick", request.InvitorNick)
               log.Info("new group invited")
               // ...
        }
	bot.OnJoinGroup(func(qqClient *client.QQClient, info *client.GroupInfo) {
		log := logger.WithField("group_code", info.Code).
			WithField("member_count", info.MemberCount).
			WithField("group_name", info.Name)
		log.Info("join group")
        // ...

@Sora233
Copy link
Contributor Author

Sora233 commented Feb 24, 2021

miraigo的log应该没有开

@Sora233
Copy link
Contributor Author

Sora233 commented Feb 24, 2021

不是基于cq的

@qianjunakasumi
Copy link
Contributor

尝试使用OnLog方法设置MiraiGo日志打印以启用debug输出

@Sora233
Copy link
Contributor Author

Sora233 commented Feb 24, 2021

在捞到日志之前close,如果其他人也出现这个问题可以reopen

@Sora233 Sora233 closed this as completed Feb 24, 2021
@Sora233
Copy link
Contributor Author

Sora233 commented May 23, 2021

这个问题还是时有发生,发一下最近一次的log。
debug_log

复述一下具体情况:
收到了加群邀请,同意之后没有触发OnJoinGroup callback。
callback设置方式参考我在上面的代码,日志里有new group invited 但没有join group。

两个时间点:

  • 收到邀请是16:39:05
  • 第一次收到群消息是16:39:26。

日志时间是从16:39:00到16:39:27。
日志对应的miraigo版本是v0.0.0-20210518070025-f145000ac0ef,应该是当前的master。

@Sora233 Sora233 reopened this May 23, 2021
@fumiama fumiama added the bug Something isn't working label May 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants
@Sora233 @fumiama @qianjunakasumi and others