From e36ed53c6eb23f9d58adf9733d08500bc4debdc8 Mon Sep 17 00:00:00 2001 From: ForteScarlet Date: Fri, 30 Aug 2024 18:05:18 +0800 Subject: [PATCH 1/3] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E6=B6=88=E6=81=AF=E5=BC=95=E7=94=A8=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/internal/message/OneBotMessageContentImpl.kt | 5 +---- .../onebot/v11/message/OneBotMessageContent.kt | 11 ++++++----- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/simbot-component-onebot-v11/simbot-component-onebot-v11-core/src/commonMain/kotlin/love/forte/simbot/component/onebot/v11/core/internal/message/OneBotMessageContentImpl.kt b/simbot-component-onebot-v11/simbot-component-onebot-v11-core/src/commonMain/kotlin/love/forte/simbot/component/onebot/v11/core/internal/message/OneBotMessageContentImpl.kt index 24bd962..4f687db 100644 --- a/simbot-component-onebot-v11/simbot-component-onebot-v11-core/src/commonMain/kotlin/love/forte/simbot/component/onebot/v11/core/internal/message/OneBotMessageContentImpl.kt +++ b/simbot-component-onebot-v11/simbot-component-onebot-v11-core/src/commonMain/kotlin/love/forte/simbot/component/onebot/v11/core/internal/message/OneBotMessageContentImpl.kt @@ -21,12 +21,10 @@ import love.forte.simbot.ability.DeleteOption import love.forte.simbot.ability.StandardDeleteOption import love.forte.simbot.common.id.ID import love.forte.simbot.component.onebot.v11.core.api.DeleteMsgApi -import love.forte.simbot.component.onebot.v11.core.api.GetMsgApi import love.forte.simbot.component.onebot.v11.core.bot.internal.OneBotBotImpl import love.forte.simbot.component.onebot.v11.message.OneBotMessageContent import love.forte.simbot.component.onebot.v11.message.resolveToMessageElement import love.forte.simbot.component.onebot.v11.message.segment.OneBotMessageSegment -import love.forte.simbot.component.onebot.v11.message.segment.OneBotReply import love.forte.simbot.component.onebot.v11.message.segment.OneBotText import love.forte.simbot.message.Messages import love.forte.simbot.message.toMessages @@ -59,8 +57,7 @@ internal class OneBotMessageContentImpl( } override suspend fun referenceMessage(): OneBotMessageContent? { - val ref = messages.firstNotNullOfOrNull { it as? OneBotReply } - ?: return null + val ref = reference() ?: return null return bot.getMessageContent(ref.id) } diff --git a/simbot-component-onebot-v11/simbot-component-onebot-v11-message/src/commonMain/kotlin/love/forte/simbot/component/onebot/v11/message/OneBotMessageContent.kt b/simbot-component-onebot-v11/simbot-component-onebot-v11-message/src/commonMain/kotlin/love/forte/simbot/component/onebot/v11/message/OneBotMessageContent.kt index be5a51d..c68a44f 100644 --- a/simbot-component-onebot-v11/simbot-component-onebot-v11-message/src/commonMain/kotlin/love/forte/simbot/component/onebot/v11/message/OneBotMessageContent.kt +++ b/simbot-component-onebot-v11/simbot-component-onebot-v11-message/src/commonMain/kotlin/love/forte/simbot/component/onebot/v11/message/OneBotMessageContent.kt @@ -20,10 +20,7 @@ package love.forte.simbot.component.onebot.v11.message import love.forte.simbot.ability.DeleteOption import love.forte.simbot.ability.StandardDeleteOption import love.forte.simbot.common.id.ID -import love.forte.simbot.component.onebot.v11.message.segment.OneBotMessageSegment -import love.forte.simbot.component.onebot.v11.message.segment.OneBotMessageSegmentElement -import love.forte.simbot.component.onebot.v11.message.segment.OneBotReply -import love.forte.simbot.component.onebot.v11.message.segment.OneBotText +import love.forte.simbot.component.onebot.v11.message.segment.* import love.forte.simbot.message.MessageContent import love.forte.simbot.message.Messages import love.forte.simbot.message.PlainText @@ -69,7 +66,11 @@ public interface OneBotMessageContent : MessageContent { */ @STP override suspend fun reference(): OneBotReply? = - messages.firstNotNullOfOrNull { it as? OneBotReply } + messages + .filterIsInstance() + .firstNotNullOfOrNull { + it.oneBotSegmentOrNull() + } /** * 根据 [消息引用][reference] 信息通过API查询对应引用的消息内容。 From d03a8e7040fc495612cf2c98c976dc4191176764 Mon Sep 17 00:00:00 2001 From: ForteScarlet Date: Fri, 30 Aug 2024 18:07:02 +0800 Subject: [PATCH 2/3] =?UTF-8?q?build:=20=E8=B0=83=E6=95=B4=E4=BE=9D?= =?UTF-8?q?=E8=B5=96=E4=BC=A0=E9=80=92=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- simbot-component-onebot-common/build.gradle.kts | 4 ---- .../simbot-component-onebot-v11-core/build.gradle.kts | 1 - .../simbot-component-onebot-v11-event/build.gradle.kts | 4 ---- .../simbot-component-onebot-v11-message/build.gradle.kts | 4 ---- 4 files changed, 13 deletions(-) diff --git a/simbot-component-onebot-common/build.gradle.kts b/simbot-component-onebot-common/build.gradle.kts index deb25e2..cda6f2d 100644 --- a/simbot-component-onebot-common/build.gradle.kts +++ b/simbot-component-onebot-common/build.gradle.kts @@ -16,10 +16,7 @@ */ import love.forte.gradle.common.core.project.setup -import love.forte.gradle.common.kotlin.multiplatform.applyTier1 import love.forte.gradle.common.kotlin.multiplatform.applyTier123 -import love.forte.gradle.common.kotlin.multiplatform.applyTier2 -import love.forte.gradle.common.kotlin.multiplatform.applyTier3 import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi plugins { @@ -64,7 +61,6 @@ kotlin { jvmMain { dependencies { - compileOnly(libs.simbot.common.annotations) } } diff --git a/simbot-component-onebot-v11/simbot-component-onebot-v11-core/build.gradle.kts b/simbot-component-onebot-v11/simbot-component-onebot-v11-core/build.gradle.kts index 6decf14..89652b9 100644 --- a/simbot-component-onebot-v11/simbot-component-onebot-v11-core/build.gradle.kts +++ b/simbot-component-onebot-v11/simbot-component-onebot-v11-core/build.gradle.kts @@ -88,7 +88,6 @@ kotlin { jvmMain { dependencies { - compileOnly(libs.simbot.common.annotations) compileOnly(libs.ktor.client.contentNegotiation) } } diff --git a/simbot-component-onebot-v11/simbot-component-onebot-v11-event/build.gradle.kts b/simbot-component-onebot-v11/simbot-component-onebot-v11-event/build.gradle.kts index f6e3d6e..49a25a4 100644 --- a/simbot-component-onebot-v11/simbot-component-onebot-v11-event/build.gradle.kts +++ b/simbot-component-onebot-v11/simbot-component-onebot-v11-event/build.gradle.kts @@ -17,10 +17,7 @@ import com.google.devtools.ksp.gradle.KspTaskMetadata import love.forte.gradle.common.core.project.setup -import love.forte.gradle.common.kotlin.multiplatform.applyTier1 import love.forte.gradle.common.kotlin.multiplatform.applyTier123 -import love.forte.gradle.common.kotlin.multiplatform.applyTier2 -import love.forte.gradle.common.kotlin.multiplatform.applyTier3 import org.jetbrains.dokka.gradle.DokkaTaskPartial import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi @@ -77,7 +74,6 @@ kotlin { jvmMain { dependencies { - compileOnly(libs.simbot.common.annotations) } } diff --git a/simbot-component-onebot-v11/simbot-component-onebot-v11-message/build.gradle.kts b/simbot-component-onebot-v11/simbot-component-onebot-v11-message/build.gradle.kts index ac4be45..0d52281 100644 --- a/simbot-component-onebot-v11/simbot-component-onebot-v11-message/build.gradle.kts +++ b/simbot-component-onebot-v11/simbot-component-onebot-v11-message/build.gradle.kts @@ -17,10 +17,7 @@ import com.google.devtools.ksp.gradle.KspTaskMetadata import love.forte.gradle.common.core.project.setup -import love.forte.gradle.common.kotlin.multiplatform.applyTier1 import love.forte.gradle.common.kotlin.multiplatform.applyTier123 -import love.forte.gradle.common.kotlin.multiplatform.applyTier2 -import love.forte.gradle.common.kotlin.multiplatform.applyTier3 import org.jetbrains.dokka.gradle.DokkaTaskPartial import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi @@ -75,7 +72,6 @@ kotlin { jvmMain { dependencies { - compileOnly(libs.simbot.common.annotations) } } From b90032e174c2105d6f5eddc0dcd414e95f914cb5 Mon Sep 17 00:00:00 2001 From: ForteScarlet Date: Fri, 30 Aug 2024 19:25:22 +0800 Subject: [PATCH 3/3] release: v1.4.1 --- .changelog/v1.4.1.md | 7 +++++++ buildSrc/src/main/kotlin/P.kt | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 .changelog/v1.4.1.md diff --git a/.changelog/v1.4.1.md b/.changelog/v1.4.1.md new file mode 100644 index 0000000..c397d83 --- /dev/null +++ b/.changelog/v1.4.1.md @@ -0,0 +1,7 @@ +> 对应核心版本: [**v4.6.0**](https://github.com/simple-robot/simpler-robot/releases/tag/v4.6.0) + + +我们欢迎并期望着您的的[反馈](https://github.com/simple-robot/simbot-component-onebot/issues)或[协助](https://github.com/simple-robot/simbot-component-onebot/pulls), +感谢您的贡献与支持! + +也欢迎您为我们献上一颗 `star`,这是对我们最大的鼓励与认可! diff --git a/buildSrc/src/main/kotlin/P.kt b/buildSrc/src/main/kotlin/P.kt index dd6ea4d..4383522 100644 --- a/buildSrc/src/main/kotlin/P.kt +++ b/buildSrc/src/main/kotlin/P.kt @@ -37,8 +37,8 @@ object P { override val description: String get() = DESCRIPTION override val homepage: String get() = HOMEPAGE - const val VERSION = "1.4.0" - const val NEXT_VERSION = "1.4.1" + const val VERSION = "1.4.1" + const val NEXT_VERSION = "1.4.2" override val snapshotVersion = "$NEXT_VERSION-SNAPSHOT" override val version = if (isSnapshot()) snapshotVersion else VERSION