remove admin parameter from config
This commit is contained in:
parent
208de19ff4
commit
a91dda33c7
|
@ -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)
|
||||
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
[system]
|
||||
serverId = "356414885292277771"
|
||||
admins = [
|
||||
"137780880344088576"
|
||||
]
|
||||
|
||||
[[commands]]
|
||||
trigger = "!ping"
|
||||
|
|
Loading…
Reference in New Issue
Block a user