From 2008c4d06902573f2f48004d73499dd0bc72f710 Mon Sep 17 00:00:00 2001 From: ForteScarlet Date: Mon, 5 May 2025 01:37:22 +0800 Subject: [PATCH 1/6] Update current version to v4.1.1 --- buildSrc/src/main/kotlin/P.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildSrc/src/main/kotlin/P.kt b/buildSrc/src/main/kotlin/P.kt index 8c2a0894..efcd8c3a 100644 --- a/buildSrc/src/main/kotlin/P.kt +++ b/buildSrc/src/main/kotlin/P.kt @@ -32,7 +32,7 @@ object P : ProjectDetail() { override val homepage: String get() = HOMEPAGE - const val VERSION = "4.1.0" + const val VERSION = "4.1.1" const val NEXT_VERSION = "4.1.1" override val snapshotVersion = "$NEXT_VERSION-SNAPSHOT" From 796261aeb3b2c76bee480c136c203cbe9025b736 Mon Sep 17 00:00:00 2001 From: ForteScarlet Date: Mon, 5 May 2025 01:40:57 +0800 Subject: [PATCH 2/6] fix(api): Fix api path of CreateInviteApi --- .../love/forte/simbot/kook/api/invite/CreateInviteApi.kt | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/simbot-component-kook-api/src/commonMain/kotlin/love/forte/simbot/kook/api/invite/CreateInviteApi.kt b/simbot-component-kook-api/src/commonMain/kotlin/love/forte/simbot/kook/api/invite/CreateInviteApi.kt index 7e32a740..d1cd7019 100644 --- a/simbot-component-kook-api/src/commonMain/kotlin/love/forte/simbot/kook/api/invite/CreateInviteApi.kt +++ b/simbot-component-kook-api/src/commonMain/kotlin/love/forte/simbot/kook/api/invite/CreateInviteApi.kt @@ -38,10 +38,7 @@ public class CreateInviteApi private constructor( ) : KookPostApi() { public companion object Factory { // /api/v3/invite/create POST - private val PATH = ApiPath.create("invite", "list") - - // TODO Empty CreateInviteApi - private val EMPTY = CreateInviteApi() + private val PATH = ApiPath.create("invite", "create") /** * 通过 [服务器id][guildId] 构建一个 [创建邀请链接][CreateInviteApi] 实例。 From dab7d1cfd6260cef7dde24f0943b72fc01060602 Mon Sep 17 00:00:00 2001 From: ForteScarlet Date: Mon, 5 May 2025 02:00:52 +0800 Subject: [PATCH 3/6] Java apis for BotRequests --- .../simbot/kook/stdlib/BotRequests.jvm.kt | 139 ++++++++++++++++++ 1 file changed, 139 insertions(+) create mode 100644 simbot-component-kook-stdlib/src/jvmMain/kotlin/love/forte/simbot/kook/stdlib/BotRequests.jvm.kt diff --git a/simbot-component-kook-stdlib/src/jvmMain/kotlin/love/forte/simbot/kook/stdlib/BotRequests.jvm.kt b/simbot-component-kook-stdlib/src/jvmMain/kotlin/love/forte/simbot/kook/stdlib/BotRequests.jvm.kt new file mode 100644 index 00000000..f7c22490 --- /dev/null +++ b/simbot-component-kook-stdlib/src/jvmMain/kotlin/love/forte/simbot/kook/stdlib/BotRequests.jvm.kt @@ -0,0 +1,139 @@ +/* + * Copyright (c) 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 . + */ + +@file:JvmName("BotRequests") +@file:JvmMultifileClass + +package love.forte.simbot.kook.stdlib + +import io.ktor.client.statement.* +import love.forte.simbot.annotations.Api4J +import love.forte.simbot.annotations.InternalSimbotAPI +import love.forte.simbot.kook.api.ApiResult +import love.forte.simbot.kook.api.KookApi +import love.forte.simbot.suspendrunner.asReserve +import love.forte.simbot.suspendrunner.reserve.SuspendReserve +import love.forte.simbot.suspendrunner.runInAsync +import love.forte.simbot.suspendrunner.runInNoScopeBlocking +import java.util.concurrent.CompletableFuture + +/** + * 使用 [Bot] 向 [KookApi] 发起请求。 + * @see KookApi.requestBy + */ +@Api4J +public fun KookApi<*>.requestByBlocking(bot: Bot): HttpResponse = + runInNoScopeBlocking { requestBy(bot) } + +/** + * 使用 [Bot] 向 [KookApi] 发起请求。 + * @see KookApi.requestBy + */ +@Api4J +@OptIn(InternalSimbotAPI::class) +public fun KookApi<*>.requestByAsync(bot: Bot): CompletableFuture = + runInAsync(scope = bot) { requestBy(bot) } + +/** + * 使用 [Bot] 向 [KookApi] 发起请求。 + * @see KookApi.requestBy + */ +@Api4J +@OptIn(InternalSimbotAPI::class) +public fun KookApi<*>.requestByReserve(bot: Bot): SuspendReserve = + asReserve(scope = bot) { requestBy(bot) } + +/** + * 使用 [Bot] 向 [KookApi] 发起请求。 + * @see KookApi.requestTextBy + */ +@Api4J +public fun KookApi<*>.requestTextByBlocking(bot: Bot): String = + runInNoScopeBlocking { requestTextBy(bot) } + +/** + * 使用 [Bot] 向 [KookApi] 发起请求。 + * @see KookApi.requestTextBy + */ +@Api4J +@OptIn(InternalSimbotAPI::class) +public fun KookApi<*>.requestTextByAsync(bot: Bot): CompletableFuture = + runInAsync(scope = bot) { requestTextBy(bot) } + +/** + * 使用 [Bot] 向 [KookApi] 发起请求。 + * @see KookApi.requestTextBy + */ +@Api4J +@OptIn(InternalSimbotAPI::class) +public fun KookApi<*>.requestTextByReserve(bot: Bot): SuspendReserve = + asReserve(scope = bot) { requestTextBy(bot) } + +/** + * 使用 [Bot] 向 [KookApi] 发起请求。 + * @see KookApi.requestResultBy + */ +@Api4J +public fun KookApi<*>.requestResultByBlocking(bot: Bot): ApiResult = + runInNoScopeBlocking { requestResultBy(bot) } + +/** + * 使用 [Bot] 向 [KookApi] 发起请求。 + * @see KookApi.requestResultBy + */ +@Api4J +@OptIn(InternalSimbotAPI::class) +public fun KookApi<*>.requestResultByAsync(bot: Bot): CompletableFuture = + runInAsync(scope = bot) { requestResultBy(bot) } + +/** + * 使用 [Bot] 向 [KookApi] 发起请求。 + * @see KookApi.requestResultBy + */ +@Api4J +@OptIn(InternalSimbotAPI::class) +public fun KookApi<*>.requestResultByReserve(bot: Bot): SuspendReserve = + asReserve(scope = bot) { requestResultBy(bot) } + +/** + * 使用 [Bot] 向 [KookApi] 发起请求。 + * @see KookApi.requestDataBy + */ +@Api4J +public fun KookApi.requestDataByBlocking(bot: Bot): T = + runInNoScopeBlocking { requestDataBy(bot) } + +/** + * 使用 [Bot] 向 [KookApi] 发起请求。 + * @see KookApi.requestDataBy + */ +@Api4J +@OptIn(InternalSimbotAPI::class) +public fun KookApi.requestDataByAsync(bot: Bot): CompletableFuture = + runInAsync(scope = bot) { requestDataBy(bot) } + +/** + * 使用 [Bot] 向 [KookApi] 发起请求。 + * @see KookApi.requestDataBy + */ +@Api4J +@OptIn(InternalSimbotAPI::class) +public fun KookApi.requestDataByReserve(bot: Bot): SuspendReserve = + asReserve(scope = bot) { requestDataBy(bot) } \ No newline at end of file From 2fcceb06c084e99e2fcb738f887416b9f946199f Mon Sep 17 00:00:00 2001 From: ForteScarlet Date: Mon, 5 May 2025 02:09:23 +0800 Subject: [PATCH 4/6] Java apis for (Kook)BotRequests --- .../simbot/component/kook/util/BotRequests.kt | 2 + .../component/kook/util/BotRequests.jvm.kt | 248 ++++++++++++++++++ 2 files changed, 250 insertions(+) create mode 100644 simbot-component-kook-core/src/jvmMain/kotlin/love/forte/simbot/component/kook/util/BotRequests.jvm.kt diff --git a/simbot-component-kook-core/src/commonMain/kotlin/love/forte/simbot/component/kook/util/BotRequests.kt b/simbot-component-kook-core/src/commonMain/kotlin/love/forte/simbot/component/kook/util/BotRequests.kt index d57c685d..55d2eb59 100644 --- a/simbot-component-kook-core/src/commonMain/kotlin/love/forte/simbot/component/kook/util/BotRequests.kt +++ b/simbot-component-kook-core/src/commonMain/kotlin/love/forte/simbot/component/kook/util/BotRequests.kt @@ -18,6 +18,7 @@ * If not, see . */ @file:JvmName("KookBotRequests") +@file:JvmMultifileClass package love.forte.simbot.component.kook.util @@ -30,6 +31,7 @@ import love.forte.simbot.kook.stdlib.requestBy import love.forte.simbot.kook.stdlib.requestDataBy import love.forte.simbot.kook.stdlib.requestResultBy import love.forte.simbot.kook.stdlib.requestTextBy +import kotlin.jvm.JvmMultifileClass import kotlin.jvm.JvmName import kotlin.jvm.JvmSynthetic diff --git a/simbot-component-kook-core/src/jvmMain/kotlin/love/forte/simbot/component/kook/util/BotRequests.jvm.kt b/simbot-component-kook-core/src/jvmMain/kotlin/love/forte/simbot/component/kook/util/BotRequests.jvm.kt new file mode 100644 index 00000000..57a8e113 --- /dev/null +++ b/simbot-component-kook-core/src/jvmMain/kotlin/love/forte/simbot/component/kook/util/BotRequests.jvm.kt @@ -0,0 +1,248 @@ +/* + * Copyright (c) 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 . + */ + +@file:JvmName("KookBotRequests") +@file:JvmMultifileClass + +package love.forte.simbot.component.kook.util + +import io.ktor.client.statement.* +import love.forte.simbot.annotations.Api4J +import love.forte.simbot.annotations.InternalSimbotAPI +import love.forte.simbot.component.kook.bot.KookBot +import love.forte.simbot.kook.api.ApiResult +import love.forte.simbot.kook.api.KookApi +import love.forte.simbot.suspendrunner.asReserve +import love.forte.simbot.suspendrunner.reserve.SuspendReserve +import love.forte.simbot.suspendrunner.runInAsync +import love.forte.simbot.suspendrunner.runInNoScopeBlocking +import java.util.concurrent.CompletableFuture + +//region request +/** + * 使用 [KookBot] 对 [api] 发起请求。 + * @see KookBot.request + */ +@Api4J +public fun KookBot.requestBlocking(api: KookApi<*>): HttpResponse = + runInNoScopeBlocking { request(api) } + +/** + * 使用 [KookBot] 对 [api] 发起请求。 + * @see KookBot.request + */ +@Api4J +@OptIn(InternalSimbotAPI::class) +public fun KookBot.requestAsync(api: KookApi<*>): CompletableFuture = + runInAsync(scope = this) { request(api) } + +/** + * 使用 [KookBot] 对 [api] 发起请求。 + * @see KookBot.request + */ +@Api4J +@OptIn(InternalSimbotAPI::class) +public fun KookBot.requestReserve(api: KookApi<*>): SuspendReserve = + asReserve(scope = this) { request(api) } + +/** + * 使用 [KookBot] 对 [api] 发起请求。 + * @see KookBot.requestData + */ +@Api4J +public fun KookBot.requestDataBlocking(api: KookApi): T = + runInNoScopeBlocking { requestData(api) } + +/** + * 使用 [KookBot] 对 [api] 发起请求。 + * @see KookBot.requestData + */ +@Api4J +@OptIn(InternalSimbotAPI::class) +public fun KookBot.requestDataAsync(api: KookApi): CompletableFuture = + runInAsync(scope = this) { requestData(api) } + +/** + * 使用 [KookBot] 对 [api] 发起请求。 + * @see KookBot.requestData + */ +@Api4J +@OptIn(InternalSimbotAPI::class) +public fun KookBot.requestDataReserve(api: KookApi): SuspendReserve = + asReserve(scope = this) { requestData(api) } + +/** + * 使用 [KookBot] 对 [api] 发起请求。 + * @see KookBot.requestText + */ +@Api4J +public fun KookBot.requestTextBlocking(api: KookApi<*>): String = + runInNoScopeBlocking { requestText(api) } + +/** + * 使用 [KookBot] 对 [api] 发起请求。 + * @see KookBot.requestText + */ +@Api4J +@OptIn(InternalSimbotAPI::class) +public fun KookBot.requestTextAsync(api: KookApi<*>): CompletableFuture = + runInAsync(scope = this) { requestText(api) } + +/** + * 使用 [KookBot] 对 [api] 发起请求。 + * @see KookBot.requestText + */ +@Api4J +@OptIn(InternalSimbotAPI::class) +public fun KookBot.requestTextReserve(api: KookApi<*>): SuspendReserve = + asReserve(scope = this) { requestText(api) } + +/** + * 使用 [KookBot] 对 [api] 发起请求。 + * @see KookBot.requestResult + */ +@Api4J +public fun KookBot.requestResultBlocking(api: KookApi<*>): ApiResult = + runInNoScopeBlocking { requestResult(api) } + +/** + * 使用 [KookBot] 对 [api] 发起请求。 + * @see KookBot.requestResult + */ +@Api4J +@OptIn(InternalSimbotAPI::class) +public fun KookBot.requestResultAsync(api: KookApi<*>): CompletableFuture = + runInAsync(scope = this) { requestResult(api) } + +/** + * 使用 [KookBot] 对 [api] 发起请求。 + * @see KookBot.requestResult + */ +@Api4J +@OptIn(InternalSimbotAPI::class) +public fun KookBot.requestResultReserve(api: KookApi<*>): SuspendReserve = + asReserve(scope = this) { requestResult(api) } +//endregion + +//region requestBy +/** + * 使用 [KookApi] 通过 [bot] 发起请求。 + * @see KookApi.requestBy + */ +@Api4J +public fun KookApi<*>.requestByBlocking(bot: KookBot): HttpResponse = + runInNoScopeBlocking { requestBy(bot) } + +/** + * 使用 [KookApi] 通过 [bot] 发起请求。 + * @see KookApi.requestBy + */ +@Api4J +@OptIn(InternalSimbotAPI::class) +public fun KookApi<*>.requestByAsync(bot: KookBot): CompletableFuture = + runInAsync(scope = bot) { requestBy(bot) } + +/** + * 使用 [KookApi] 通过 [bot] 发起请求。 + * @see KookApi.requestBy + */ +@Api4J +@OptIn(InternalSimbotAPI::class) +public fun KookApi<*>.requestByReserve(bot: KookBot): SuspendReserve = + asReserve(scope = bot) { requestBy(bot) } + +/** + * 使用 [KookApi] 通过 [bot] 发起请求。 + * @see KookApi.requestDataBy + */ +@Api4J +public fun KookApi.requestDataByBlocking(bot: KookBot): T = + runInNoScopeBlocking { requestDataBy(bot) } + +/** + * 使用 [KookApi] 通过 [bot] 发起请求。 + * @see KookApi.requestDataBy + */ +@Api4J +@OptIn(InternalSimbotAPI::class) +public fun KookApi.requestDataByAsync(bot: KookBot): CompletableFuture = + runInAsync(scope = bot) { requestDataBy(bot) } + +/** + * 使用 [KookApi] 通过 [bot] 发起请求。 + * @see KookApi.requestDataBy + */ +@Api4J +@OptIn(InternalSimbotAPI::class) +public fun KookApi.requestDataByReserve(bot: KookBot): SuspendReserve = + asReserve(scope = bot) { requestDataBy(bot) } + +/** + * 使用 [KookApi] 通过 [bot] 发起请求。 + * @see KookApi.requestTextBy + */ +@Api4J +public fun KookApi<*>.requestTextByBlocking(bot: KookBot): String = + runInNoScopeBlocking { requestTextBy(bot) } + +/** + * 使用 [KookApi] 通过 [bot] 发起请求。 + * @see KookApi.requestTextBy + */ +@Api4J +@OptIn(InternalSimbotAPI::class) +public fun KookApi<*>.requestTextByAsync(bot: KookBot): CompletableFuture = + runInAsync(scope = bot) { requestTextBy(bot) } + +/** + * 使用 [KookApi] 通过 [bot] 发起请求。 + * @see KookApi.requestTextBy + */ +@Api4J +@OptIn(InternalSimbotAPI::class) +public fun KookApi<*>.requestTextByReserve(bot: KookBot): SuspendReserve = + asReserve(scope = bot) { requestTextBy(bot) } + +/** + * 使用 [KookApi] 通过 [bot] 发起请求。 + * @see KookApi.requestResultBy + */ +@Api4J +public fun KookApi<*>.requestResultByBlocking(bot: KookBot): ApiResult = + runInNoScopeBlocking { requestResultBy(bot) } + +/** + * 使用 [KookApi] 通过 [bot] 发起请求。 + * @see KookApi.requestResultBy + */ +@Api4J +@OptIn(InternalSimbotAPI::class) +public fun KookApi<*>.requestResultByAsync(bot: KookBot): CompletableFuture = + runInAsync(scope = bot) { requestResultBy(bot) } + +/** + * 使用 [KookApi] 通过 [bot] 发起请求。 + * @see KookApi.requestResultBy + */ +@Api4J +@OptIn(InternalSimbotAPI::class) +public fun KookApi<*>.requestResultByReserve(bot: KookBot): SuspendReserve = + asReserve(scope = bot) { requestResultBy(bot) } +//endregion From a554e1600e600ea81db11996d24467336d3f3ffb Mon Sep 17 00:00:00 2001 From: ForteScarlet Date: Mon, 5 May 2025 02:14:24 +0800 Subject: [PATCH 5/6] apiDump and add since doc --- .../api/simbot-component-kook-core.api | 28 ++++++++++++++++--- .../component/kook/util/BotRequests.jvm.kt | 24 ++++++++++++++++ .../api/simbot-component-kook-stdlib.api | 12 ++++++++ .../simbot/kook/stdlib/BotRequests.jvm.kt | 12 ++++++++ 4 files changed, 72 insertions(+), 4 deletions(-) diff --git a/simbot-component-kook-core/api/simbot-component-kook-core.api b/simbot-component-kook-core/api/simbot-component-kook-core.api index cc73b855..ead34f5a 100644 --- a/simbot-component-kook-core/api/simbot-component-kook-core.api +++ b/simbot-component-kook-core/api/simbot-component-kook-core.api @@ -1346,8 +1346,6 @@ public final class love/forte/simbot/component/kook/message/KookCardMessage$Comp public final class love/forte/simbot/component/kook/message/KookChannelMessageDetailsContent : love/forte/simbot/component/kook/message/KookMessageContent { public static final field Companion Llove/forte/simbot/component/kook/message/KookChannelMessageDetailsContent$Companion; - public final fun copy (Llove/forte/simbot/kook/messages/ChannelMessageDetails;Llove/forte/simbot/component/kook/bot/KookBot;)Llove/forte/simbot/component/kook/message/KookChannelMessageDetailsContent; - public static synthetic fun copy$default (Llove/forte/simbot/component/kook/message/KookChannelMessageDetailsContent;Llove/forte/simbot/kook/messages/ChannelMessageDetails;Llove/forte/simbot/component/kook/bot/KookBot;ILjava/lang/Object;)Llove/forte/simbot/component/kook/message/KookChannelMessageDetailsContent; public synthetic fun delete ([Llove/forte/simbot/ability/DeleteOption;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public fun equals (Ljava/lang/Object;)Z public fun getId ()Llove/forte/simbot/common/id/ID; @@ -1444,8 +1442,6 @@ public final class love/forte/simbot/component/kook/message/KookMessagesTransfor public final class love/forte/simbot/component/kook/message/KookQuote : love/forte/simbot/message/MessageReference { public static final field Companion Llove/forte/simbot/component/kook/message/KookQuote$Companion; public final fun component1 ()Llove/forte/simbot/kook/objects/Quote; - public final fun copy (Llove/forte/simbot/kook/objects/Quote;)Llove/forte/simbot/component/kook/message/KookQuote; - public static synthetic fun copy$default (Llove/forte/simbot/component/kook/message/KookQuote;Llove/forte/simbot/kook/objects/Quote;ILjava/lang/Object;)Llove/forte/simbot/component/kook/message/KookQuote; public static final fun create (Llove/forte/simbot/kook/objects/Quote;)Llove/forte/simbot/component/kook/message/KookQuote; public fun equals (Ljava/lang/Object;)Z public fun getId ()Llove/forte/simbot/common/id/ID; @@ -1533,13 +1529,37 @@ public abstract interface class love/forte/simbot/component/kook/role/KookRoleOp public final class love/forte/simbot/component/kook/util/KookBotRequests { public static final synthetic fun request (Llove/forte/simbot/component/kook/bot/KookBot;Llove/forte/simbot/kook/api/KookApi;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static final fun requestAsync (Llove/forte/simbot/component/kook/bot/KookBot;Llove/forte/simbot/kook/api/KookApi;)Ljava/util/concurrent/CompletableFuture; + public static final fun requestBlocking (Llove/forte/simbot/component/kook/bot/KookBot;Llove/forte/simbot/kook/api/KookApi;)Lio/ktor/client/statement/HttpResponse; public static final synthetic fun requestBy (Llove/forte/simbot/kook/api/KookApi;Llove/forte/simbot/component/kook/bot/KookBot;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static final fun requestByAsync (Llove/forte/simbot/kook/api/KookApi;Llove/forte/simbot/component/kook/bot/KookBot;)Ljava/util/concurrent/CompletableFuture; + public static final fun requestByBlocking (Llove/forte/simbot/kook/api/KookApi;Llove/forte/simbot/component/kook/bot/KookBot;)Lio/ktor/client/statement/HttpResponse; + public static final fun requestByReserve (Llove/forte/simbot/kook/api/KookApi;Llove/forte/simbot/component/kook/bot/KookBot;)Llove/forte/simbot/suspendrunner/reserve/SuspendReserve; public static final synthetic fun requestData (Llove/forte/simbot/component/kook/bot/KookBot;Llove/forte/simbot/kook/api/KookApi;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static final fun requestDataAsync (Llove/forte/simbot/component/kook/bot/KookBot;Llove/forte/simbot/kook/api/KookApi;)Ljava/util/concurrent/CompletableFuture; + public static final fun requestDataBlocking (Llove/forte/simbot/component/kook/bot/KookBot;Llove/forte/simbot/kook/api/KookApi;)Ljava/lang/Object; public static final synthetic fun requestDataBy (Llove/forte/simbot/kook/api/KookApi;Llove/forte/simbot/component/kook/bot/KookBot;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static final fun requestDataByAsync (Llove/forte/simbot/kook/api/KookApi;Llove/forte/simbot/component/kook/bot/KookBot;)Ljava/util/concurrent/CompletableFuture; + public static final fun requestDataByBlocking (Llove/forte/simbot/kook/api/KookApi;Llove/forte/simbot/component/kook/bot/KookBot;)Ljava/lang/Object; + public static final fun requestDataByReserve (Llove/forte/simbot/kook/api/KookApi;Llove/forte/simbot/component/kook/bot/KookBot;)Llove/forte/simbot/suspendrunner/reserve/SuspendReserve; + public static final fun requestDataReserve (Llove/forte/simbot/component/kook/bot/KookBot;Llove/forte/simbot/kook/api/KookApi;)Llove/forte/simbot/suspendrunner/reserve/SuspendReserve; + public static final fun requestReserve (Llove/forte/simbot/component/kook/bot/KookBot;Llove/forte/simbot/kook/api/KookApi;)Llove/forte/simbot/suspendrunner/reserve/SuspendReserve; public static final synthetic fun requestResult (Llove/forte/simbot/component/kook/bot/KookBot;Llove/forte/simbot/kook/api/KookApi;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static final fun requestResultAsync (Llove/forte/simbot/component/kook/bot/KookBot;Llove/forte/simbot/kook/api/KookApi;)Ljava/util/concurrent/CompletableFuture; + public static final fun requestResultBlocking (Llove/forte/simbot/component/kook/bot/KookBot;Llove/forte/simbot/kook/api/KookApi;)Llove/forte/simbot/kook/api/ApiResult; public static final synthetic fun requestResultBy (Llove/forte/simbot/kook/api/KookApi;Llove/forte/simbot/component/kook/bot/KookBot;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static final fun requestResultByAsync (Llove/forte/simbot/kook/api/KookApi;Llove/forte/simbot/component/kook/bot/KookBot;)Ljava/util/concurrent/CompletableFuture; + public static final fun requestResultByBlocking (Llove/forte/simbot/kook/api/KookApi;Llove/forte/simbot/component/kook/bot/KookBot;)Llove/forte/simbot/kook/api/ApiResult; + public static final fun requestResultByReserve (Llove/forte/simbot/kook/api/KookApi;Llove/forte/simbot/component/kook/bot/KookBot;)Llove/forte/simbot/suspendrunner/reserve/SuspendReserve; + public static final fun requestResultReserve (Llove/forte/simbot/component/kook/bot/KookBot;Llove/forte/simbot/kook/api/KookApi;)Llove/forte/simbot/suspendrunner/reserve/SuspendReserve; public static final synthetic fun requestText (Llove/forte/simbot/component/kook/bot/KookBot;Llove/forte/simbot/kook/api/KookApi;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static final fun requestTextAsync (Llove/forte/simbot/component/kook/bot/KookBot;Llove/forte/simbot/kook/api/KookApi;)Ljava/util/concurrent/CompletableFuture; + public static final fun requestTextBlocking (Llove/forte/simbot/component/kook/bot/KookBot;Llove/forte/simbot/kook/api/KookApi;)Ljava/lang/String; public static final synthetic fun requestTextBy (Llove/forte/simbot/kook/api/KookApi;Llove/forte/simbot/component/kook/bot/KookBot;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static final fun requestTextByAsync (Llove/forte/simbot/kook/api/KookApi;Llove/forte/simbot/component/kook/bot/KookBot;)Ljava/util/concurrent/CompletableFuture; + public static final fun requestTextByBlocking (Llove/forte/simbot/kook/api/KookApi;Llove/forte/simbot/component/kook/bot/KookBot;)Ljava/lang/String; + public static final fun requestTextByReserve (Llove/forte/simbot/kook/api/KookApi;Llove/forte/simbot/component/kook/bot/KookBot;)Llove/forte/simbot/suspendrunner/reserve/SuspendReserve; + public static final fun requestTextReserve (Llove/forte/simbot/component/kook/bot/KookBot;Llove/forte/simbot/kook/api/KookApi;)Llove/forte/simbot/suspendrunner/reserve/SuspendReserve; } public final class love/forte/simbot/component/kook/util/RegexWalkerKt { diff --git a/simbot-component-kook-core/src/jvmMain/kotlin/love/forte/simbot/component/kook/util/BotRequests.jvm.kt b/simbot-component-kook-core/src/jvmMain/kotlin/love/forte/simbot/component/kook/util/BotRequests.jvm.kt index 57a8e113..c6c13cc2 100644 --- a/simbot-component-kook-core/src/jvmMain/kotlin/love/forte/simbot/component/kook/util/BotRequests.jvm.kt +++ b/simbot-component-kook-core/src/jvmMain/kotlin/love/forte/simbot/component/kook/util/BotRequests.jvm.kt @@ -39,6 +39,7 @@ import java.util.concurrent.CompletableFuture /** * 使用 [KookBot] 对 [api] 发起请求。 * @see KookBot.request + * @since 4.1.1 */ @Api4J public fun KookBot.requestBlocking(api: KookApi<*>): HttpResponse = @@ -47,6 +48,7 @@ public fun KookBot.requestBlocking(api: KookApi<*>): HttpResponse = /** * 使用 [KookBot] 对 [api] 发起请求。 * @see KookBot.request + * @since 4.1.1 */ @Api4J @OptIn(InternalSimbotAPI::class) @@ -56,6 +58,7 @@ public fun KookBot.requestAsync(api: KookApi<*>): CompletableFuture): SuspendReserve /** * 使用 [KookBot] 对 [api] 发起请求。 * @see KookBot.requestData + * @since 4.1.1 */ @Api4J public fun KookBot.requestDataBlocking(api: KookApi): T = @@ -73,6 +77,7 @@ public fun KookBot.requestDataBlocking(api: KookApi): T = /** * 使用 [KookBot] 对 [api] 发起请求。 * @see KookBot.requestData + * @since 4.1.1 */ @Api4J @OptIn(InternalSimbotAPI::class) @@ -82,6 +87,7 @@ public fun KookBot.requestDataAsync(api: KookApi): CompletableFutur /** * 使用 [KookBot] 对 [api] 发起请求。 * @see KookBot.requestData + * @since 4.1.1 */ @Api4J @OptIn(InternalSimbotAPI::class) @@ -91,6 +97,7 @@ public fun KookBot.requestDataReserve(api: KookApi): SuspendReserve /** * 使用 [KookBot] 对 [api] 发起请求。 * @see KookBot.requestText + * @since 4.1.1 */ @Api4J public fun KookBot.requestTextBlocking(api: KookApi<*>): String = @@ -99,6 +106,7 @@ public fun KookBot.requestTextBlocking(api: KookApi<*>): String = /** * 使用 [KookBot] 对 [api] 发起请求。 * @see KookBot.requestText + * @since 4.1.1 */ @Api4J @OptIn(InternalSimbotAPI::class) @@ -108,6 +116,7 @@ public fun KookBot.requestTextAsync(api: KookApi<*>): CompletableFuture): SuspendReserve = /** * 使用 [KookBot] 对 [api] 发起请求。 * @see KookBot.requestResult + * @since 4.1.1 */ @Api4J public fun KookBot.requestResultBlocking(api: KookApi<*>): ApiResult = @@ -125,6 +135,7 @@ public fun KookBot.requestResultBlocking(api: KookApi<*>): ApiResult = /** * 使用 [KookBot] 对 [api] 发起请求。 * @see KookBot.requestResult + * @since 4.1.1 */ @Api4J @OptIn(InternalSimbotAPI::class) @@ -134,6 +145,7 @@ public fun KookBot.requestResultAsync(api: KookApi<*>): CompletableFuture): SuspendReserve.requestByBlocking(bot: KookBot): HttpResponse = @@ -153,6 +166,7 @@ public fun KookApi<*>.requestByBlocking(bot: KookBot): HttpResponse = /** * 使用 [KookApi] 通过 [bot] 发起请求。 * @see KookApi.requestBy + * @since 4.1.1 */ @Api4J @OptIn(InternalSimbotAPI::class) @@ -162,6 +176,7 @@ public fun KookApi<*>.requestByAsync(bot: KookBot): CompletableFuture.requestByReserve(bot: KookBot): SuspendReserve KookApi.requestDataByBlocking(bot: KookBot): T = @@ -179,6 +195,7 @@ public fun KookApi.requestDataByBlocking(bot: KookBot): T = /** * 使用 [KookApi] 通过 [bot] 发起请求。 * @see KookApi.requestDataBy + * @since 4.1.1 */ @Api4J @OptIn(InternalSimbotAPI::class) @@ -188,6 +205,7 @@ public fun KookApi.requestDataByAsync(bot: KookBot): CompletableFut /** * 使用 [KookApi] 通过 [bot] 发起请求。 * @see KookApi.requestDataBy + * @since 4.1.1 */ @Api4J @OptIn(InternalSimbotAPI::class) @@ -197,6 +215,7 @@ public fun KookApi.requestDataByReserve(bot: KookBot): SuspendReser /** * 使用 [KookApi] 通过 [bot] 发起请求。 * @see KookApi.requestTextBy + * @since 4.1.1 */ @Api4J public fun KookApi<*>.requestTextByBlocking(bot: KookBot): String = @@ -205,6 +224,7 @@ public fun KookApi<*>.requestTextByBlocking(bot: KookBot): String = /** * 使用 [KookApi] 通过 [bot] 发起请求。 * @see KookApi.requestTextBy + * @since 4.1.1 */ @Api4J @OptIn(InternalSimbotAPI::class) @@ -214,6 +234,7 @@ public fun KookApi<*>.requestTextByAsync(bot: KookBot): CompletableFuture.requestTextByReserve(bot: KookBot): SuspendReserve /** * 使用 [KookApi] 通过 [bot] 发起请求。 * @see KookApi.requestResultBy + * @since 4.1.1 */ @Api4J public fun KookApi<*>.requestResultByBlocking(bot: KookBot): ApiResult = @@ -231,6 +253,7 @@ public fun KookApi<*>.requestResultByBlocking(bot: KookBot): ApiResult = /** * 使用 [KookApi] 通过 [bot] 发起请求。 * @see KookApi.requestResultBy + * @since 4.1.1 */ @Api4J @OptIn(InternalSimbotAPI::class) @@ -240,6 +263,7 @@ public fun KookApi<*>.requestResultByAsync(bot: KookBot): CompletableFuture.requestByBlocking(bot: Bot): HttpResponse = @@ -45,6 +46,7 @@ public fun KookApi<*>.requestByBlocking(bot: Bot): HttpResponse = /** * 使用 [Bot] 向 [KookApi] 发起请求。 * @see KookApi.requestBy + * @since 4.1.1 */ @Api4J @OptIn(InternalSimbotAPI::class) @@ -54,6 +56,7 @@ public fun KookApi<*>.requestByAsync(bot: Bot): CompletableFuture.requestByReserve(bot: Bot): SuspendReserve = /** * 使用 [Bot] 向 [KookApi] 发起请求。 * @see KookApi.requestTextBy + * @since 4.1.1 */ @Api4J public fun KookApi<*>.requestTextByBlocking(bot: Bot): String = @@ -71,6 +75,7 @@ public fun KookApi<*>.requestTextByBlocking(bot: Bot): String = /** * 使用 [Bot] 向 [KookApi] 发起请求。 * @see KookApi.requestTextBy + * @since 4.1.1 */ @Api4J @OptIn(InternalSimbotAPI::class) @@ -80,6 +85,7 @@ public fun KookApi<*>.requestTextByAsync(bot: Bot): CompletableFuture.requestTextByReserve(bot: Bot): SuspendReserve = /** * 使用 [Bot] 向 [KookApi] 发起请求。 * @see KookApi.requestResultBy + * @since 4.1.1 */ @Api4J public fun KookApi<*>.requestResultByBlocking(bot: Bot): ApiResult = @@ -97,6 +104,7 @@ public fun KookApi<*>.requestResultByBlocking(bot: Bot): ApiResult = /** * 使用 [Bot] 向 [KookApi] 发起请求。 * @see KookApi.requestResultBy + * @since 4.1.1 */ @Api4J @OptIn(InternalSimbotAPI::class) @@ -106,6 +114,7 @@ public fun KookApi<*>.requestResultByAsync(bot: Bot): CompletableFuture.requestResultByReserve(bot: Bot): SuspendReserve KookApi.requestDataByBlocking(bot: Bot): T = @@ -123,6 +133,7 @@ public fun KookApi.requestDataByBlocking(bot: Bot): T = /** * 使用 [Bot] 向 [KookApi] 发起请求。 * @see KookApi.requestDataBy + * @since 4.1.1 */ @Api4J @OptIn(InternalSimbotAPI::class) @@ -132,6 +143,7 @@ public fun KookApi.requestDataByAsync(bot: Bot): CompletableFuture< /** * 使用 [Bot] 向 [KookApi] 发起请求。 * @see KookApi.requestDataBy + * @since 4.1.1 */ @Api4J @OptIn(InternalSimbotAPI::class) From 41b5e2a492064ff30f3a45dae5716b788add9390 Mon Sep 17 00:00:00 2001 From: ForteScarlet Date: Mon, 5 May 2025 02:43:38 +0800 Subject: [PATCH 6/6] release: v4.1.1 --- .changelog/v4.1.1.md | 6 ++++++ CHANGELOG.md | 6 ++++++ buildSrc/src/main/kotlin/P.kt | 2 +- .../main/kotlin/simbot-kook-changelog-generator.gradle.kts | 2 +- 4 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 .changelog/v4.1.1.md diff --git a/.changelog/v4.1.1.md b/.changelog/v4.1.1.md new file mode 100644 index 00000000..a93108e2 --- /dev/null +++ b/.changelog/v4.1.1.md @@ -0,0 +1,6 @@ +| 依赖 | 版本 | +| ---: | :--- | +| Kotlin | **v2.1.20** | +| simbot核心库 | [**v4.12.0**](https://github.com/simple-robot/simpler-robot/releases/tag/v4.12.0) | + +我们欢迎并期望着您的 [反馈](https://github.com/simple-robot/simbot-component-kook/issues) 或 [协助](https://github.com/simple-robot/simbot-component-kook/pulls),感谢您的贡献与支持! diff --git a/CHANGELOG.md b/CHANGELOG.md index 2424f95f..cc8a933a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# v4.1.1 + +> Release & Pull Notes: [v4.1.1](https://github.com/simple-robot/simpler-robot/releases/tag/v4.1.1) + +- fix(api): Fix api path of CreateInviteApi ([`796261a`](https://github.com/simple-robot/simpler-robot/commit/796261a)) + # v4.1.0 > Release & Pull Notes: [v4.1.0](https://github.com/simple-robot/simpler-robot/releases/tag/v4.1.0) diff --git a/buildSrc/src/main/kotlin/P.kt b/buildSrc/src/main/kotlin/P.kt index efcd8c3a..eadb78ae 100644 --- a/buildSrc/src/main/kotlin/P.kt +++ b/buildSrc/src/main/kotlin/P.kt @@ -33,7 +33,7 @@ object P : ProjectDetail() { get() = HOMEPAGE const val VERSION = "4.1.1" - const val NEXT_VERSION = "4.1.1" + const val NEXT_VERSION = "4.1.2" override val snapshotVersion = "$NEXT_VERSION-SNAPSHOT" override val version = if (isSnapshot()) snapshotVersion else VERSION diff --git a/buildSrc/src/main/kotlin/simbot-kook-changelog-generator.gradle.kts b/buildSrc/src/main/kotlin/simbot-kook-changelog-generator.gradle.kts index 2f702942..4e704f24 100644 --- a/buildSrc/src/main/kotlin/simbot-kook-changelog-generator.gradle.kts +++ b/buildSrc/src/main/kotlin/simbot-kook-changelog-generator.gradle.kts @@ -21,7 +21,7 @@ import changelog.generateChangelog -tasks.create("createChangelog") { +tasks.register("createChangelog") { group = "documentation" doFirst { generateChangelog("v${P.version}")