Skip to content

Commit 15fe4cc

Browse files
committed
feat: auto_update config
1 parent fb95a5d commit 15fe4cc

3 files changed

Lines changed: 14 additions & 1 deletion

File tree

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,12 @@
9595
| `/<stats> <contribution> [name]` | 查看贡献 |
9696
| `/<stats> <trophy> [name]` | 查看奖杯 |
9797

98+
### GitHubUpdateCommand
99+
100+
| 指令 | 描述 |
101+
|:------------|:-------|
102+
| `/<update>` | 检查插件更新 |
103+
98104
## 自动通过加群问题放行开发者
99105

100106
`1.1.7` 起对接到 [mirai-administrator](https://github.com/cssxsh/mirai-administrator) 实现此功能
@@ -121,6 +127,7 @@
121127
* `percentages` 加群放行 GitHub 活跃等级(百分制),默认0,不开启功能
122128
* `sign_member_join` 加群放行提示信息
123129
* `github_readme_stats` stats card 绘制参数
130+
* `auto_update` 启动时检查插件更新
124131

125132
## 安装
126133

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,9 @@ internal object GitHubHelperPlugin : KotlinPlugin(
7676
val target = resolveConfigFile("update.dict.json")
7777
logger.info { "1.3.0 起提供从 github 更新<其他插件>的功能, 如有需要, 请编辑:\n ${target.toPath().toUri()}" }
7878
GitHubReleasePluginUpdater.reload(target)
79-
GitHubReleasePluginUpdater.update()
79+
if (GitHubConfig.update) {
80+
GitHubReleasePluginUpdater.update()
81+
}
8082
}
8183

8284
override fun onDisable() {

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,8 @@ public object GitHubConfig : ReadOnlyPluginConfig("GithubConfig") {
6060
"include_all_commits" to "true"
6161
)
6262
)
63+
64+
@ValueName("auto_update")
65+
@ValueDescription("启动时检查插件更新")
66+
public val update: Boolean by value(true)
6367
}

0 commit comments

Comments
 (0)