Skip to content

Commit 9f9d601

Browse files
authored
Merge pull request #241 from simple-robot/dev/main
Release: v4.1.1
2 parents b84992b + 41b5e2a commit 9f9d601

File tree

10 files changed

+477
-11
lines changed

10 files changed

+477
-11
lines changed

.changelog/v4.1.1.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
| 依赖 | 版本 |
2+
| ---: | :--- |
3+
| Kotlin | **v2.1.20** |
4+
| simbot核心库 | [**v4.12.0**](https://github.com/simple-robot/simpler-robot/releases/tag/v4.12.0) |
5+
6+
我们欢迎并期望着您的 [反馈](https://github.com/simple-robot/simbot-component-kook/issues)[协助](https://github.com/simple-robot/simbot-component-kook/pulls),感谢您的贡献与支持!

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# v4.1.1
2+
3+
> Release & Pull Notes: [v4.1.1](https://github.com/simple-robot/simpler-robot/releases/tag/v4.1.1)
4+
5+
- fix(api): Fix api path of CreateInviteApi ([`796261a`](https://github.com/simple-robot/simpler-robot/commit/796261a))
6+
17
# v4.1.0
28

39
> Release & Pull Notes: [v4.1.0](https://github.com/simple-robot/simpler-robot/releases/tag/v4.1.0)

buildSrc/src/main/kotlin/P.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ object P : ProjectDetail() {
3232
override val homepage: String
3333
get() = HOMEPAGE
3434

35-
const val VERSION = "4.1.0"
36-
const val NEXT_VERSION = "4.1.1"
35+
const val VERSION = "4.1.1"
36+
const val NEXT_VERSION = "4.1.2"
3737

3838
override val snapshotVersion = "$NEXT_VERSION-SNAPSHOT"
3939
override val version = if (isSnapshot()) snapshotVersion else VERSION

buildSrc/src/main/kotlin/simbot-kook-changelog-generator.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import changelog.generateChangelog
2222

2323

24-
tasks.create("createChangelog") {
24+
tasks.register("createChangelog") {
2525
group = "documentation"
2626
doFirst {
2727
generateChangelog("v${P.version}")

simbot-component-kook-api/src/commonMain/kotlin/love/forte/simbot/kook/api/invite/CreateInviteApi.kt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,7 @@ public class CreateInviteApi private constructor(
3838
) : KookPostApi<CreatedInvite>() {
3939
public companion object Factory {
4040
// /api/v3/invite/create POST
41-
private val PATH = ApiPath.create("invite", "list")
42-
43-
// TODO Empty CreateInviteApi
44-
private val EMPTY = CreateInviteApi()
41+
private val PATH = ApiPath.create("invite", "create")
4542

4643
/**
4744
* 通过 [服务器id][guildId] 构建一个 [创建邀请链接][CreateInviteApi] 实例。

simbot-component-kook-core/api/simbot-component-kook-core.api

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1346,8 +1346,6 @@ public final class love/forte/simbot/component/kook/message/KookCardMessage$Comp
13461346

13471347
public final class love/forte/simbot/component/kook/message/KookChannelMessageDetailsContent : love/forte/simbot/component/kook/message/KookMessageContent {
13481348
public static final field Companion Llove/forte/simbot/component/kook/message/KookChannelMessageDetailsContent$Companion;
1349-
public final fun copy (Llove/forte/simbot/kook/messages/ChannelMessageDetails;Llove/forte/simbot/component/kook/bot/KookBot;)Llove/forte/simbot/component/kook/message/KookChannelMessageDetailsContent;
1350-
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;
13511349
public synthetic fun delete ([Llove/forte/simbot/ability/DeleteOption;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
13521350
public fun equals (Ljava/lang/Object;)Z
13531351
public fun getId ()Llove/forte/simbot/common/id/ID;
@@ -1444,8 +1442,6 @@ public final class love/forte/simbot/component/kook/message/KookMessagesTransfor
14441442
public final class love/forte/simbot/component/kook/message/KookQuote : love/forte/simbot/message/MessageReference {
14451443
public static final field Companion Llove/forte/simbot/component/kook/message/KookQuote$Companion;
14461444
public final fun component1 ()Llove/forte/simbot/kook/objects/Quote;
1447-
public final fun copy (Llove/forte/simbot/kook/objects/Quote;)Llove/forte/simbot/component/kook/message/KookQuote;
1448-
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;
14491445
public static final fun create (Llove/forte/simbot/kook/objects/Quote;)Llove/forte/simbot/component/kook/message/KookQuote;
14501446
public fun equals (Ljava/lang/Object;)Z
14511447
public fun getId ()Llove/forte/simbot/common/id/ID;
@@ -1533,13 +1529,37 @@ public abstract interface class love/forte/simbot/component/kook/role/KookRoleOp
15331529

15341530
public final class love/forte/simbot/component/kook/util/KookBotRequests {
15351531
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;
1532+
public static final fun requestAsync (Llove/forte/simbot/component/kook/bot/KookBot;Llove/forte/simbot/kook/api/KookApi;)Ljava/util/concurrent/CompletableFuture;
1533+
public static final fun requestBlocking (Llove/forte/simbot/component/kook/bot/KookBot;Llove/forte/simbot/kook/api/KookApi;)Lio/ktor/client/statement/HttpResponse;
15361534
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;
1535+
public static final fun requestByAsync (Llove/forte/simbot/kook/api/KookApi;Llove/forte/simbot/component/kook/bot/KookBot;)Ljava/util/concurrent/CompletableFuture;
1536+
public static final fun requestByBlocking (Llove/forte/simbot/kook/api/KookApi;Llove/forte/simbot/component/kook/bot/KookBot;)Lio/ktor/client/statement/HttpResponse;
1537+
public static final fun requestByReserve (Llove/forte/simbot/kook/api/KookApi;Llove/forte/simbot/component/kook/bot/KookBot;)Llove/forte/simbot/suspendrunner/reserve/SuspendReserve;
15371538
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;
1539+
public static final fun requestDataAsync (Llove/forte/simbot/component/kook/bot/KookBot;Llove/forte/simbot/kook/api/KookApi;)Ljava/util/concurrent/CompletableFuture;
1540+
public static final fun requestDataBlocking (Llove/forte/simbot/component/kook/bot/KookBot;Llove/forte/simbot/kook/api/KookApi;)Ljava/lang/Object;
15381541
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;
1542+
public static final fun requestDataByAsync (Llove/forte/simbot/kook/api/KookApi;Llove/forte/simbot/component/kook/bot/KookBot;)Ljava/util/concurrent/CompletableFuture;
1543+
public static final fun requestDataByBlocking (Llove/forte/simbot/kook/api/KookApi;Llove/forte/simbot/component/kook/bot/KookBot;)Ljava/lang/Object;
1544+
public static final fun requestDataByReserve (Llove/forte/simbot/kook/api/KookApi;Llove/forte/simbot/component/kook/bot/KookBot;)Llove/forte/simbot/suspendrunner/reserve/SuspendReserve;
1545+
public static final fun requestDataReserve (Llove/forte/simbot/component/kook/bot/KookBot;Llove/forte/simbot/kook/api/KookApi;)Llove/forte/simbot/suspendrunner/reserve/SuspendReserve;
1546+
public static final fun requestReserve (Llove/forte/simbot/component/kook/bot/KookBot;Llove/forte/simbot/kook/api/KookApi;)Llove/forte/simbot/suspendrunner/reserve/SuspendReserve;
15391547
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;
1548+
public static final fun requestResultAsync (Llove/forte/simbot/component/kook/bot/KookBot;Llove/forte/simbot/kook/api/KookApi;)Ljava/util/concurrent/CompletableFuture;
1549+
public static final fun requestResultBlocking (Llove/forte/simbot/component/kook/bot/KookBot;Llove/forte/simbot/kook/api/KookApi;)Llove/forte/simbot/kook/api/ApiResult;
15401550
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;
1551+
public static final fun requestResultByAsync (Llove/forte/simbot/kook/api/KookApi;Llove/forte/simbot/component/kook/bot/KookBot;)Ljava/util/concurrent/CompletableFuture;
1552+
public static final fun requestResultByBlocking (Llove/forte/simbot/kook/api/KookApi;Llove/forte/simbot/component/kook/bot/KookBot;)Llove/forte/simbot/kook/api/ApiResult;
1553+
public static final fun requestResultByReserve (Llove/forte/simbot/kook/api/KookApi;Llove/forte/simbot/component/kook/bot/KookBot;)Llove/forte/simbot/suspendrunner/reserve/SuspendReserve;
1554+
public static final fun requestResultReserve (Llove/forte/simbot/component/kook/bot/KookBot;Llove/forte/simbot/kook/api/KookApi;)Llove/forte/simbot/suspendrunner/reserve/SuspendReserve;
15411555
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;
1556+
public static final fun requestTextAsync (Llove/forte/simbot/component/kook/bot/KookBot;Llove/forte/simbot/kook/api/KookApi;)Ljava/util/concurrent/CompletableFuture;
1557+
public static final fun requestTextBlocking (Llove/forte/simbot/component/kook/bot/KookBot;Llove/forte/simbot/kook/api/KookApi;)Ljava/lang/String;
15421558
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;
1559+
public static final fun requestTextByAsync (Llove/forte/simbot/kook/api/KookApi;Llove/forte/simbot/component/kook/bot/KookBot;)Ljava/util/concurrent/CompletableFuture;
1560+
public static final fun requestTextByBlocking (Llove/forte/simbot/kook/api/KookApi;Llove/forte/simbot/component/kook/bot/KookBot;)Ljava/lang/String;
1561+
public static final fun requestTextByReserve (Llove/forte/simbot/kook/api/KookApi;Llove/forte/simbot/component/kook/bot/KookBot;)Llove/forte/simbot/suspendrunner/reserve/SuspendReserve;
1562+
public static final fun requestTextReserve (Llove/forte/simbot/component/kook/bot/KookBot;Llove/forte/simbot/kook/api/KookApi;)Llove/forte/simbot/suspendrunner/reserve/SuspendReserve;
15431563
}
15441564

15451565
public final class love/forte/simbot/component/kook/util/RegexWalkerKt {

simbot-component-kook-core/src/commonMain/kotlin/love/forte/simbot/component/kook/util/BotRequests.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
* If not, see <https://www.gnu.org/licenses/>.
1919
*/
2020
@file:JvmName("KookBotRequests")
21+
@file:JvmMultifileClass
2122

2223
package love.forte.simbot.component.kook.util
2324

@@ -30,6 +31,7 @@ import love.forte.simbot.kook.stdlib.requestBy
3031
import love.forte.simbot.kook.stdlib.requestDataBy
3132
import love.forte.simbot.kook.stdlib.requestResultBy
3233
import love.forte.simbot.kook.stdlib.requestTextBy
34+
import kotlin.jvm.JvmMultifileClass
3335
import kotlin.jvm.JvmName
3436
import kotlin.jvm.JvmSynthetic
3537

Lines changed: 272 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,272 @@
1+
/*
2+
* Copyright (c) 2025. ForteScarlet.
3+
*
4+
* This file is part of simbot-component-kook.
5+
*
6+
* simbot-component-kook is free software: you can redistribute it and/or modify
7+
* it under the terms of the GNU Lesser General Public License as published by
8+
* the Free Software Foundation, either version 3 of the License, or
9+
* (at your option) any later version.
10+
*
11+
* simbot-component-kook is distributed in the hope that it will be useful,
12+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
* GNU Lesser General Public License for more details.
15+
*
16+
* You should have received a copy of the GNU Lesser General Public License
17+
* along with simbot-component-kook,
18+
* If not, see <https://www.gnu.org/licenses/>.
19+
*/
20+
21+
@file:JvmName("KookBotRequests")
22+
@file:JvmMultifileClass
23+
24+
package love.forte.simbot.component.kook.util
25+
26+
import io.ktor.client.statement.*
27+
import love.forte.simbot.annotations.Api4J
28+
import love.forte.simbot.annotations.InternalSimbotAPI
29+
import love.forte.simbot.component.kook.bot.KookBot
30+
import love.forte.simbot.kook.api.ApiResult
31+
import love.forte.simbot.kook.api.KookApi
32+
import love.forte.simbot.suspendrunner.asReserve
33+
import love.forte.simbot.suspendrunner.reserve.SuspendReserve
34+
import love.forte.simbot.suspendrunner.runInAsync
35+
import love.forte.simbot.suspendrunner.runInNoScopeBlocking
36+
import java.util.concurrent.CompletableFuture
37+
38+
//region request
39+
/**
40+
* 使用 [KookBot] 对 [api] 发起请求。
41+
* @see KookBot.request
42+
* @since 4.1.1
43+
*/
44+
@Api4J
45+
public fun KookBot.requestBlocking(api: KookApi<*>): HttpResponse =
46+
runInNoScopeBlocking { request(api) }
47+
48+
/**
49+
* 使用 [KookBot] 对 [api] 发起请求。
50+
* @see KookBot.request
51+
* @since 4.1.1
52+
*/
53+
@Api4J
54+
@OptIn(InternalSimbotAPI::class)
55+
public fun KookBot.requestAsync(api: KookApi<*>): CompletableFuture<out HttpResponse> =
56+
runInAsync(scope = this) { request(api) }
57+
58+
/**
59+
* 使用 [KookBot] 对 [api] 发起请求。
60+
* @see KookBot.request
61+
* @since 4.1.1
62+
*/
63+
@Api4J
64+
@OptIn(InternalSimbotAPI::class)
65+
public fun KookBot.requestReserve(api: KookApi<*>): SuspendReserve<HttpResponse> =
66+
asReserve(scope = this) { request(api) }
67+
68+
/**
69+
* 使用 [KookBot] 对 [api] 发起请求。
70+
* @see KookBot.requestData
71+
* @since 4.1.1
72+
*/
73+
@Api4J
74+
public fun <T : Any> KookBot.requestDataBlocking(api: KookApi<T>): T =
75+
runInNoScopeBlocking { requestData(api) }
76+
77+
/**
78+
* 使用 [KookBot] 对 [api] 发起请求。
79+
* @see KookBot.requestData
80+
* @since 4.1.1
81+
*/
82+
@Api4J
83+
@OptIn(InternalSimbotAPI::class)
84+
public fun <T : Any> KookBot.requestDataAsync(api: KookApi<T>): CompletableFuture<out T> =
85+
runInAsync(scope = this) { requestData(api) }
86+
87+
/**
88+
* 使用 [KookBot] 对 [api] 发起请求。
89+
* @see KookBot.requestData
90+
* @since 4.1.1
91+
*/
92+
@Api4J
93+
@OptIn(InternalSimbotAPI::class)
94+
public fun <T : Any> KookBot.requestDataReserve(api: KookApi<T>): SuspendReserve<T> =
95+
asReserve(scope = this) { requestData(api) }
96+
97+
/**
98+
* 使用 [KookBot] 对 [api] 发起请求。
99+
* @see KookBot.requestText
100+
* @since 4.1.1
101+
*/
102+
@Api4J
103+
public fun KookBot.requestTextBlocking(api: KookApi<*>): String =
104+
runInNoScopeBlocking { requestText(api) }
105+
106+
/**
107+
* 使用 [KookBot] 对 [api] 发起请求。
108+
* @see KookBot.requestText
109+
* @since 4.1.1
110+
*/
111+
@Api4J
112+
@OptIn(InternalSimbotAPI::class)
113+
public fun KookBot.requestTextAsync(api: KookApi<*>): CompletableFuture<out String> =
114+
runInAsync(scope = this) { requestText(api) }
115+
116+
/**
117+
* 使用 [KookBot] 对 [api] 发起请求。
118+
* @see KookBot.requestText
119+
* @since 4.1.1
120+
*/
121+
@Api4J
122+
@OptIn(InternalSimbotAPI::class)
123+
public fun KookBot.requestTextReserve(api: KookApi<*>): SuspendReserve<String> =
124+
asReserve(scope = this) { requestText(api) }
125+
126+
/**
127+
* 使用 [KookBot] 对 [api] 发起请求。
128+
* @see KookBot.requestResult
129+
* @since 4.1.1
130+
*/
131+
@Api4J
132+
public fun KookBot.requestResultBlocking(api: KookApi<*>): ApiResult =
133+
runInNoScopeBlocking { requestResult(api) }
134+
135+
/**
136+
* 使用 [KookBot] 对 [api] 发起请求。
137+
* @see KookBot.requestResult
138+
* @since 4.1.1
139+
*/
140+
@Api4J
141+
@OptIn(InternalSimbotAPI::class)
142+
public fun KookBot.requestResultAsync(api: KookApi<*>): CompletableFuture<out ApiResult> =
143+
runInAsync(scope = this) { requestResult(api) }
144+
145+
/**
146+
* 使用 [KookBot] 对 [api] 发起请求。
147+
* @see KookBot.requestResult
148+
* @since 4.1.1
149+
*/
150+
@Api4J
151+
@OptIn(InternalSimbotAPI::class)
152+
public fun KookBot.requestResultReserve(api: KookApi<*>): SuspendReserve<ApiResult> =
153+
asReserve(scope = this) { requestResult(api) }
154+
//endregion
155+
156+
//region requestBy
157+
/**
158+
* 使用 [KookApi] 通过 [bot] 发起请求。
159+
* @see KookApi.requestBy
160+
* @since 4.1.1
161+
*/
162+
@Api4J
163+
public fun KookApi<*>.requestByBlocking(bot: KookBot): HttpResponse =
164+
runInNoScopeBlocking { requestBy(bot) }
165+
166+
/**
167+
* 使用 [KookApi] 通过 [bot] 发起请求。
168+
* @see KookApi.requestBy
169+
* @since 4.1.1
170+
*/
171+
@Api4J
172+
@OptIn(InternalSimbotAPI::class)
173+
public fun KookApi<*>.requestByAsync(bot: KookBot): CompletableFuture<out HttpResponse> =
174+
runInAsync(scope = bot) { requestBy(bot) }
175+
176+
/**
177+
* 使用 [KookApi] 通过 [bot] 发起请求。
178+
* @see KookApi.requestBy
179+
* @since 4.1.1
180+
*/
181+
@Api4J
182+
@OptIn(InternalSimbotAPI::class)
183+
public fun KookApi<*>.requestByReserve(bot: KookBot): SuspendReserve<HttpResponse> =
184+
asReserve(scope = bot) { requestBy(bot) }
185+
186+
/**
187+
* 使用 [KookApi] 通过 [bot] 发起请求。
188+
* @see KookApi.requestDataBy
189+
* @since 4.1.1
190+
*/
191+
@Api4J
192+
public fun <T : Any> KookApi<T>.requestDataByBlocking(bot: KookBot): T =
193+
runInNoScopeBlocking { requestDataBy(bot) }
194+
195+
/**
196+
* 使用 [KookApi] 通过 [bot] 发起请求。
197+
* @see KookApi.requestDataBy
198+
* @since 4.1.1
199+
*/
200+
@Api4J
201+
@OptIn(InternalSimbotAPI::class)
202+
public fun <T : Any> KookApi<T>.requestDataByAsync(bot: KookBot): CompletableFuture<out T> =
203+
runInAsync(scope = bot) { requestDataBy(bot) }
204+
205+
/**
206+
* 使用 [KookApi] 通过 [bot] 发起请求。
207+
* @see KookApi.requestDataBy
208+
* @since 4.1.1
209+
*/
210+
@Api4J
211+
@OptIn(InternalSimbotAPI::class)
212+
public fun <T : Any> KookApi<T>.requestDataByReserve(bot: KookBot): SuspendReserve<T> =
213+
asReserve(scope = bot) { requestDataBy(bot) }
214+
215+
/**
216+
* 使用 [KookApi] 通过 [bot] 发起请求。
217+
* @see KookApi.requestTextBy
218+
* @since 4.1.1
219+
*/
220+
@Api4J
221+
public fun KookApi<*>.requestTextByBlocking(bot: KookBot): String =
222+
runInNoScopeBlocking { requestTextBy(bot) }
223+
224+
/**
225+
* 使用 [KookApi] 通过 [bot] 发起请求。
226+
* @see KookApi.requestTextBy
227+
* @since 4.1.1
228+
*/
229+
@Api4J
230+
@OptIn(InternalSimbotAPI::class)
231+
public fun KookApi<*>.requestTextByAsync(bot: KookBot): CompletableFuture<out String> =
232+
runInAsync(scope = bot) { requestTextBy(bot) }
233+
234+
/**
235+
* 使用 [KookApi] 通过 [bot] 发起请求。
236+
* @see KookApi.requestTextBy
237+
* @since 4.1.1
238+
*/
239+
@Api4J
240+
@OptIn(InternalSimbotAPI::class)
241+
public fun KookApi<*>.requestTextByReserve(bot: KookBot): SuspendReserve<String> =
242+
asReserve(scope = bot) { requestTextBy(bot) }
243+
244+
/**
245+
* 使用 [KookApi] 通过 [bot] 发起请求。
246+
* @see KookApi.requestResultBy
247+
* @since 4.1.1
248+
*/
249+
@Api4J
250+
public fun KookApi<*>.requestResultByBlocking(bot: KookBot): ApiResult =
251+
runInNoScopeBlocking { requestResultBy(bot) }
252+
253+
/**
254+
* 使用 [KookApi] 通过 [bot] 发起请求。
255+
* @see KookApi.requestResultBy
256+
* @since 4.1.1
257+
*/
258+
@Api4J
259+
@OptIn(InternalSimbotAPI::class)
260+
public fun KookApi<*>.requestResultByAsync(bot: KookBot): CompletableFuture<out ApiResult> =
261+
runInAsync(scope = bot) { requestResultBy(bot) }
262+
263+
/**
264+
* 使用 [KookApi] 通过 [bot] 发起请求。
265+
* @see KookApi.requestResultBy
266+
* @since 4.1.1
267+
*/
268+
@Api4J
269+
@OptIn(InternalSimbotAPI::class)
270+
public fun KookApi<*>.requestResultByReserve(bot: KookBot): SuspendReserve<ApiResult> =
271+
asReserve(scope = bot) { requestResultBy(bot) }
272+
//endregion

0 commit comments

Comments
 (0)