Skip to content

Commit

Permalink
Merge pull request #171 from simple-robot/dev/main
Browse files Browse the repository at this point in the history
dev/main
  • Loading branch information
ForteScarlet authored Aug 18, 2024
2 parents 21d29fc + ffc382f commit c76df79
Show file tree
Hide file tree
Showing 12 changed files with 52 additions and 77 deletions.
7 changes: 0 additions & 7 deletions .changelog/v4.0.0-beta2.md

This file was deleted.

7 changes: 0 additions & 7 deletions .changelog/v4.0.0-beta3.md

This file was deleted.

7 changes: 0 additions & 7 deletions .changelog/v4.0.0-beta4.md

This file was deleted.

7 changes: 0 additions & 7 deletions .changelog/v4.0.0-beta5.md

This file was deleted.

7 changes: 0 additions & 7 deletions .changelog/v4.0.0-beta6.md

This file was deleted.

8 changes: 0 additions & 8 deletions .changelog/v4.0.0-dev1.md

This file was deleted.

7 changes: 0 additions & 7 deletions .changelog/v4.0.0-dev2.md

This file was deleted.

7 changes: 0 additions & 7 deletions .changelog/v4.0.0-dev3.md

This file was deleted.

4 changes: 4 additions & 0 deletions .changelog/v4.0.1.md
Original file line number Diff line number Diff line change
@@ -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),感谢您的贡献与支持!
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions buildSrc/src/main/kotlin/P.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -453,7 +453,7 @@ public sealed class CardElement {
@SerialName(Paragraph.TYPE)
public data class Paragraph(
public val cols: Int,
public val fields: List<Text>
public val fields: List<Text> = emptyList()
) : CardElement() {
init {
require(cols in 1..3) { "Cols must in 1..3, but $cols" }
Expand Down Expand Up @@ -625,8 +625,10 @@ public sealed class CardModule {
*/
@Serializable
@SerialName(ImageGroup.TYPE)
public data class ImageGroup(@Serializable(CardImageListWithTypeSerializer::class) public val elements: List<CardElement.Image>) :
CardModule() {
public data class ImageGroup(
@Serializable(CardImageListWithTypeSerializer::class)
public val elements: List<CardElement.Image>
) : CardModule() {
init {
require(elements.size in 1..9) { "The size of elements must be 1..9, but ${elements.size}" }
}
Expand Down Expand Up @@ -659,8 +661,10 @@ public sealed class CardModule {
*/
@Serializable
@SerialName(Container.TYPE)
public data class Container(@Serializable(CardImageListWithTypeSerializer::class) public val elements: List<CardElement.Image>) :
CardModule() {
public data class Container(
@Serializable(CardImageListWithTypeSerializer::class)
public val elements: List<CardElement.Image>
) : CardModule() {
init {
require(elements.size in 1..9) { "The size of elements must be 1..9, but ${elements.size}" }
}
Expand Down Expand Up @@ -693,8 +697,10 @@ public sealed class CardModule {
*/
@Serializable
@SerialName(ActionGroup.TYPE)
public data class ActionGroup(@Serializable(CardButtonListWithTypeSerializer::class) public val elements: List<CardElement.Button>) :
CardModule() {
public data class ActionGroup(
@Serializable(CardButtonListWithTypeSerializer::class)
public val elements: List<CardElement.Button> = emptyList()
) : CardModule() {
init {
require(elements.size <= 4) { "The size of elements must be <= 4, but ${elements.size}" }
}
Expand Down Expand Up @@ -789,23 +795,35 @@ 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()

/**
* 音频。
*/
@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()

/**
* 视频。
*/
@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 {
Expand All @@ -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)

}
}
Expand Down Expand Up @@ -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."
}
}
}

Expand Down Expand Up @@ -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"
}
}

Expand Down

0 comments on commit c76df79

Please sign in to comment.