From 15d89f2bd1f43d375856c5fca35bda0615268f9d Mon Sep 17 00:00:00 2001 From: Him188 Date: Tue, 4 Feb 2020 11:23:12 +0800 Subject: [PATCH] Fix build --- .../net/mamoe/mirai/qqandroid/ContactImpl.kt | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/ContactImpl.kt b/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/ContactImpl.kt index 487cacdf3..95970e121 100644 --- a/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/ContactImpl.kt +++ b/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/ContactImpl.kt @@ -72,28 +72,26 @@ internal class MemberImpl( override val group: GroupImpl by group.unsafeWeakRef() val qq: QQImpl by qq.unsafeWeakRef() - override val bot: QQAndroidBot by bot.unsafeWeakRef() - - override suspend fun mute(durationSeconds: Int): Boolean { - if(bot.uin==this@MemberImpl.qq.id)//不能自己禁言自己 + if (bot.uin == this@MemberImpl.qq.id)//不能自己禁言自己 { return false } //判断有无禁言权限 - var myPermission = group.get(bot.uin).permission + val myPermission = group.get(bot.uin).permission if (myPermission == MemberPermission.ADMINISTRATOR || myPermission == MemberPermission.OWNER) { - if (myPermission == MemberPermission.OWNER || (myPermission == MemberPermission.ADMINISTRATOR && permission == MemberPermission.MEMBER)) { + return if (myPermission == MemberPermission.OWNER || (myPermission == MemberPermission.ADMINISTRATOR && permission == MemberPermission.MEMBER)) { bot.network.run { val response = TroopManagement.Mute( client = bot.client, - member = this@MemberImpl, + memberUin = id, + groupCode = group.id, timeInSecond = durationSeconds ).sendAndExpect() } - return true - }else{ - return false + true + } else { + false } } else { return false