mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-06 08:00:10 +08:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
fbe5f14a9c
@ -129,11 +129,12 @@ internal class OnlinePush {
|
||||
val target = readUInt().toLong()
|
||||
val groupUin = content.fromUin
|
||||
|
||||
val member = bot.getGroupByUin(groupUin)[target] as MemberImpl
|
||||
|
||||
return MemberLeaveEvent.Kick(member, TODO("踢出时获取管理员"))
|
||||
bot.getGroupByUin(groupUin).let {
|
||||
val member = it[target] as MemberImpl
|
||||
this.discardExact(1)
|
||||
return MemberLeaveEvent.Kick(member, it.members[readUInt().toLong()])
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -193,27 +194,33 @@ internal class OnlinePush {
|
||||
4096 -> {
|
||||
val dataBytes = this.readBytes(26)
|
||||
val message = this.readString(this.readByte().toInt())
|
||||
println(dataBytes.toUHexString())
|
||||
|
||||
TODO("读取操作人")
|
||||
|
||||
/*
|
||||
return if (dataBytes[0].toInt() != 59) {
|
||||
GroupNameChangeEvent(origin = group.name, new = )
|
||||
return GroupNameChangeEvent(origin = group.name, new = message, group = group)
|
||||
} else {
|
||||
println(message + ":" + dataBytes.toUHexString())
|
||||
//println(message + ":" + dataBytes.toUHexString())
|
||||
when (message) {
|
||||
"管理员已关闭群聊坦白说" -> {
|
||||
GroupAllowConfessTalkEvent(group.confessTalk, false, ope)
|
||||
return GroupAllowConfessTalkEvent(
|
||||
origin = group.confessTalk,
|
||||
new = false,
|
||||
group = group
|
||||
)
|
||||
}
|
||||
"管理员已开启群聊坦白说" -> {
|
||||
|
||||
return GroupAllowConfessTalkEvent(
|
||||
origin = group.confessTalk,
|
||||
new = false,
|
||||
group = group
|
||||
)
|
||||
}
|
||||
else -> {
|
||||
println("Unknown server messages $message")
|
||||
return NoPacket
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
4352 -> {
|
||||
println(msgInfo.contentToString())
|
||||
|
@ -138,11 +138,7 @@ interface GroupSettingChangeEvent<T> : GroupEvent, BotPassiveEvent {
|
||||
data class GroupNameChangeEvent(
|
||||
override val origin: String,
|
||||
override val new: String,
|
||||
override val group: Group,
|
||||
/**
|
||||
* 操作人. 为 null 时则是机器人操作
|
||||
*/
|
||||
val operator: Member?
|
||||
override val group: Group
|
||||
) : GroupSettingChangeEvent<String>, Packet
|
||||
|
||||
/**
|
||||
@ -191,11 +187,7 @@ data class GroupAllowAnonymousChatEvent(
|
||||
data class GroupAllowConfessTalkEvent(
|
||||
override val origin: Boolean,
|
||||
override val new: Boolean,
|
||||
override val group: Group,
|
||||
/**
|
||||
* 操作人. 为 null 时则是机器人操作
|
||||
*/
|
||||
val operator: Member?
|
||||
override val group: Group
|
||||
) : GroupSettingChangeEvent<Boolean>, Packet
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user