Commit 4ac46079 authored by Him188's avatar Him188

Remove BotJoinGroupEvent.Invite.invitorName as not provided by the server

parent 0b62370d
......@@ -15,6 +15,7 @@ import kotlinx.io.core.ByteReadPacket
import kotlinx.io.core.readBytes
import net.mamoe.mirai.contact.Group
import net.mamoe.mirai.event.events.*
import net.mamoe.mirai.getGroupOrNull
import net.mamoe.mirai.qqandroid.QQAndroidBot
import net.mamoe.mirai.qqandroid.message.contextualBugReportException
import net.mamoe.mirai.qqandroid.network.Packet
......@@ -178,10 +179,10 @@ internal class NewContact {
val group = bot.getNewGroup(groupCode) ?: return null
val invitor = group[actionUin]
BotJoinGroupEvent.Invite(reqUinNick, invitor)
BotJoinGroupEvent.Invite(invitor)
}
5 -> {
val group = bot.getGroup(groupCode)
val group = bot.getGroupOrNull(groupCode) ?: return null
val operator = group[actionUin]
BotLeaveEvent.Kick(operator)
}
......
......@@ -114,10 +114,6 @@ sealed class BotJoinGroupEvent : GroupEvent, Packet, AbstractEvent() {
*/
@MiraiExperimentalAPI
data class Invite internal constructor(
/**
* 邀请人昵称 (可能为备注或群名片)
*/
val invitorName: String,
/**
* 邀请人
*/
......@@ -126,7 +122,7 @@ sealed class BotJoinGroupEvent : GroupEvent, Packet, AbstractEvent() {
override val group: Group get() = invitor.group
override fun toString(): String {
return "BotJoinGroupEvent.Invite(invitorName='$invitorName', invitor=$invitor)"
return "BotJoinGroupEvent.Invite(invitor=$invitor)"
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment