Skip to content

Commit

Permalink
fix: resolve permission-granting conflict with LuckPerms
Browse files Browse the repository at this point in the history
  • Loading branch information
Samarium150 committed Nov 24, 2021
1 parent 015b1ee commit 75a83f2
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ Social preview的图片来自 [AliceSoft](https://www.alicesoft.com) 制作的
在群内随机发送来自 [Lolicon API v2](https://api.lolicon.app/#/setu) 的图片(默认30s自动撤回+60s冷却),支持标签检索和JSON高级检索
<br>
适配 [mirai-console](https://github.com/mamoe/mirai-console)
[![Version](https://img.shields.io/badge/version-2.7.1-blue)](https://github.com/mamoe/mirai/releases/tag/v2.7.1)
[![Version](https://img.shields.io/badge/version-2.8.2-blue)](https://github.com/mamoe/mirai/releases/tag/v2.8.2)
<br>
使用文档已经移到了 [Wiki](https://github.com/Samarium150/mirai-console-lolicon/wiki) 页面
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ plugins {
kotlin("jvm") version kotlinVersion
kotlin("plugin.serialization") version kotlinVersion

id("net.mamoe.mirai-console") version "2.7.1"
id("net.mamoe.mirai-console") version "2.8.2"
id("org.jetbrains.dokka") version "1.5.0"
id("com.geoffgranum.gradle-conventional-changelog") version "0.3.1"
}

group = "com.github.samarium150"
version = "4.1.2"
version = "4.1.3"

repositories {
mavenLocal()
Expand Down
16 changes: 13 additions & 3 deletions src/main/kotlin/Main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import java.net.Proxy
object Main: KotlinPlugin(
JvmPluginDescription(
id = "com.github.samarium150.mirai-console-lolicon",
version = "4.1.2",
version = "4.1.3",
name = "mirai-console-lolicon"
)
) {
Expand Down Expand Up @@ -101,7 +101,12 @@ object Main: KotlinPlugin(
* <br>
* 授予权限
*/
AbstractPermitteeId.AnyContact.permit(Lolicon.permission)
try {
AbstractPermitteeId.AnyContact.permit(Lolicon.permission)
} catch (e: Exception) {
logger.warning(e)
logger.warning("无法自动授予权限,请自行使用权限管理来授予权限")
}

logger.info("Plugin mirai-console-lolicon loaded")
}
Expand All @@ -117,7 +122,12 @@ object Main: KotlinPlugin(
* <br>
* 撤销权限
*/
AbstractPermitteeId.AnyContact.cancel(Lolicon.permission, true)
try {
AbstractPermitteeId.AnyContact.cancel(Lolicon.permission, true)
} catch (e: Exception) {
logger.warning(e)
logger.warning("无法自动撤销权限,请自行使用权限管理来撤销权限")
}

/**
* Unregister commands
Expand Down

0 comments on commit 75a83f2

Please sign in to comment.