Skip to content

Commit 53321f2

Browse files
committed
build: 1.3.8
1 parent 76b1ef9 commit 53321f2

File tree

5 files changed

+36
-31
lines changed

5 files changed

+36
-31
lines changed

README.md

+25-20
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
> 基于 [Mirai Console](https://github.com/mamoe/mirai-console)[百度AI内容审核](https://ai.baidu.com/ai-doc/ANTIPORN/) 的自动禁言助手
44
55
[![Release](https://img.shields.io/github/v/release/gnuf0rce/mirai-content-censor)](https://github.com/gnuf0rce/mirai-content-censor/releases)
6-
[![Downloads](https://img.shields.io/github/downloads/gnuf0rce/mirai-content-censor/total)](https://shields.io/category/downloads)
6+
[![Downloads](https://img.shields.io/github/downloads/gnuf0rce/mirai-content-censor/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/293)
88

99
同时安装有 [Mirai Administrator](https://github.com/cssxsh/mirai-administrator) 时,将会桥接到服务接口
@@ -23,45 +23,50 @@
2323

2424
位于 `config/io.github.gnuf0rce.content-censor/ContentCensor.yml`
2525

26-
1. `mute` 禁言时间,单位秒,默认1分钟
27-
2. `recall` 撤回消息的延时,单位秒,默认0秒
28-
3. `plain` 是否检查文本,默认 true
29-
4. `image` 是否检查图片,默认 false
30-
5. `audio` 是否检查语音,默认 false
26+
1. `mute` 禁言时间,单位秒,默认1分钟
27+
2. `recall` 撤回消息的延时,单位秒,默认0秒
28+
3. `plain` 是否检查文本,默认 true
29+
4. `image` 是否检查图片,默认 false
30+
5. `audio` 是否检查语音,默认 false
31+
6. `download` 下载文件再上传(语音/图片),默认 false
3132

3233
### 避开审查
3334

3435
拥有权限 `io.github.gnuf0rce.content-censor:no-censor` 的用户将不会被检测
3536

3637
### 指令
3738

38-
1. `/censor` 测试是否有有违规
39+
1. `/censor` 测试是否有有违规
3940
示例: `/censor cnm`
40-
2. `/censor-record from [sender] [date]` 查看 sender (消息的发送者) 相关的违规记录
41-
示例: `/censor from 123456 2022-07-24`
42-
3. `/censor-record target [subject] [date]` 查看 subject (消息的接收者) 相关的违规记录
43-
示例: `/censor target 789456 2022-07-24`
41+
42+
2. `/censor-record from [sender] [date]` 查看 sender (消息的发送者) 相关的违规记录
43+
示例: `/censor from 123456 2022-07-24`
44+
45+
3. `/censor-record target [subject] [date]` 查看 subject (消息的接收者) 相关的违规记录
46+
示例: `/censor target 789456 2022-07-24`
4447

4548
### 百度云后台
4649

47-
* 策略管理 <https://ai.baidu.com/censoring/#/strategylist>
48-
配置审查规则、自定义黑白名单、测试验证规则有效性
49-
* 数据统计 <https://ai.baidu.com/censoring/#/overview>
50-
统计结果,图表
51-
* 数据查询 <https://ai.baidu.com/censoring/#/query>
52-
历史审核数据
50+
* 策略管理 <https://ai.baidu.com/censoring/#/strategylist>
51+
配置审查规则、自定义黑白名单、测试验证规则有效性
52+
53+
* 数据统计 <https://ai.baidu.com/censoring/#/overview>
54+
统计结果,图表
55+
56+
* 数据查询 <https://ai.baidu.com/censoring/#/query>
57+
历史审核数据
5358

5459
## 安装
5560

5661
### MCL 指令安装
5762

5863
**请确认 mcl.jar 的版本是 2.1.0+**
59-
`./mcl --update-package io.github.gnuf0rce:mirai-content-censor --channel stable --type plugin`
64+
`./mcl --update-package io.github.gnuf0rce:mirai-content-censor --channel maven-stable --type plugin`
6065

6166
### 手动安装
6267

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

6671
## TODO
6772

build.gradle.kts

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
plugins {
22
kotlin("jvm") version "1.7.20"
33
kotlin("plugin.serialization") version "1.7.20"
4-
id("net.mamoe.mirai-console") version "2.13.0-RC2"
4+
id("net.mamoe.mirai-console") version "2.13.0"
55
id("me.him188.maven-central-publish") version "1.0.0-dev-3"
66
id("me.him188.kotlin-jvm-blocking-bridge") version "2.2.0-172.1"
77
}
88

99
group = "io.github.gnuf0rce"
10-
version = "1.3.7"
10+
version = "1.3.8"
1111

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

2828
dependencies {
29-
api("xyz.cssxsh.baidu:baidu-aip:3.2.1") {
29+
api("xyz.cssxsh.baidu:baidu-aip:3.3.0") {
3030
exclude(group = "org.jetbrains.kotlin")
3131
exclude(group = "org.jetbrains.kotlinx")
3232
exclude(group = "org.slf4j")
3333
}
3434
implementation("io.github.kasukusakura:silk-codec:0.0.5")
35-
compileOnly("xyz.cssxsh.mirai:mirai-administrator:1.2.9")
36-
compileOnly("xyz.cssxsh.mirai:mirai-hibernate-plugin:2.4.4")
35+
compileOnly("xyz.cssxsh.mirai:mirai-administrator:1.3.0")
36+
compileOnly("xyz.cssxsh.mirai:mirai-hibernate-plugin:2.5.0")
3737
//
3838
testImplementation(kotlin("test"))
3939
testImplementation("org.slf4j:slf4j-simple:2.0.3")
40-
testImplementation("net.mamoe:mirai-logging-slf4j:2.13.0-RC2")
40+
testImplementation("net.mamoe:mirai-logging-slf4j:2.13.0")
4141
}
4242

4343
mirai {

src/main/kotlin/io/github/gnuf0rce/mirai/censor/MiraiBaiduAipClient.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public object MiraiBaiduAipClient : BaiduAipClient(config = config), CoroutineSc
1919
override val coroutineContext: CoroutineContext by lazy {
2020
try {
2121
MiraiContentCensorPlugin.coroutineContext + CoroutineName("BaiduAipContentCensor")
22-
} catch (_: Throwable) {
22+
} catch (_: UninitializedPropertyAccessException) {
2323
CoroutineExceptionHandler { _, throwable ->
2424
if (throwable.unwrapCancellationException() !is CancellationException) {
2525
logger.error("Exception in coroutine BaiduAipContentCensor", throwable)

src/main/kotlin/io/github/gnuf0rce/mirai/censor/MiraiContentCensorPlugin.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import net.mamoe.mirai.utils.*
1515
import xyz.cssxsh.mirai.admin.*
1616

1717
public object MiraiContentCensorPlugin : KotlinPlugin(
18-
JvmPluginDescription("io.github.gnuf0rce.content-censor", "1.3.6") {
18+
JvmPluginDescription("io.github.gnuf0rce.content-censor", "1.3.8") {
1919
name("content-censor")
2020
author("cssxsh")
2121

@@ -34,7 +34,7 @@ public object MiraiContentCensorPlugin : KotlinPlugin(
3434
System.setProperty(MiraiContentCensor.IMAGE_CACHE_PATH, image.path)
3535
NativeLoader.initialize(dataFolder)
3636
} catch (error: UnsatisfiedLinkError) {
37-
logger.error("初始化失败, folder: $dataFolder", error)
37+
logger.error("Silk Codec 初始化失败, folder: $dataFolder", error)
3838
}
3939
}
4040

src/main/kotlin/io/github/gnuf0rce/mirai/censor/MiraiContentCensorUtils.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ internal val NoCensorPermission: Permission by lazy {
2020
description = "跳过检测",
2121
parent = MiraiContentCensorPlugin.parentPermission
2222
)
23-
} catch (_: Throwable) {
23+
} catch (_: UninitializedPropertyAccessException) {
2424
rootPermission
2525
}
2626
}
@@ -29,7 +29,7 @@ internal val NoCensorPermission: Permission by lazy {
2929
internal val logger by lazy {
3030
try {
3131
MiraiContentCensorPlugin.logger
32-
} catch (_: Throwable) {
32+
} catch (_: UninitializedPropertyAccessException) {
3333
MiraiLogger.Factory.create(MiraiContentCensor::class)
3434
}
3535
}

0 commit comments

Comments
 (0)