remove admin parameter from config

This commit is contained in:
kageru 2019-06-09 00:03:09 +02:00
parent 208de19ff4
commit a91dda33c7
Signed by: kageru
GPG Key ID: 8282A2BEA4ADA3D2
3 changed files with 2 additions and 11 deletions

View File

@ -19,7 +19,7 @@ class Config(val system: System, val commands: List<Command>) {
})
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<Command>) {
}
}
data class System(val serverId: String, val admins: List<String>) {
/**
* 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)

View File

@ -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()

View File

@ -1,8 +1,5 @@
[system]
serverId = "356414885292277771"
admins = [
"137780880344088576"
]
[[commands]]
trigger = "!ping"