Skip to content

Commit

Permalink
fix: correctly add bot master to userSet in whitelist mode
Browse files Browse the repository at this point in the history
Closes #53
  • Loading branch information
Samarium150 committed Sep 13, 2021
1 parent c4b638a commit 95ff6a8
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/Release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
- name: Create Release
uses: ncipollo/release-action@v1
with:
artifacts": ./build/mirai/mirai-console-lolicon-${{ steps.vars.outputs.tag }}.mirai.jar
artifacts: ./build/mirai/mirai-console-lolicon-${{ steps.vars.outputs.tag }}.mirai.jar
artifactContentType: application/jar
tag: ${{ steps.vars.outputs.tag }}
token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ plugins {
}

group = "com.github.samarium150"
version = "4.1.0"
version = "4.1.1"

repositories {
mavenLocal()
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/Lolicon.kt
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ object Lolicon: CompositeCommand(
/**
* Advanced get
* <br>
* 子命令adv,根据[json]获取图片
* 子命令adv,根据 [json] 获取图片
*
* @param json JSON字符串
*/
Expand Down
8 changes: 5 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.0",
version = "4.1.1",
name = "mirai-console-lolicon"
)
) {
Expand All @@ -68,8 +68,10 @@ object Main: KotlinPlugin(

if (PluginConfig.master != 0L) {
PluginData.trustedUsers.add(PluginConfig.master)
PluginData.userSet.add(PluginConfig.master)
PluginData.reload()
if (PluginConfig.mode == "whitelist")
PluginData.userSet.add(PluginConfig.master)
if (PluginConfig.mode == "blacklist")
PluginData.userSet.remove(PluginConfig.master)
} else logger.warning("请先在配置文件设置Bot所有者id")

client = HttpClient {
Expand Down

0 comments on commit 95ff6a8

Please sign in to comment.