From d6dbe07524ebaf135b318c977d12e2386586b64d Mon Sep 17 00:00:00 2001 From: ForteScarlet Date: Thu, 13 Jun 2024 15:33:14 +0800 Subject: [PATCH 1/4] =?UTF-8?q?feat:=20QGMember=20=E5=A2=9E=E5=8A=A0=20mut?= =?UTF-8?q?e=20=E5=92=8C=20unmute=20=E7=9A=84=E6=94=AF=E6=8C=81(=E7=A6=81?= =?UTF-8?q?=E8=A8=80=E7=9B=B8=E5=85=B3API)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buildSrc/src/main/kotlin/P.kt | 2 +- .../qguild/api/guild/mute/MuteMemberApi.kt | 2 +- .../simbot/component/qguild/guild/QGMember.kt | 49 +++++++++++++++++++ .../qguild/internal/guild/QGMemberImpl.kt | 28 +++++++++++ 4 files changed, 79 insertions(+), 2 deletions(-) diff --git a/buildSrc/src/main/kotlin/P.kt b/buildSrc/src/main/kotlin/P.kt index d8f6bdca..ecd2cbaf 100644 --- a/buildSrc/src/main/kotlin/P.kt +++ b/buildSrc/src/main/kotlin/P.kt @@ -59,7 +59,7 @@ object P { override val homepage: String get() = HOMEPAGE - private val baseVersion = v(4, 0, 0) - v("beta3") + private val baseVersion = v(4, 0, 0) - v("beta4") val snapshotVersion = baseVersion - Version.SNAPSHOT override val version = if (isSnapshot()) snapshotVersion else baseVersion diff --git a/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/api/guild/mute/MuteMemberApi.kt b/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/api/guild/mute/MuteMemberApi.kt index 8a9eda75..1474b2b4 100644 --- a/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/api/guild/mute/MuteMemberApi.kt +++ b/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/api/guild/mute/MuteMemberApi.kt @@ -76,7 +76,7 @@ public class MuteMemberApi private constructor(guildId: String, userId: String, return when { seconds == 0L -> MuteMemberApi(guildId, userId, MuteBody.Unmute) seconds > 0L -> MuteMemberApi(guildId, userId, MuteBody(muteSeconds = seconds.toString())) - else -> throw IllegalStateException("mute seconds must >= 0, but $seconds") + else -> throw IllegalArgumentException("mute seconds must >= 0, but $seconds") } } } diff --git a/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/guild/QGMember.kt b/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/guild/QGMember.kt index 35ff29ac..a366f7ed 100644 --- a/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/guild/QGMember.kt +++ b/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/guild/QGMember.kt @@ -23,6 +23,7 @@ import kotlinx.coroutines.CoroutineScope import love.forte.simbot.common.collectable.Collectable import love.forte.simbot.common.id.ID import love.forte.simbot.common.id.StringID.Companion.ID +import love.forte.simbot.common.time.TimeUnit import love.forte.simbot.common.time.Timestamp import love.forte.simbot.component.qguild.ExperimentalQGApi import love.forte.simbot.component.qguild.QGObjectiveContainer @@ -36,7 +37,9 @@ import love.forte.simbot.message.MessageContent import love.forte.simbot.message.Text import love.forte.simbot.qguild.QQGuildApiException import love.forte.simbot.qguild.api.MessageAuditedException +import love.forte.simbot.qguild.api.guild.mute.MuteMemberApi import love.forte.simbot.suspendrunner.ST +import kotlin.time.Duration import love.forte.simbot.qguild.model.Member as QGSourceMember /** @@ -75,6 +78,7 @@ public interface QGMember : Member, CoroutineScope, QGObjectiveContainer Date: Thu, 13 Jun 2024 15:50:00 +0800 Subject: [PATCH 2/4] =?UTF-8?q?feat:=20QGMember=20=E5=A2=9E=E5=8A=A0=20mut?= =?UTF-8?q?e=20=E5=92=8C=20unmute=20=E7=9A=84=E6=94=AF=E6=8C=81(=E7=A6=81?= =?UTF-8?q?=E8=A8=80=E7=9B=B8=E5=85=B3API)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/simbot-component-qq-guild-core.api | 9 +++++++++ .../love/forte/simbot/component/qguild/guild/QGMember.kt | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/simbot-component-qq-guild-core/api/simbot-component-qq-guild-core.api b/simbot-component-qq-guild-core/api/simbot-component-qq-guild-core.api index e87ce6e8..9d1fd52a 100644 --- a/simbot-component-qq-guild-core/api/simbot-component-qq-guild-core.api +++ b/simbot-component-qq-guild-core/api/simbot-component-qq-guild-core.api @@ -1240,6 +1240,11 @@ public abstract interface class love/forte/simbot/component/qguild/guild/QGMembe public fun getJoinTime ()Llove/forte/simbot/common/time/Timestamp; public fun getName ()Ljava/lang/String; public fun getNick ()Ljava/lang/String; + public abstract fun mute (JLjava/util/concurrent/TimeUnit;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public abstract synthetic fun mute-VtjQ1oo (JLkotlin/coroutines/Continuation;)Ljava/lang/Object; + public abstract fun muteAsync (JLjava/util/concurrent/TimeUnit;)Ljava/util/concurrent/CompletableFuture; + public abstract fun muteBlocking (JLjava/util/concurrent/TimeUnit;)V + public abstract fun muteReserve (JLjava/util/concurrent/TimeUnit;)Llove/forte/simbot/suspendrunner/reserve/SuspendReserve; public abstract synthetic fun send (Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public abstract synthetic fun send (Llove/forte/simbot/message/Message;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public abstract synthetic fun send (Llove/forte/simbot/message/MessageContent;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; @@ -1255,6 +1260,10 @@ public abstract interface class love/forte/simbot/component/qguild/guild/QGMembe public fun sendReserve (Ljava/lang/String;)Llove/forte/simbot/suspendrunner/reserve/SuspendReserve; public fun sendReserve (Llove/forte/simbot/message/Message;)Llove/forte/simbot/suspendrunner/reserve/SuspendReserve; public fun sendReserve (Llove/forte/simbot/message/MessageContent;)Llove/forte/simbot/suspendrunner/reserve/SuspendReserve; + public abstract synthetic fun unmute (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public fun unmuteAsync ()Ljava/util/concurrent/CompletableFuture; + public fun unmuteBlocking ()V + public fun unmuteReserve ()Llove/forte/simbot/suspendrunner/reserve/SuspendReserve; } public final class love/forte/simbot/component/qguild/internal/bot/QGBotImpl$inlined$sam$i$java_util_function_Function$0 : java/util/function/Function { diff --git a/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/guild/QGMember.kt b/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/guild/QGMember.kt index a366f7ed..ead800a9 100644 --- a/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/guild/QGMember.kt +++ b/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/guild/QGMember.kt @@ -39,6 +39,7 @@ import love.forte.simbot.qguild.QQGuildApiException import love.forte.simbot.qguild.api.MessageAuditedException import love.forte.simbot.qguild.api.guild.mute.MuteMemberApi import love.forte.simbot.suspendrunner.ST +import kotlin.jvm.JvmSynthetic import kotlin.time.Duration import love.forte.simbot.qguild.model.Member as QGSourceMember @@ -140,7 +141,7 @@ public interface QGMember : Member, CoroutineScope, QGObjectiveContainer Date: Sat, 15 Jun 2024 19:01:35 +0800 Subject: [PATCH 3/4] =?UTF-8?q?deps:=20=E6=9B=B4=E6=96=B0simbot=E5=88=B0v4?= =?UTF-8?q?.0.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Writerside/v.list | 4 ++-- buildSrc/src/main/kotlin/P.kt | 2 +- gradle/libs.versions.toml | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Writerside/v.list b/Writerside/v.list index 88568555..69498fca 100644 --- a/Writerside/v.list +++ b/Writerside/v.list @@ -5,6 +5,6 @@ - - + + diff --git a/buildSrc/src/main/kotlin/P.kt b/buildSrc/src/main/kotlin/P.kt index d8f6bdca..ecd2cbaf 100644 --- a/buildSrc/src/main/kotlin/P.kt +++ b/buildSrc/src/main/kotlin/P.kt @@ -59,7 +59,7 @@ object P { override val homepage: String get() = HOMEPAGE - private val baseVersion = v(4, 0, 0) - v("beta3") + private val baseVersion = v(4, 0, 0) - v("beta4") val snapshotVersion = baseVersion - Version.SNAPSHOT override val version = if (isSnapshot()) snapshotVersion else baseVersion diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 8994fade..5820afe4 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -8,8 +8,8 @@ ktor = "2.3.8" openjdk-jmh = "1.37" log4j = "2.23.1" # simbot -simbot = "4.0.0-RC3" -suspendTransform = "0.8.0-beta1" +simbot = "4.0.0" +suspendTransform = "0.9.0" gradleCommon = "0.4.0" # ksp ksp = "2.0.0-1.0.22" From 749474d76b5a31864483bf8881780f05e8c51a76 Mon Sep 17 00:00:00 2001 From: ForteScarlet Date: Sat, 15 Jun 2024 20:02:09 +0800 Subject: [PATCH 4/4] release: v4.0.0-beta4 --- .changelog/v4.0.0-beta4.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .changelog/v4.0.0-beta4.md diff --git a/.changelog/v4.0.0-beta4.md b/.changelog/v4.0.0-beta4.md new file mode 100644 index 00000000..e33e861c --- /dev/null +++ b/.changelog/v4.0.0-beta4.md @@ -0,0 +1,7 @@ +> 对应核心版本: [**v4.0.0-RC3**](https://github.com/simple-robot/simpler-robot/releases/tag/v4.0.0-RC3) + + +我们欢迎并期望着您的的[反馈](https://github.com/simple-robot/simbot-component-qq-guild/issues)或[协助](https://github.com/simple-robot/simbot-component-qq-guild/pulls), +感谢您的贡献与支持! + +也欢迎您为我们献上一颗 `star`,这是对我们最大的鼓励与认可!