File tree Expand file tree Collapse file tree 4 files changed +20
-14
lines changed
src/main/kotlin/io/github/gnuf0rce/mirai/github Expand file tree Collapse file tree 4 files changed +20
-14
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ plugins {
7
7
}
8
8
9
9
group = " io.github.gnuf0rce"
10
- version = " 1.2.9 "
10
+ version = " 1.2.10 "
11
11
12
12
mavenCentralPublish {
13
13
useCentralS01()
Original file line number Diff line number Diff line change 103
103
答案:cssxsh
104
104
```
105
105
106
- 机器人会检查 ` cssxsh ` 的活跃度是否满足要求,如满足要求则放行
106
+ 机器人会检查 < https://github.com/ cssxsh> 的活跃度是否满足要求,如满足要求则放行
107
107
108
108
## 设置
109
109
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ public object GitHubHelperPlugin : KotlinPlugin(
29
29
JvmPluginDescription (
30
30
id = "io.github.gnuf0rce.github-helper",
31
31
name = "github-helper",
32
- version = "1.2.9 ",
32
+ version = "1.2.10 ",
33
33
) {
34
34
author("cssxsh")
35
35
@@ -47,18 +47,24 @@ public object GitHubHelperPlugin : KotlinPlugin(
47
47
}
48
48
}
49
49
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
+ }
56
62
}
57
63
}
58
64
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 ()
62
68
63
69
override fun onEnable () {
64
70
// XXX: mirai console version check
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2021-2022 dsstudio Technologies and contributors.
2
+ * Copyright 2021-2023 dsstudio Technologies and contributors.
3
3
*
4
4
* 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
5
5
* 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") {
23
23
public val doh: String by value(" https://public.dns.iij.jp/dns-query" )
24
24
25
25
@ValueName(" ipv6" )
26
- @ValueDescription(" Dns Over Https Url " )
26
+ @ValueDescription(" Dns Over Https IPv6 " )
27
27
public val ipv6: Boolean by value(false )
28
28
29
29
@ValueName(" github_token" )
You can’t perform that action at this time.
0 commit comments