mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-09 18:00:33 +08:00
Fix anonymous bug
This commit is contained in:
parent
73923d46f6
commit
7fee308b11
@ -76,12 +76,17 @@ internal class OnlinePush {
|
||||
)
|
||||
}
|
||||
|
||||
val extraInfo: ImMsgBody.ExtraInfo? =
|
||||
pbPushMsg.msg.msgBody.richText.elems.firstOrNull { it.extraInfo != null }?.extraInfo
|
||||
var extraInfo: ImMsgBody.ExtraInfo? = null
|
||||
var anonymous: ImMsgBody.AnonymousGroupMsg? = null
|
||||
|
||||
val anonymous = pbPushMsg.msg.msgBody.richText.elems.firstOrNull { it.anonGroupMsg != null }?.anonGroupMsg
|
||||
for (elem in pbPushMsg.msg.msgBody.richText.elems) {
|
||||
when {
|
||||
elem.extraInfo != null -> extraInfo = elem.extraInfo
|
||||
elem.anonGroupMsg != null -> anonymous = elem.anonGroupMsg
|
||||
}
|
||||
}
|
||||
|
||||
val group = bot.getGroupOrNull(pbPushMsg.msg.msgHead.groupInfo!!.groupCode) as GroupImpl ?: return null // 机器人还正在进群
|
||||
val group = bot.getGroupOrNull(pbPushMsg.msg.msgHead.groupInfo!!.groupCode) as GroupImpl? ?: return null // 机器人还正在进群
|
||||
val sender = if (anonymous != null) {
|
||||
group.newAnonymous(anonymous.anonNick.encodeToString())
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user