From 3f386742ea55e73f8bc58fd26a619ff713997957 Mon Sep 17 00:00:00 2001 From: ForteScarlet Date: Sun, 18 Aug 2024 22:11:33 +0800 Subject: [PATCH 1/4] remove old changelog files --- .changelog/v4.0.0-beta2.md | 7 ------- .changelog/v4.0.0-beta3.md | 7 ------- .changelog/v4.0.0-beta4.md | 7 ------- .changelog/v4.0.0-beta5.md | 7 ------- .changelog/v4.0.0-beta6.md | 7 ------- .changelog/v4.0.0-dev1.md | 8 -------- .changelog/v4.0.0-dev2.md | 7 ------- .changelog/v4.0.0-dev3.md | 7 ------- 8 files changed, 57 deletions(-) delete mode 100644 .changelog/v4.0.0-beta2.md delete mode 100644 .changelog/v4.0.0-beta3.md delete mode 100644 .changelog/v4.0.0-beta4.md delete mode 100644 .changelog/v4.0.0-beta5.md delete mode 100644 .changelog/v4.0.0-beta6.md delete mode 100644 .changelog/v4.0.0-dev1.md delete mode 100644 .changelog/v4.0.0-dev2.md delete mode 100644 .changelog/v4.0.0-dev3.md diff --git a/.changelog/v4.0.0-beta2.md b/.changelog/v4.0.0-beta2.md deleted file mode 100644 index dfa375b7..00000000 --- a/.changelog/v4.0.0-beta2.md +++ /dev/null @@ -1,7 +0,0 @@ -> 对应核心版本: [**v4.0.0-beta1**](https://github.com/simple-robot/simpler-robot/releases/tag/v4.0.0-beta1) - -> [!warning] -> 目前版本尚处于 **`beta`** 阶段,代表仍然可能存在部分已知问题或未知问题, -> 以及尚未完善的内容和落后于官方更新的内容。 - -我们欢迎并期望着您的 [反馈](https://github.com/simple-robot/simbot-component-kook/issues) 或 [协助](https://github.com/simple-robot/simbot-component-kook/pulls),感谢您的贡献与支持! diff --git a/.changelog/v4.0.0-beta3.md b/.changelog/v4.0.0-beta3.md deleted file mode 100644 index 1a824792..00000000 --- a/.changelog/v4.0.0-beta3.md +++ /dev/null @@ -1,7 +0,0 @@ -> 对应核心版本: [**v4.0.0-RC3**](https://github.com/simple-robot/simpler-robot/releases/tag/v4.0.0-RC3) - -> [!warning] -> 目前版本尚处于 **`beta`** 阶段,代表仍然可能存在部分已知问题或未知问题, -> 以及尚未完善的内容和落后于官方更新的内容。 - -我们欢迎并期望着您的 [反馈](https://github.com/simple-robot/simbot-component-kook/issues) 或 [协助](https://github.com/simple-robot/simbot-component-kook/pulls),感谢您的贡献与支持! diff --git a/.changelog/v4.0.0-beta4.md b/.changelog/v4.0.0-beta4.md deleted file mode 100644 index 474f8354..00000000 --- a/.changelog/v4.0.0-beta4.md +++ /dev/null @@ -1,7 +0,0 @@ -> 对应核心版本: [**v4.0.0**](https://github.com/simple-robot/simpler-robot/releases/tag/v4.0.0) - -> [!warning] -> 目前版本尚处于 **`beta`** 阶段,代表仍然可能存在部分已知问题或未知问题, -> 以及尚未完善的内容和落后于官方更新的内容。 - -我们欢迎并期望着您的 [反馈](https://github.com/simple-robot/simbot-component-kook/issues) 或 [协助](https://github.com/simple-robot/simbot-component-kook/pulls),感谢您的贡献与支持! diff --git a/.changelog/v4.0.0-beta5.md b/.changelog/v4.0.0-beta5.md deleted file mode 100644 index a18f9fde..00000000 --- a/.changelog/v4.0.0-beta5.md +++ /dev/null @@ -1,7 +0,0 @@ -> 对应核心版本: [**v4.5.0**](https://github.com/simple-robot/simpler-robot/releases/tag/v4.5.0) - -> [!warning] -> 目前版本尚处于 **`beta`** 阶段,代表仍然可能存在部分已知问题或未知问题, -> 以及尚未完善的内容和落后于官方更新的内容。 - -我们欢迎并期望着您的 [反馈](https://github.com/simple-robot/simbot-component-kook/issues) 或 [协助](https://github.com/simple-robot/simbot-component-kook/pulls),感谢您的贡献与支持! diff --git a/.changelog/v4.0.0-beta6.md b/.changelog/v4.0.0-beta6.md deleted file mode 100644 index a18f9fde..00000000 --- a/.changelog/v4.0.0-beta6.md +++ /dev/null @@ -1,7 +0,0 @@ -> 对应核心版本: [**v4.5.0**](https://github.com/simple-robot/simpler-robot/releases/tag/v4.5.0) - -> [!warning] -> 目前版本尚处于 **`beta`** 阶段,代表仍然可能存在部分已知问题或未知问题, -> 以及尚未完善的内容和落后于官方更新的内容。 - -我们欢迎并期望着您的 [反馈](https://github.com/simple-robot/simbot-component-kook/issues) 或 [协助](https://github.com/simple-robot/simbot-component-kook/pulls),感谢您的贡献与支持! diff --git a/.changelog/v4.0.0-dev1.md b/.changelog/v4.0.0-dev1.md deleted file mode 100644 index c22c14c1..00000000 --- a/.changelog/v4.0.0-dev1.md +++ /dev/null @@ -1,8 +0,0 @@ -> 对应核心版本: [**v4.0.0-dev18**](https://github.com/simple-robot/simpler-robot/releases/tag/v4.0.0-dev18) - -> [!warning] -> 目前版本尚处于 **`dev`** 阶段,代表仍然可能存在部分已知问题或未知问题, -> 以及尚未完善的内容和落后于官方更新的内容。 - -我们欢迎并期望着您的 [反馈](https://github.com/simple-robot/simbot-component-kook/issues) 或 [协助](https://github.com/simple-robot/simbot-component-kook/pulls), -感谢您的贡献与支持! diff --git a/.changelog/v4.0.0-dev2.md b/.changelog/v4.0.0-dev2.md deleted file mode 100644 index 88193e69..00000000 --- a/.changelog/v4.0.0-dev2.md +++ /dev/null @@ -1,7 +0,0 @@ -> 对应核心版本: [**v4.0.0-dev18**](https://github.com/simple-robot/simpler-robot/releases/tag/v4.0.0-dev18) - -> [!warning] -> 目前版本尚处于 **`dev`** 阶段,代表仍然可能存在部分已知问题或未知问题, -> 以及尚未完善的内容和落后于官方更新的内容。 - -我们欢迎并期望着您的 [反馈](https://github.com/simple-robot/simbot-component-kook/issues) 或 [协助](https://github.com/simple-robot/simbot-component-kook/pulls),感谢您的贡献与支持! diff --git a/.changelog/v4.0.0-dev3.md b/.changelog/v4.0.0-dev3.md deleted file mode 100644 index 88193e69..00000000 --- a/.changelog/v4.0.0-dev3.md +++ /dev/null @@ -1,7 +0,0 @@ -> 对应核心版本: [**v4.0.0-dev18**](https://github.com/simple-robot/simpler-robot/releases/tag/v4.0.0-dev18) - -> [!warning] -> 目前版本尚处于 **`dev`** 阶段,代表仍然可能存在部分已知问题或未知问题, -> 以及尚未完善的内容和落后于官方更新的内容。 - -我们欢迎并期望着您的 [反馈](https://github.com/simple-robot/simbot-component-kook/issues) 或 [协助](https://github.com/simple-robot/simbot-component-kook/pulls),感谢您的贡献与支持! From a3745a7ec2890663194d053f44fcb10343e9822d Mon Sep 17 00:00:00 2001 From: ForteScarlet Date: Sun, 18 Aug 2024 22:20:32 +0800 Subject: [PATCH 2/4] =?UTF-8?q?fix(api):=20=E4=B8=BA=20CardMessage=20?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E7=9A=84=E9=83=A8=E5=88=86=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E7=9A=84=E9=83=A8=E5=88=86=E5=B1=9E=E6=80=A7=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E5=80=BC=EF=BC=8C=E4=BB=A5=E5=8F=8A=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=E9=83=A8=E5=88=86=E7=BC=BA=E9=99=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../forte/simbot/kook/objects/card/Card.kt | 57 +++++++++++++------ 1 file changed, 40 insertions(+), 17 deletions(-) diff --git a/simbot-component-kook-api/src/commonMain/kotlin/love/forte/simbot/kook/objects/card/Card.kt b/simbot-component-kook-api/src/commonMain/kotlin/love/forte/simbot/kook/objects/card/Card.kt index a5b00b9f..fd62942c 100644 --- a/simbot-component-kook-api/src/commonMain/kotlin/love/forte/simbot/kook/objects/card/Card.kt +++ b/simbot-component-kook-api/src/commonMain/kotlin/love/forte/simbot/kook/objects/card/Card.kt @@ -377,7 +377,7 @@ public sealed class CardElement { @SerialName(Image.TYPE) public data class Image @JvmOverloads constructor( public val src: String, - public val alt: String, + public val alt: String = "", public val size: Size = Size.Default, public val circle: Boolean = false ) : CardElement() { @@ -453,7 +453,7 @@ public sealed class CardElement { @SerialName(Paragraph.TYPE) public data class Paragraph( public val cols: Int, - public val fields: List + public val fields: List = emptyList() ) : CardElement() { init { require(cols in 1..3) { "Cols must in 1..3, but $cols" } @@ -625,8 +625,10 @@ public sealed class CardModule { */ @Serializable @SerialName(ImageGroup.TYPE) - public data class ImageGroup(@Serializable(CardImageListWithTypeSerializer::class) public val elements: List) : - CardModule() { + public data class ImageGroup( + @Serializable(CardImageListWithTypeSerializer::class) + public val elements: List + ) : CardModule() { init { require(elements.size in 1..9) { "The size of elements must be 1..9, but ${elements.size}" } } @@ -659,8 +661,10 @@ public sealed class CardModule { */ @Serializable @SerialName(Container.TYPE) - public data class Container(@Serializable(CardImageListWithTypeSerializer::class) public val elements: List) : - CardModule() { + public data class Container( + @Serializable(CardImageListWithTypeSerializer::class) + public val elements: List + ) : CardModule() { init { require(elements.size in 1..9) { "The size of elements must be 1..9, but ${elements.size}" } } @@ -693,8 +697,10 @@ public sealed class CardModule { */ @Serializable @SerialName(ActionGroup.TYPE) - public data class ActionGroup(@Serializable(CardButtonListWithTypeSerializer::class) public val elements: List) : - CardModule() { + public data class ActionGroup( + @Serializable(CardButtonListWithTypeSerializer::class) + public val elements: List = emptyList() + ) : CardModule() { init { require(elements.size <= 4) { "The size of elements must be <= 4, but ${elements.size}" } } @@ -789,7 +795,11 @@ public sealed class CardModule { */ @Serializable @SerialName(FILE_TYPE) - public data class File(override val src: String, override val title: String, override val cover: String) : + public data class File( + override val src: String = "", + override val title: String = "", + override val cover: String = "" + ) : Files() /** @@ -797,7 +807,11 @@ public sealed class CardModule { */ @Serializable @SerialName(AUDIO_TYPE) - public data class Audio(override val src: String, override val title: String, override val cover: String) : + public data class Audio( + override val src: String = "", + override val title: String = "", + override val cover: String = "" + ) : Files() /** @@ -805,7 +819,11 @@ public sealed class CardModule { */ @Serializable @SerialName(VIDEO_TYPE) - public data class Video(override val src: String, override val title: String, override val cover: String) : + public data class Video( + override val src: String = "", + override val title: String = "", + override val cover: String = "" + ) : Files() public companion object { @@ -814,13 +832,16 @@ public sealed class CardModule { public const val VIDEO_TYPE: String = "video" @JvmStatic - public fun file(src: String, title: String, cover: String): File = File(src, title, cover) + @JvmOverloads + public fun file(src: String, title: String, cover: String = ""): File = File(src, title, cover) @JvmStatic - public fun audio(src: String, title: String, cover: String): Audio = Audio(src, title, cover) + @JvmOverloads + public fun audio(src: String, title: String, cover: String = ""): Audio = Audio(src, title, cover) @JvmStatic - public fun video(src: String, title: String, cover: String): Video = Video(src, title, cover) + @JvmOverloads + public fun video(src: String, title: String, cover: String = ""): Video = Video(src, title, cover) } } @@ -853,8 +874,10 @@ public sealed class CardModule { public val endTime: Long ) : CardModule() { init { - require(mode == CountdownMode.SECOND && startTime != null) { - "When mode is 'SECOND', 'startTime' must not be null." + if (mode == CountdownMode.SECOND) { + requireNotNull(startTime) { + "When mode is 'SECOND', 'startTime' must not be null." + } } } @@ -898,7 +921,7 @@ public sealed class CardModule { public val code: String ) : CardModule() { public companion object { - public const val TYPE: String = "" + public const val TYPE: String = "invite" } } From 5bb2edc4da811903a2197638a86589a0f8571c81 Mon Sep 17 00:00:00 2001 From: ForteScarlet Date: Sun, 18 Aug 2024 23:39:59 +0800 Subject: [PATCH 3/4] release: v4.0.1 --- CHANGELOG.md | 7 ++++++- buildSrc/src/main/kotlin/P.kt | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e722015c..3b2bc6b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# v4.0.1 + +> Release & Pull Notes: [v4.0.1](https://github.com/simple-robot/simpler-robot/releases/tag/v4.0.1) + +- fix(api): 为 CardMessage 相关的部分类型的部分属性添加默认值,以及修正部分缺陷 ([`a3745a7`](https://github.com/simple-robot/simpler-robot/commit/a3745a7)) + # v4.0.0 > Release & Pull Notes: [v4.0.0](https://github.com/simple-robot/simpler-robot/releases/tag/v4.0.0) @@ -15,7 +21,6 @@ - build(deps): Update Kotlin to 2.0.10, simbot to 4.6.0 ([`f81d7e7`](https://github.com/simple-robot/simpler-robot/commit/f81d7e7)) - build(deps): bump ksp from 2.0.0-1.0.24 to 2.0.10-1.0.24 ([`11bfb0c`](https://github.com/simple-robot/simpler-robot/commit/11bfb0c)) -# v4.0.0-beta6 > Release & Pull Notes: [v4.0.0-beta6](https://github.com/simple-robot/simpler-robot/releases/tag/v4.0.0-beta6) diff --git a/buildSrc/src/main/kotlin/P.kt b/buildSrc/src/main/kotlin/P.kt index 410b45f3..351625f3 100644 --- a/buildSrc/src/main/kotlin/P.kt +++ b/buildSrc/src/main/kotlin/P.kt @@ -32,8 +32,8 @@ object P : ProjectDetail() { override val homepage: String get() = HOMEPAGE - const val VERSION = "4.0.0" - const val NEXT_VERSION = "4.0.1" + const val VERSION = "4.0.1" + const val NEXT_VERSION = "4.0.2" override val snapshotVersion = "$NEXT_VERSION-SNAPSHOT" override val version = if (isSnapshot()) snapshotVersion else VERSION From ffc382f4cc410317eb99d11e7673b3de9f1239a2 Mon Sep 17 00:00:00 2001 From: ForteScarlet Date: Sun, 18 Aug 2024 23:43:11 +0800 Subject: [PATCH 4/4] release: v4.0.1 --- .changelog/v4.0.1.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .changelog/v4.0.1.md diff --git a/.changelog/v4.0.1.md b/.changelog/v4.0.1.md new file mode 100644 index 00000000..5b045d68 --- /dev/null +++ b/.changelog/v4.0.1.md @@ -0,0 +1,4 @@ +> [!note] +> 对应核心版本: [**v4.6.0**](https://github.com/simple-robot/simpler-robot/releases/tag/v4.6.0) + +我们欢迎并期望着您的 [反馈](https://github.com/simple-robot/simbot-component-kook/issues) 或 [协助](https://github.com/simple-robot/simbot-component-kook/pulls),感谢您的贡献与支持!