-
-
Notifications
You must be signed in to change notification settings - Fork 1
Release: v4.2.0 #292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Release: v4.2.0 #292
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
3e52a3c
feat(api): 支持 ChannelKickoutApi (/channel/kickout)
ForteScarlet f72c588
feat(api): making ChannelKickoutApi constructor parameters inaccessib…
ForteScarlet b169131
Merge pull request #284 from simple-robot/dev/channel-kickout
ForteScarlet 9980b36
feat(api): Support /channel/user-list
ForteScarlet c187965
Update simbot-component-kook-api/src/commonMain/kotlin/love/forte/sim…
ForteScarlet 065d36f
Merge pull request #286 from simple-robot/dev/support-channel-user-li…
ForteScarlet b805c12
test(api): 改进 ChannelKickoutApi 的部分相关测试
ForteScarlet 5b5cf10
improve(api): 改进 identifyNum 的默认值获取
ForteScarlet 9c85658
build: next version to 4.2.0
ForteScarlet 2c65d80
Update simbot-component-kook-api/src/commonTest/kotlin/love/forte/sim…
ForteScarlet 9eeeade
Update simbot-component-kook-api/src/commonTest/kotlin/love/forte/sim…
ForteScarlet 7bc1540
Update simbot-component-kook-api/src/commonTest/kotlin/love/forte/sim…
ForteScarlet 5afc99d
Merge pull request #287 from simple-robot/dev/support-channel-kickout…
ForteScarlet 6263997
feat(api): add support for ChannelMoveUserApi with tests
ForteScarlet 9ebbe47
Update simbot-component-kook-api/src/commonMain/kotlin/love/forte/sim…
ForteScarlet 5d36e13
Merge pull request #288 from simple-robot/dev/support-channel-move-us…
ForteScarlet 996dd52
feat(api): add voice channel APIs (join, list, leave) supported
ForteScarlet 765fba9
Merge pull request #289 from simple-robot/dev/support-voice-APIs
ForteScarlet 632dace
feat(core): 增加新的 KookVoiceChannel 来描述一个语音频道的信息
ForteScarlet 38a3e40
feat(core): 实现 KookVoiceChannel, KookVoiceMember 并支持语音频道的相关操作
ForteScarlet 74bf089
build: api dump
ForteScarlet 4311397
build(core): 补充桥接函数注解
ForteScarlet a005757
test: Fix compilation failed
ForteScarlet 192aedc
Merge pull request #291 from simple-robot/dev/support-kook-voice-channel
ForteScarlet 16274fb
release: v4.2.0
ForteScarlet c2016ff
release: v4.2.0, fix logger msg
ForteScarlet File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
268 changes: 268 additions & 0 deletions
268
simbot-component-kook-api/api/simbot-component-kook-api.api
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 71 additions & 0 deletions
71
...nt-kook-api/src/commonMain/kotlin/love/forte/simbot/kook/api/channel/ChannelKickoutApi.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
/* | ||
* Copyright (c) 2023-2025. ForteScarlet. | ||
* | ||
* This file is part of simbot-component-kook. | ||
* | ||
* simbot-component-kook is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* simbot-component-kook is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with simbot-component-kook, | ||
* If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package love.forte.simbot.kook.api.channel | ||
|
||
import kotlinx.serialization.DeserializationStrategy | ||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
import kotlinx.serialization.builtins.serializer | ||
import love.forte.simbot.kook.api.KookPostApi | ||
import kotlin.jvm.JvmStatic | ||
|
||
/** | ||
* [踢出语音频道中的用户](https://developer.kookapp.cn/doc/http/channel#踢出语音频道中的用户) | ||
* | ||
* 踢出语音频道中的用户,只能踢出在语音频道中的用户 | ||
* | ||
* @author ForteScarlet | ||
* @since 4.2.0 | ||
*/ | ||
public class ChannelKickoutApi private constructor( | ||
channelId: String, | ||
userId: String | ||
) : KookPostApi<Unit>() { | ||
public companion object Factory { | ||
private val PATH = ApiPath.create("channel", "kickout") | ||
|
||
/** | ||
* 构造 [ChannelKickoutApi]. | ||
* | ||
* @param channelId 目标频道 id,需要是语音频道 | ||
* @param userId 用户 id | ||
*/ | ||
@JvmStatic | ||
public fun create(channelId: String, userId: String): ChannelKickoutApi = | ||
ChannelKickoutApi(channelId, userId) | ||
} | ||
|
||
override val resultDeserializationStrategy: DeserializationStrategy<Unit> | ||
get() = Unit.serializer() | ||
|
||
override val apiPath: ApiPath | ||
get() = PATH | ||
|
||
override val body: Any = Body(channelId, userId) | ||
|
||
@Serializable | ||
private data class Body( | ||
@SerialName("channel_id") | ||
val channelId: String, | ||
@SerialName("user_id") | ||
val userId: String | ||
) | ||
} |
83 changes: 83 additions & 0 deletions
83
...t-kook-api/src/commonMain/kotlin/love/forte/simbot/kook/api/channel/ChannelMoveUserApi.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
/* | ||
* Copyright (c) 2023-2025. ForteScarlet. | ||
* | ||
* This file is part of simbot-component-kook. | ||
* | ||
* simbot-component-kook is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* simbot-component-kook is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with simbot-component-kook, | ||
* If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package love.forte.simbot.kook.api.channel | ||
|
||
import kotlinx.serialization.DeserializationStrategy | ||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
import kotlinx.serialization.builtins.serializer | ||
import love.forte.simbot.kook.api.KookPostApi | ||
import kotlin.jvm.JvmStatic | ||
|
||
/** | ||
* [语音频道之间移动用户](https://developer.kookapp.cn/doc/http/channel#语音频道之间移动用户) | ||
* | ||
* 语音频道之间移动用户,只能在语音频道之间移动,用户也必须在其他语音频道在线才能够移动到目标频道。 | ||
* | ||
* | ||
* @author ForteScarlet | ||
* @since 4.2.0 | ||
*/ | ||
public class ChannelMoveUserApi private constructor( | ||
targetId: String, | ||
userIds: List<String> | ||
) : KookPostApi<Unit>() { | ||
|
||
public companion object Factory { | ||
private val PATH = ApiPath.create("channel", "move-user") | ||
|
||
/** | ||
* 构造 [ChannelMoveUserApi]. | ||
* | ||
* @param targetId 目标频道 id,需要是语音频道 | ||
* @param userIds 用户 id 的数组 | ||
*/ | ||
@JvmStatic | ||
public fun create(targetId: String, userIds: List<String>): ChannelMoveUserApi = | ||
ChannelMoveUserApi(targetId, userIds) | ||
|
||
/** | ||
* 构造 [ChannelMoveUserApi]. | ||
* | ||
* @param targetId 目标频道 id,需要是语音频道 | ||
* @param userIds 用户 id 的数组 | ||
*/ | ||
@JvmStatic | ||
public fun create(targetId: String, vararg userIds: String): ChannelMoveUserApi = | ||
ChannelMoveUserApi(targetId, userIds.asList()) | ||
} | ||
|
||
override val resultDeserializationStrategy: DeserializationStrategy<Unit> | ||
get() = Unit.serializer() | ||
|
||
override val apiPath: ApiPath | ||
get() = PATH | ||
|
||
override val body: Any = Body(targetId, userIds) | ||
|
||
@Serializable | ||
private data class Body( | ||
@SerialName("target_id") | ||
val targetId: String, | ||
@SerialName("user_ids") | ||
val userIds: List<String> | ||
) | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The toString() method improvement adds null checks for uninitialized properties, but the
data
field is not checked like the others (httpStatus, rateLimit, raw). Consider adding a similar null check for data if it can also be uninitialized.Copilot uses AI. Check for mistakes.