Skip to content

Commit a47efcf

Browse files
committed
build: 1.2.9
1 parent 03e56e1 commit a47efcf

7 files changed

Lines changed: 47 additions & 56 deletions

File tree

build.gradle.kts

Lines changed: 21 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
plugins {
2-
kotlin("jvm") version "1.7.20"
3-
kotlin("plugin.serialization") version "1.7.20"
2+
kotlin("jvm") version "1.7.21"
3+
kotlin("plugin.serialization") version "1.7.21"
44

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

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

1212
mavenCentralPublish {
1313
useCentralS01()
@@ -26,38 +26,24 @@ repositories {
2626
}
2727

2828
dependencies {
29-
implementation("io.ktor:ktor-client-okhttp:2.1.2") {
30-
exclude(group = "org.jetbrains.kotlin")
31-
exclude(group = "org.jetbrains.kotlinx")
32-
exclude(group = "org.slf4j")
33-
}
34-
implementation("io.ktor:ktor-client-encoding:2.1.2") {
35-
exclude(group = "org.jetbrains.kotlin")
36-
exclude(group = "org.jetbrains.kotlinx")
37-
exclude(group = "org.slf4j")
38-
}
39-
implementation("io.ktor:ktor-client-content-negotiation:2.1.2") {
40-
exclude(group = "org.jetbrains.kotlin")
41-
exclude(group = "org.jetbrains.kotlinx")
42-
exclude(group = "org.slf4j")
43-
}
44-
implementation("io.ktor:ktor-serialization-kotlinx-json:2.1.2") {
45-
exclude(group = "org.jetbrains.kotlin")
46-
exclude(group = "org.jetbrains.kotlinx")
47-
exclude(group = "org.slf4j")
48-
}
49-
implementation("com.squareup.okhttp3:okhttp-dnsoverhttps:4.10.0") {
50-
exclude(group = "org.jetbrains.kotlin")
51-
exclude(group = "org.jetbrains.kotlinx")
52-
exclude(group = "org.slf4j")
53-
}
54-
compileOnly("xyz.cssxsh.mirai:mirai-selenium-plugin:2.2.3")
55-
compileOnly("xyz.cssxsh.mirai:mirai-administrator:1.2.8")
56-
// test
57-
testRuntimeOnly("xyz.cssxsh.mirai:mirai-selenium-plugin:2.2.3")
29+
compileOnly("xyz.cssxsh.mirai:mirai-selenium-plugin:2.2.4")
30+
compileOnly("xyz.cssxsh.mirai:mirai-administrator:1.3.0")
5831
testImplementation(kotlin("test"))
59-
testImplementation("org.slf4j:slf4j-simple:2.0.3")
60-
testImplementation("net.mamoe:mirai-logging-slf4j:2.13.0-RC")
32+
testImplementation("xyz.cssxsh.mirai:mirai-selenium-plugin:2.2.4")
33+
//
34+
implementation(platform("net.mamoe:mirai-bom:2.13.2"))
35+
compileOnly("net.mamoe:mirai-console-compiler-common")
36+
testImplementation("net.mamoe:mirai-logging-slf4j")
37+
//
38+
implementation(platform("io.ktor:ktor-bom:2.1.3"))
39+
implementation("io.ktor:ktor-client-okhttp")
40+
implementation("io.ktor:ktor-client-encoding")
41+
implementation("io.ktor:ktor-client-content-negotiation")
42+
implementation("io.ktor:ktor-serialization-kotlinx-json")
43+
implementation("com.squareup.okhttp3:okhttp-dnsoverhttps:4.10.0")
44+
//
45+
implementation(platform("org.slf4j:slf4j-parent:2.0.5"))
46+
testImplementation("org.slf4j:slf4j-simple")
6147
}
6248

6349
mirai {

readme.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
> 基于 [Mirai Console](https://github.com/mamoe/mirai-console) 的 GitHub Notice 订阅插件
44
55
[![Release](https://img.shields.io/github/v/release/gnuf0rce/github-helper)](https://github.com/gnuf0rce/github-helper/releases)
6-
[![Downloads](https://img.shields.io/github/downloads/gnuf0rce/github-helper/total)](https://shields.io/category/downloads)
6+
[![Downloads](https://img.shields.io/github/downloads/gnuf0rce/github-helper/total)](https://repo1.maven.org/maven2/io/github/gnuf0rce/mirai-content-censor/)
77
[![MiraiForum](https://img.shields.io/badge/post-on%20MiraiForum-yellow)](https://mirai.mamoe.net/topic/554)
88

99
**使用前应该查阅的相关文档或项目**
@@ -97,7 +97,7 @@
9797

9898
举例:
9999

100-
```
100+
```text
101101
问题:GitHub ID ?
102102
答案:cssxsh
103103
```
@@ -108,24 +108,24 @@
108108

109109
### GithubConfig
110110

111-
* `proxy` Format http://127.0.0.1:8080 or socks://127.0.0.1:1080
112-
* `doh` Dns Over Https Url
113-
* `github_token` [Personal Access Tokens](https://github.com/settings/tokens)
114-
* `reply_type` URL解析回复的消息格式
115-
* `timeout` Http 访问超时时间,单位秒
116-
* `percentage_member_join` 加群放行 GitHub 活跃等级(百分制),默认0,不开启功能
117-
* `percentages` 加群放行 GitHub 活跃等级(百分制),默认0,不开启功能
118-
* `sign_member_join` 加群放行提示信息
119-
* `github_readme_stats` stats card 绘制参数
111+
* `proxy` Format http://127.0.0.1:8080 or socks://127.0.0.1:1080
112+
* `doh` Dns Over Https Url
113+
* `github_token` [Personal Access Tokens](https://github.com/settings/tokens)
114+
* `reply_type` URL解析回复的消息格式
115+
* `timeout` Http 访问超时时间,单位秒
116+
* `percentage_member_join` 加群放行 GitHub 活跃等级(百分制),默认0,不开启功能
117+
* `percentages` 加群放行 GitHub 活跃等级(百分制),默认0,不开启功能
118+
* `sign_member_join` 加群放行提示信息
119+
* `github_readme_stats` stats card 绘制参数
120120

121121
## 安装
122122

123123
### MCL 指令安装
124124

125125
**请确认 mcl.jar 的版本是 2.1.0+**
126-
`./mcl --update-package io.github.gnuf0rce:github-helper --channel stable --type plugin`
126+
`./mcl --update-package io.github.gnuf0rce:github-helper --channel maven-stable --type plugin`
127127

128128
### 手动安装
129129

130-
* 运行 [Mirai Console](https://github.com/mamoe/mirai-console) 生成`plugins`文件夹
131-
*[Releases](https://github.com/gnuf0rce/github-helper/releases) 下载`jar`并将其放入`plugins`文件夹中
130+
1.[Releases](https://github.com/gnuf0rce/github-helper/releases) 或者 [Maven](https://repo1.maven.org/maven2/io/github/gnuf0rce/mirai-content-censor/) 下载 `mirai2.jar`
131+
2. 将其放入 `plugins` 文件夹中

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

Lines changed: 1 addition & 1 deletion
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.8",
32+
version = "1.2.9",
3333
) {
3434
author("cssxsh")
3535

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1027,8 +1027,8 @@ public suspend fun Repo.toMessage(contact: Contact, type: Format, notice: String
10271027
val size = when (additional) {
10281028
0L -> "0"
10291029
in 1L until (1 shl 10) -> "${additional}B"
1030-
in (1 shl 10) until (1 shl 20) -> "${additional.toDouble().div(1 shl 10)}KB"
1031-
else -> "${additional.toDouble().div(1 shl 20)}MB"
1030+
in (1 shl 10) until (1 shl 20) -> "${additional.div(1 shl 10)}KB"
1031+
else -> "${additional.div(1 shl 20)}MB"
10321032
}
10331033
appendLine("$language: $size")
10341034
}
@@ -1109,7 +1109,7 @@ public suspend fun Milestone.toMessage(contact: Contact, type: Format, notice: S
11091109

11101110
public suspend fun Readme.toMessage(contact: Contact): Message {
11111111
if (contact is FileSupported) {
1112-
contact.launch(SupervisorJob()) {
1112+
contact.launch {
11131113
val file = if (selenium) {
11141114
logger.info { "将尝试发送 ${sha}.pdf to ${contact.render()}" }
11151115
pdf()

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ internal val PullReplier: MessageReplier = replier@{ result ->
132132

133133
/**
134134
* 1. [https://github.com/{owner}/{repo}/releases/tag/{name}]
135+
* 2. [https://github.com/{owner}/{repo}/releases/latest]
135136
*/
136137
internal val RELEASE_REGEX = """(?<=github\.com/)([\w-.]+)/([\w-.]+)/releases/(tag|latest)/?(\S*)""".toRegex()
137138

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ public abstract class GitHubSubscriber<T>(private val name: String) : CoroutineS
132132
}
133133
}
134134

135-
private fun launch(id: String) = launch(SupervisorJob()) {
135+
private fun launch(id: String) = launch {
136136
logger.info { "$name with $id run start" }
137137
while (isActive) {
138138
val current = task(id) ?: break

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import java.net.*
2222
import java.util.*
2323
import kotlin.coroutines.*
2424

25-
internal const val IMAGE_FOLDER_PROPERTY = "io.github.gnuf0rce.mirai.plugin.image"
25+
internal const val IMAGE_FOLDER_PROPERTY = "io.github.gnuf0rce.mirai.github.image"
2626

2727
/**
2828
* @see [GitHubHelperPlugin.logger]
@@ -73,7 +73,11 @@ internal val github by lazy {
7373
true
7474
}
7575
is IOException -> {
76-
logger.warning({ "HttpClient Ignore" }, it)
76+
if (it.message == "Connection reset") {
77+
logger.warning { "HttpClient Ignore ${it.message}" }
78+
} else {
79+
logger.warning({ "HttpClient Ignore" }, it)
80+
}
7781
true
7882
}
7983
else -> {

0 commit comments

Comments
 (0)