Skip to content

Commit

Permalink
build: 1.3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
cssxsh committed Mar 4, 2023
1 parent 742ef60 commit 1fd3f71
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 12 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
## 1.3.2 (23/03/04)

1. fix: MiraiBackupService, close #16
2. fix: mail with '\t'
3. feat: check isBotMuted
4. fix: censor dict load
5. fix: reject close #21
6. feat: chunked close #17
32 changes: 26 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
* 联系人相关 自动审批,指令查看,用户留言
* 消息相关 发送消息,撤回消息
* 群管理相关 群消息审核,自动宵禁,自动清理不发言,禁言自动退群
* 机器人异常下线时发送邮件

本插件提供[服务接口](#服务接口)以供其他插件拓展功能
例如使用 [Mirai Content Censor](https://github.com/gnuf0rce/mirai-content-censor) 依靠百度API审查群消息
Expand All @@ -26,7 +27,7 @@
## MCL 指令安装

**请确认 mcl.jar 的版本是 2.1.0+**
`./mcl --update-package xyz.cssxsh.mirai:mirai-administrator --channel maven-stable --type plugin`
`./mcl --update-package xyz.cssxsh.mirai:mirai-administrator --channel maven-stable --type plugins`

## 指令

Expand All @@ -37,7 +38,8 @@
本插件指令权限ID 格式为 `xyz.cssxsh.mirai.plugin.mirai-administrator:command.*`, `*` 是指令的第一指令名
例如 `/send to 12345` 的权限ID为 `xyz.cssxsh.mirai.plugin.mirai-administrator:command.send`
对 机器人发送的**联系人请求**通知消息 回复 `同意``不同意``拉黑` 即可处理
插件提供黑名单功能,使用指令 `/contact black u12345`, 即可拉黑用户,Bot将不响应用户动作(包括其他插件的功能)
插件提供黑名单功能,使用指令 `/contact black u12345`, 即可拉黑用户,Bot将不响应用户动作(包括其他插件的功能)
发送异常下线邮件通知需要配置邮箱账户和密码

### AdminContactCommand

Expand All @@ -48,6 +50,7 @@
| `/<contact> <request>` | 查看申请列表 |
| `/<contact> <black> {permitteeIds}` | 拉黑 |
| `/<contact> <white> {permitteeIds}` | 取消拉黑 |
| `/<contact> <screen> [page]?` | 列出黑名单 |
| `/<contact> <backup>` | 触发备份功能 |

1. `id` 是 事件id 或 好友id 或 群id
Expand All @@ -68,7 +71,7 @@
| Command | Description |
|:----------------------------------------------|:------------|
| `/<group> <list>` | 群列表 |
| `/<group> <member> [group]` | 群成员 |
| `/<group> <member> [group] [page]?` | 群成员 |
| `/<group> <quit> [group]` | 退出群聊 |
| `/<group> <kick> [member] [reason]? [black]?` | 踢出群员 |
| `/<group> <nick> [member] [nick]` | 群昵称 |
Expand Down Expand Up @@ -131,7 +134,7 @@
3. `moment` 为 DURATION 表达式, 由 `PnDTnHnMn.nS` 组成
例如 `P1DT2H3M4.5S` 表示 一天二小时三分钟四点五秒,`PT5H` 表示 五小时

4. mute 指令,moment 小于 `0` 宵禁就会关闭
4. mute 指令,moment 为零 `PT0S` 宵禁就会关闭
例如 `/timer mute PT5H "0 0 1 ? * 2-6"`, 将会在 星期一到星期五的凌晨01:00 禁言 5 小时
例如 `/timer mute PT0S "0 0 0 1 * ?"`, 将会 取消 禁言定时器

Expand Down Expand Up @@ -168,9 +171,11 @@
### 邮件配置

1. `AdminMailConfig.yml` 配置一些默认的发送对象
2. `admin.mail.properties` 配置邮箱账号等
2. `admin.mail.properties` 配置邮箱账号等,需要自己配置邮箱的 `mail.host`, `mail.user`, `mail.password`, `mail.from`

格式参考

QQ Mail https://service.mail.qq.com/cgi-bin/help?subtype=1&&id=28&&no=1001256
```properties
mail.host=smtp.mail.qq.com
mail.auth=true
Expand All @@ -185,7 +190,22 @@ mail.smtp.auth=true
mail.smtp.timeout=15000
```

QQ邮箱帮助: https://service.mail.qq.com/cgi-bin/help?subtype=1&&id=28&&no=1001256
Gmail https://support.google.com/mail/answer/7126229
```properties
mail.host=smtp.gmail.com
mail.auth=true
mail.user=xxx
mail.password=***
mail.from[email protected]
mail.store.protocol=smtp
mail.transport.protocol=smtp
# smtp
mail.smtp.starttls.enable=true
mail.smtp.starttls.required=true
mail.smtp.auth=true
mail.smtp.timeout=15000
mail.smtp.port=587
```

## [爱发电](https://afdian.net/@cssxsh)

Expand Down
8 changes: 4 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ plugins {
kotlin("jvm") version "1.7.22"
kotlin("plugin.serialization") version "1.7.22"

id("net.mamoe.mirai-console") version "2.13.2"
id("net.mamoe.mirai-console") version "2.14.0"
id("me.him188.maven-central-publish") version "1.0.0-dev-3"
}

group = "xyz.cssxsh.mirai"
version = "1.3.1"
version = "1.3.2"

mavenCentralPublish {
useCentralS01()
Expand All @@ -31,14 +31,14 @@ dependencies {
implementation("org.eclipse.angus:angus-mail:1.1.0")
testImplementation(kotlin("test"))
//
implementation(platform("net.mamoe:mirai-bom:2.13.2"))
implementation(platform("net.mamoe:mirai-bom:2.14.0"))
compileOnly("net.mamoe:mirai-core")
compileOnly("net.mamoe:mirai-core-utils")
compileOnly("net.mamoe:mirai-console-compiler-common")
testImplementation("net.mamoe:mirai-logging-slf4j")
testImplementation("net.mamoe:mirai-core-utils")
//
implementation(platform("io.ktor:ktor-bom:2.2.1"))
implementation(platform("io.ktor:ktor-bom:2.1.3"))
implementation("io.ktor:ktor-client-okhttp")
implementation("io.ktor:ktor-client-encoding")
//
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/xyz/cssxsh/mirai/admin/MiraiAdminPlugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ internal object MiraiAdminPlugin : KotlinPlugin(
JvmPluginDescription(
id = "xyz.cssxsh.mirai.plugin.mirai-administrator",
name = "mirai-administrator",
version = "1.3.1",
version = "1.3.2",
) {
author("cssxsh")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public object AdminTimerCommand : CompositeCommand(
@SubCommand
@Description("定时发送群消息")
public suspend fun CommandSender.message(cron: Cron, target: Group, at: Boolean = false) {
val message = request(hint = "请输入要发送的消息/或者stop终止定时") + if (at) AtAll else emptyMessageChain()
val message = request(hint = "请输入要发送的消息或者‘stop’终止定时") + if (at) AtAll else emptyMessageChain()
if (message.findIsInstance<PlainText>()?.content == "stop") {
AdminTimerData.message[target.id] = AdminTimerData.message[target.id].orEmpty()
.filterNot { it.asString() == cron.asString() }
Expand Down

0 comments on commit 1fd3f71

Please sign in to comment.