Commit cc420691 authored by Him188's avatar Him188

Add BotUnmuteEvent

parent 96949915
...@@ -132,9 +132,9 @@ internal class OnlinePush { ...@@ -132,9 +132,9 @@ internal class OnlinePush {
bot.getGroupByUin(groupUin).let { group -> bot.getGroupByUin(groupUin).let { group ->
val member = group[target] as MemberImpl val member = group[target] as MemberImpl
this.discardExact(1) this.discardExact(1)
return MemberLeaveEvent.Kick(member, group.members[readUInt().toLong()].also { return MemberLeaveEvent.Kick(member.also {
group.members.delegate.remove(it) group.members.delegate.remove(member)
}) }, group.members[readUInt().toLong()])
} }
} }
} }
...@@ -187,9 +187,12 @@ internal class OnlinePush { ...@@ -187,9 +187,12 @@ internal class OnlinePush {
) )
} }
} else { } else {
if (target == bot.uin) { return if (target == bot.uin) {
if (time == 0) {
} BotUnmuteEvent(operator)
} else
BotMuteEvent(durationSeconds = time, operator = operator)
} else {
val member = group[target] val member = group[target]
if (time == 0) { if (time == 0) {
MemberUnmuteEvent(operator = operator, member = member) MemberUnmuteEvent(operator = operator, member = member)
...@@ -198,6 +201,7 @@ internal class OnlinePush { ...@@ -198,6 +201,7 @@ internal class OnlinePush {
} }
} }
} }
}
3585 -> { // 匿名 3585 -> { // 匿名
val operator = group[this.readUInt().toLong()] val operator = group[this.readUInt().toLong()]
val switch = this.readInt() == 0 val switch = this.readInt() == 0
......
...@@ -129,12 +129,27 @@ data class BotGroupPermissionChangeEvent( ...@@ -129,12 +129,27 @@ data class BotGroupPermissionChangeEvent(
*/ */
data class BotMuteEvent( data class BotMuteEvent(
val durationSeconds: Int, val durationSeconds: Int,
override val group: Group,
/** /**
* 操作人. 为 null 则为机器人操作 * 操作人.
*/ */
val operator: Member? val operator: Member
) : GroupEvent, Packet, BotPassiveEvent ) : GroupEvent, Packet, BotPassiveEvent {
override val group: Group
get() = operator.group
}
/**
* Bot 被取消禁言
*/
data class BotUnmuteEvent(
/**
* 操作人.
*/
val operator: Member
) : GroupEvent, Packet, BotPassiveEvent {
override val group: Group
get() = operator.group
}
/** /**
* Bot 加入了一个新群 * Bot 加入了一个新群
......
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