-
-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2c95254
commit 48aec73
Showing
28 changed files
with
109 additions
and
165 deletions.
There are no files selected for viewing
This file contains 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 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
105 changes: 55 additions & 50 deletions
105
...ponent-kaiheila-parent/kaiheila-api-v3/src/test/java/love/test/channel/ChannelListTest.kt
This file contains 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 |
---|---|---|
@@ -1,50 +1,55 @@ | ||
// /* | ||
// * | ||
// * * Copyright (c) 2021. ForteScarlet All rights reserved. | ||
// * * Project simple-robot | ||
// * * File MiraiAvatar.kt | ||
// * * | ||
// * * You can contact the author through the following channels: | ||
// * * github https://github.com/ForteScarlet | ||
// * * gitee https://gitee.com/ForteScarlet | ||
// * * email [email protected] | ||
// * * QQ 1149159218 | ||
// * | ||
// */ | ||
// | ||
// package love.test.channel | ||
// | ||
// import kotlinx.coroutines.runBlocking | ||
// import love.forte.simbot.kaiheila.api.doRequest | ||
// import love.forte.simbot.kaiheila.api.v3.V3 | ||
// import love.forte.simbot.kaiheila.api.v3.channel.ChannelListReq | ||
// import love.test.GatewayApiConstant | ||
// import love.test.client | ||
// import kotlin.test.Test | ||
// | ||
// | ||
// /** | ||
// * | ||
// * @author ForteScarlet | ||
// */ | ||
// class ChannelListTest { | ||
// | ||
// | ||
// @Test | ||
// fun listTest() = runBlocking { | ||
// val guildId = "6865507942900765" // GuildApiTest().guildList().items[0].id | ||
// | ||
// val data = ChannelListReq(guildId).doRequest(V3, client, GatewayApiConstant.token).data | ||
// | ||
// println(data) | ||
// | ||
// println("-0-") | ||
// | ||
// data.forEach { | ||
// println(it) | ||
// } | ||
// | ||
// | ||
// } | ||
// | ||
// } | ||
/* | ||
* | ||
* * Copyright (c) 2021. ForteScarlet All rights reserved. | ||
* * Project simple-robot | ||
* * File MiraiAvatar.kt | ||
* * | ||
* * You can contact the author through the following channels: | ||
* * github https://github.com/ForteScarlet | ||
* * gitee https://gitee.com/ForteScarlet | ||
* * email [email protected] | ||
* * QQ 1149159218 | ||
* | ||
*/ | ||
|
||
package love.test.channel | ||
|
||
import io.ktor.client.* | ||
import kotlinx.coroutines.runBlocking | ||
import love.forte.simbot.kaiheila.api.ApiData | ||
import love.forte.simbot.kaiheila.api.ListResp | ||
import love.forte.simbot.kaiheila.api.doRequest | ||
import love.forte.simbot.kaiheila.api.v3.V3 | ||
import love.forte.simbot.kaiheila.api.v3.channel.ChannelInfo | ||
import love.forte.simbot.kaiheila.api.v3.channel.ChannelListReq | ||
import kotlin.test.Test | ||
|
||
|
||
/** | ||
* | ||
* @author ForteScarlet | ||
*/ | ||
class ChannelListTest { | ||
|
||
|
||
@Test | ||
fun listTest() = runBlocking { | ||
val guildId = "6865507942900765" // GuildApiTest().guildList().items[0].id | ||
|
||
val client = HttpClient() // ktor client | ||
val token = "token" | ||
|
||
val data: ListResp<ChannelInfo, ApiData.Resp.EmptySort> = ChannelListReq(guildId).doRequest(V3, client, token) | ||
|
||
println(data) | ||
|
||
println("-0-") | ||
|
||
data.forEach { it: ChannelInfo -> | ||
println(it) | ||
} | ||
|
||
|
||
} | ||
|
||
} |
This file contains 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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
Oops, something went wrong.