Skip to content

Commit

Permalink
Merge pull request #16 from simple-robot/dev/main
Browse files Browse the repository at this point in the history
Release: v0.0.6
  • Loading branch information
ForteScarlet authored Jul 18, 2024
2 parents fca9ed1 + 564de6c commit ff047ae
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 6 deletions.
7 changes: 7 additions & 0 deletions .changelog/v0.0.6.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
> 对应核心版本: [**v4.1.0**](https://github.com/simple-robot/simpler-robot/releases/tag/v4.1.0)

我们欢迎并期望着您的的[反馈](https://github.com/simple-robot/simbot-component-telegram/issues)[协助](https://github.com/simple-robot/simbot-component-telegram/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 @@ -40,8 +40,8 @@ object P {
override val description: String get() = DESCRIPTION
override val homepage: String get() = HOMEPAGE

const val VERSION = "0.0.5"
const val NEXT_VERSION = "0.0.6"
const val VERSION = "0.0.6"
const val NEXT_VERSION = "0.0.7"

override val snapshotVersion = "$NEXT_VERSION-SNAPSHOT"
override val version = if (isSnapshot()) snapshotVersion else VERSION
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import com.google.devtools.ksp.processing.SymbolProcessorEnvironment
import com.google.devtools.ksp.processing.SymbolProcessorProvider
import com.google.devtools.ksp.symbol.KSAnnotated
import com.google.devtools.ksp.symbol.KSClassDeclaration
import com.google.devtools.ksp.symbol.Modifier
import com.squareup.kotlinpoet.*
import com.squareup.kotlinpoet.ParameterizedTypeName.Companion.parameterizedBy
import com.squareup.kotlinpoet.ksp.toClassName
Expand Down Expand Up @@ -81,6 +82,8 @@ private class IncludeMessageElementsProcessor(val environment: SymbolProcessorEn
.filterIsInstance<KSClassDeclaration>()
// 是一个可序列化的具体的类
.filter { !it.isAbstract() }
// isAbstract 无法判断 sealed
.filter { Modifier.SEALED !in it.modifiers }
// 是 BaseMessageElement 的子类
.filter { baseDeclarationType.isAssignableFrom(it.asStarProjectedType()) }
.onEach {
Expand Down
2 changes: 1 addition & 1 deletion simbot-component-telegram-core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ The configuration file `*.bot.json`
```json5
{
"componet": "simbot.telegram",
"component": "simbot.telegram",
"ticket": {
"token": "Your Bot Token"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,12 @@ public sealed class TelegramMessageEntity : TelegramMessageElement, PlainText {
@SerialName("telegram.m.message_entity.simple")
public class Simple internal constructor(
override val text: String,
override val type: String,
private val typeValue: String,
override val sourceEntity: MessageEntity?
) : TelegramMessageEntity()
) : TelegramMessageEntity() {
override val type: String
get() = typeValue
}

/**
* An implementation with type [MessageEntityType.TEXT_LINK]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ internal fun StdlibMessage.toMessages(): Messages {
else -> {
TelegramMessageEntity.Simple(
text = text.substring(entity),
type = entity.type,
typeValue = entity.type,
entity
)
}
Expand Down

0 comments on commit ff047ae

Please sign in to comment.