kageru
d6492bae8f
The entire config parsing is now rewritten. This entirely removes toml4j in favor of Konf. It also removes all remaining RawConfig logic.
26 lines
785 B
Kotlin
26 lines
785 B
Kotlin
package moe.kageru.kagebot.features
|
|
|
|
class Features(val welcome: WelcomeFeature?, val timeout: TimeoutFeature?) {
|
|
private val debug = DebugFeature()
|
|
private val help = HelpFeature()
|
|
private val getConfig = GetConfigFeature()
|
|
private val setConfig = SetConfigFeature()
|
|
|
|
private val all = listOf(welcome, debug, help, getConfig, setConfig, timeout)
|
|
private val featureMap = mapOf(
|
|
"help" to help,
|
|
"debug" to debug,
|
|
"welcome" to welcome,
|
|
"getConfig" to getConfig,
|
|
"setConfig" to setConfig,
|
|
"timeout" to timeout
|
|
)
|
|
|
|
fun findByString(feature: String) = featureMap[feature]
|
|
fun eventFeatures() = all.filterIsInstance<EventFeature>()
|
|
|
|
companion object {
|
|
val DEFAULT = Features(null, null)
|
|
}
|
|
}
|