Skip to content

Commit

Permalink
Merge pull request #104 from simple-robot/dev/main
Browse files Browse the repository at this point in the history
Release: v1.4.1
  • Loading branch information
ForteScarlet authored Aug 30, 2024
2 parents dd6c44d + b90032e commit eac34ad
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 24 deletions.
7 changes: 7 additions & 0 deletions .changelog/v1.4.1.md
Original file line number Diff line number Diff line change
@@ -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`,这是对我们最大的鼓励与认可!
4 changes: 2 additions & 2 deletions buildSrc/src/main/kotlin/P.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions simbot-component-onebot-common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -64,7 +61,6 @@ kotlin {

jvmMain {
dependencies {
compileOnly(libs.simbot.common.annotations)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ kotlin {

jvmMain {
dependencies {
compileOnly(libs.simbot.common.annotations)
compileOnly(libs.ktor.client.contentNegotiation)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -77,7 +74,6 @@ kotlin {

jvmMain {
dependencies {
compileOnly(libs.simbot.common.annotations)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -75,7 +72,6 @@ kotlin {

jvmMain {
dependencies {
compileOnly(libs.simbot.common.annotations)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -69,7 +66,11 @@ public interface OneBotMessageContent : MessageContent {
*/
@STP
override suspend fun reference(): OneBotReply? =
messages.firstNotNullOfOrNull { it as? OneBotReply }
messages
.filterIsInstance<OneBotMessageElement>()
.firstNotNullOfOrNull {
it.oneBotSegmentOrNull<OneBotReply>()
}

/**
* 根据 [消息引用][reference] 信息通过API查询对应引用的消息内容。
Expand Down

0 comments on commit eac34ad

Please sign in to comment.