Skip to content

Commit 3053c2c

Browse files
committed
build: 1.2.10
1 parent 43a7c9f commit 3053c2c

File tree

4 files changed

+20
-14
lines changed

4 files changed

+20
-14
lines changed

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ plugins {
77
}
88

99
group = "io.github.gnuf0rce"
10-
version = "1.2.9"
10+
version = "1.2.10"
1111

1212
mavenCentralPublish {
1313
useCentralS01()

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@
103103
答案:cssxsh
104104
```
105105

106-
机器人会检查 `cssxsh` 的活跃度是否满足要求,如满足要求则放行
106+
机器人会检查 <https://github.com/cssxsh> 的活跃度是否满足要求,如满足要求则放行
107107

108108
## 设置
109109

src/main/kotlin/io/github/gnuf0rce/mirai/github/GitHubHelperPlugin.kt

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public object GitHubHelperPlugin : KotlinPlugin(
2929
JvmPluginDescription(
3030
id = "io.github.gnuf0rce.github-helper",
3131
name = "github-helper",
32-
version = "1.2.9",
32+
version = "1.2.10",
3333
) {
3434
author("cssxsh")
3535

@@ -47,18 +47,24 @@ public object GitHubHelperPlugin : KotlinPlugin(
4747
}
4848
}
4949

50-
@Suppress("INVISIBLE_MEMBER")
51-
private inline fun <reified T : Any> spi(): Lazy<List<T>> = lazy {
52-
with(net.mamoe.mirai.console.internal.util.PluginServiceHelper) {
53-
jvmPluginClasspath.pluginClassLoader
54-
.findServices<T>()
55-
.loadAllServices()
50+
private inline fun <reified T : Any> spi(): Lazy<List<T>> {
51+
return try {
52+
services()
53+
} catch (_: NoSuchMethodError) {
54+
lazy {
55+
@Suppress("INVISIBLE_MEMBER")
56+
with(net.mamoe.mirai.console.internal.util.PluginServiceHelper) {
57+
jvmPluginClasspath.pluginClassLoader
58+
.findServices<T>()
59+
.loadAllServices()
60+
}
61+
}
5662
}
5763
}
5864

59-
private val commands: List<Command> by services()
60-
private val data: List<PluginData> by services()
61-
private val config: List<PluginConfig> by services()
65+
private val commands: List<Command> by spi()
66+
private val data: List<PluginData> by spi()
67+
private val config: List<PluginConfig> by spi()
6268

6369
override fun onEnable() {
6470
// XXX: mirai console version check

src/main/kotlin/io/github/gnuf0rce/mirai/github/data/GitHubConfig.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2021-2022 dsstudio Technologies and contributors.
2+
* Copyright 2021-2023 dsstudio Technologies and contributors.
33
*
44
* 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
55
* Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
@@ -23,7 +23,7 @@ public object GitHubConfig : ReadOnlyPluginConfig("GithubConfig") {
2323
public val doh: String by value("https://public.dns.iij.jp/dns-query")
2424

2525
@ValueName("ipv6")
26-
@ValueDescription("Dns Over Https Url")
26+
@ValueDescription("Dns Over Https IPv6")
2727
public val ipv6: Boolean by value(false)
2828

2929
@ValueName("github_token")

0 commit comments

Comments
 (0)