Skip to content

Commit bed436e

Browse files
committed
build: 1.2.9
1 parent c7c92c3 commit bed436e

File tree

4 files changed

+29
-19
lines changed

4 files changed

+29
-19
lines changed

build.gradle.kts

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
plugins {
2-
kotlin("jvm") version "1.7.10"
3-
kotlin("plugin.serialization") version "1.7.10"
2+
kotlin("jvm") version "1.7.20"
3+
kotlin("plugin.serialization") version "1.7.20"
44

5-
id("net.mamoe.mirai-console") version "2.13.0-M1"
5+
id("net.mamoe.mirai-console") version "2.13.0-RC"
66
id("me.him188.maven-central-publish") version "1.0.0-dev-3"
77
}
88

99
group = "xyz.cssxsh.mirai"
10-
version = "1.2.8"
10+
version = "1.2.9"
1111

1212
mavenCentralPublish {
1313
useCentralS01()
1414
singleDevGithubProject("cssxsh", "mirai-administrator")
1515
licenseFromGitHubProject("AGPL-3.0")
1616
workingDir = System.getenv("PUBLICATION_TEMP")?.let { file(it).resolve(projectName) }
17-
?: project.buildDir.resolve("publishing-tmp")
17+
?: buildDir.resolve("publishing-tmp")
1818
publication {
19-
artifact(tasks.getByName("buildPlugin"))
19+
artifact(tasks["buildPlugin"])
2020
}
2121
}
2222

@@ -26,19 +26,19 @@ repositories {
2626
}
2727

2828
dependencies {
29-
compileOnly("net.mamoe:mirai-core:2.13.0-M1")
30-
compileOnly("net.mamoe:mirai-core-utils:2.13.0-M1")
29+
compileOnly("net.mamoe:mirai-core:2.13.0-RC")
30+
compileOnly("net.mamoe:mirai-core-utils:2.13.0-RC")
3131
api("com.cronutils:cron-utils:9.2.0") {
3232
exclude("org.slf4j")
3333
exclude("org.glassfish")
3434
exclude("org.javassist")
3535
}
36-
implementation("io.ktor:ktor-client-okhttp:2.1.0") {
36+
implementation("io.ktor:ktor-client-okhttp:2.1.2") {
3737
exclude(group = "org.jetbrains.kotlin")
3838
exclude(group = "org.jetbrains.kotlinx")
3939
exclude(group = "org.slf4j")
4040
}
41-
implementation("io.ktor:ktor-client-encoding:2.1.0") {
41+
implementation("io.ktor:ktor-client-encoding:2.1.2") {
4242
exclude(group = "org.jetbrains.kotlin")
4343
exclude(group = "org.jetbrains.kotlinx")
4444
exclude(group = "org.slf4j")
@@ -51,8 +51,8 @@ dependencies {
5151
compileOnly("javax.validation:validation-api:2.0.1.Final")
5252

5353
testImplementation(kotlin("test"))
54-
testImplementation("org.slf4j:slf4j-simple:2.0.0")
55-
testImplementation("net.mamoe:mirai-logging-slf4j:2.13.0-M1")
54+
testImplementation("org.slf4j:slf4j-simple:2.0.3")
55+
testImplementation("net.mamoe:mirai-logging-slf4j:2.13.0-RC")
5656
}
5757

5858
kotlin {

src/main/kotlin/xyz/cssxsh/mirai/admin/MiraiAdminPlugin.kt

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package xyz.cssxsh.mirai.admin
22

3+
import kotlinx.coroutines.*
34
import net.mamoe.mirai.console.*
45
import net.mamoe.mirai.console.command.CommandManager.INSTANCE.register
56
import net.mamoe.mirai.console.command.CommandManager.INSTANCE.unregister
@@ -16,7 +17,7 @@ public object MiraiAdminPlugin : KotlinPlugin(
1617
JvmPluginDescription(
1718
id = "xyz.cssxsh.mirai.plugin.mirai-administrator",
1819
name = "mirai-administrator",
19-
version = "1.2.8",
20+
version = "1.2.9",
2021
) {
2122
author("cssxsh")
2223
}
@@ -76,8 +77,8 @@ public object MiraiAdminPlugin : KotlinPlugin(
7677
AdminSendCommand.unregister()
7778
AdminTimerCommand.unregister()
7879

79-
MiraiAdministrator.cancelAll()
80-
MiraiMessageRecorder.cancelAll()
80+
MiraiAdministrator.cancel()
81+
MiraiMessageRecorder.cancel()
8182

8283
AdminCommentConfig.save()
8384
}

src/main/kotlin/xyz/cssxsh/mirai/admin/command/AdminContactCommand.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public object AdminContactCommand : CompositeCommand(
6868
@Description("拉黑")
6969
public suspend fun CommandSender.black(vararg ids: String) {
7070
val message = try {
71-
val args = ids.map(AbstractPermitteeId::parseFromString)
71+
val args = ids.mapTo(HashSet(), AbstractPermitteeId::parseFromString)
7272
AdminBlackListData.ids.addAll(args)
7373
AdminBlackListData.ids.joinToString("\n") { it.asString() }
7474
} catch (cause: Exception) {
@@ -83,7 +83,7 @@ public object AdminContactCommand : CompositeCommand(
8383
@Description("取消拉黑")
8484
public suspend fun CommandSender.white(vararg ids: String) {
8585
val message = try {
86-
val args = ids.map(AbstractPermitteeId::parseFromString)
86+
val args = ids.mapTo(HashSet(), AbstractPermitteeId::parseFromString)
8787
AdminBlackListData.ids.removeAll(args)
8888
AdminBlackListData.ids.joinToString("\n") { it.asString() }
8989
} catch (cause: Exception) {

src/main/kotlin/xyz/cssxsh/mirai/admin/command/AdminFriendCommand.kt

+11-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,17 @@ public object AdminFriendCommand : CompositeCommand(
1919
buildString {
2020
for (bot in Bot.instances) {
2121
appendLine("--- ${bot.render()} ---")
22-
for (friend in bot.friends) {
23-
appendLine(friend.render())
22+
try {
23+
for (friendGroup in bot.friendGroups.asCollection()) {
24+
appendLine("### ${friendGroup.name} ###")
25+
for (friend in friendGroup.friends) {
26+
appendLine(friend.render())
27+
}
28+
}
29+
} catch (_: ExceptionInInitializerError) {
30+
for (friend in bot.friends) {
31+
appendLine(friend.render())
32+
}
2433
}
2534
}
2635
}

0 commit comments

Comments
 (0)