From a91dda33c782647ab1777a42bf964fea2a90ca9f Mon Sep 17 00:00:00 2001 From: kageru Date: Sun, 9 Jun 2019 00:03:09 +0200 Subject: [PATCH] remove admin parameter from config --- src/main/kotlin/moe/kageru/kagebot/Config.kt | 9 ++------- src/main/kotlin/moe/kageru/kagebot/Kagebot.kt | 1 - src/main/resources/config.toml | 3 --- 3 files changed, 2 insertions(+), 11 deletions(-) diff --git a/src/main/kotlin/moe/kageru/kagebot/Config.kt b/src/main/kotlin/moe/kageru/kagebot/Config.kt index 70fce4e..e222bac 100644 --- a/src/main/kotlin/moe/kageru/kagebot/Config.kt +++ b/src/main/kotlin/moe/kageru/kagebot/Config.kt @@ -19,7 +19,7 @@ class Config(val system: System, val commands: List) { }) val parsed = rawConfig.to(Config::class.java) return Config( - System(parsed.system), + parsed.system, parsed.commands.map { Command(it) } ) } @@ -27,10 +27,5 @@ class Config(val system: System, val commands: List) { } } -data class System(val serverId: String, val admins: List) { - /** - * Self constructor to explicitly repeat the nullability checks after TOML parsing. - */ - constructor(system: System) : this(system.serverId, system.admins) -} +data class System(val serverId: String) diff --git a/src/main/kotlin/moe/kageru/kagebot/Kagebot.kt b/src/main/kotlin/moe/kageru/kagebot/Kagebot.kt index 779cd79..7e8eb97 100644 --- a/src/main/kotlin/moe/kageru/kagebot/Kagebot.kt +++ b/src/main/kotlin/moe/kageru/kagebot/Kagebot.kt @@ -22,7 +22,6 @@ class Kagebot { init { val api = DiscordApiBuilder().setToken(Config.secret).login().join() - println(config.system.admins) Runtime.getRuntime().addShutdownHook(Thread { log.info("Bot has been interrupted. Shutting down.") api.disconnect() diff --git a/src/main/resources/config.toml b/src/main/resources/config.toml index fc9d6bb..9103a9a 100644 --- a/src/main/resources/config.toml +++ b/src/main/resources/config.toml @@ -1,8 +1,5 @@ [system] serverId = "356414885292277771" -admins = [ - "137780880344088576" -] [[commands]] trigger = "!ping"