mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-06 08:00:10 +08:00
* fix #1155 * fix unmute * add durationSeconds check for mute * fix stupid code * fix me
This commit is contained in:
parent
5d1395a78c
commit
a085ab26c8
@ -129,6 +129,9 @@ internal class NormalMemberImpl constructor(
|
||||
check(this.id != bot.id) {
|
||||
"A bot can't mute itself."
|
||||
}
|
||||
require(durationSeconds > 0) {
|
||||
"durationSeconds must greater than zero"
|
||||
}
|
||||
checkBotPermissionHigherThanThis("mute")
|
||||
bot.network.run {
|
||||
TroopManagement.Mute(
|
||||
@ -141,6 +144,7 @@ internal class NormalMemberImpl constructor(
|
||||
|
||||
@Suppress("RemoveRedundantQualifierName") // or unresolved reference
|
||||
net.mamoe.mirai.event.events.MemberMuteEvent(this@NormalMemberImpl, durationSeconds, null).broadcastWithBot(bot)
|
||||
this._muteTimestamp = currentTimeSeconds().toInt() + durationSeconds
|
||||
}
|
||||
|
||||
override suspend fun unmute() {
|
||||
@ -156,6 +160,7 @@ internal class NormalMemberImpl constructor(
|
||||
|
||||
@Suppress("RemoveRedundantQualifierName") // or unresolved reference
|
||||
net.mamoe.mirai.event.events.MemberUnmuteEvent(this@NormalMemberImpl, null).broadcastWithBot(bot)
|
||||
this._muteTimestamp = 0
|
||||
}
|
||||
|
||||
override suspend fun kick(message: String) {
|
||||
|
Loading…
Reference in New Issue
Block a user