discord-kagebot/src/main/kotlin/moe/kageru/kagebot/features/Features.kt

27 lines
618 B
Kotlin
Raw Normal View History

package moe.kageru.kagebot.features
import moe.kageru.kagebot.config.RawFeatures
class Features(
val welcome: WelcomeFeature?,
debug: DebugFeature,
help: HelpFeature,
getConfig: GetConfigFeature
) {
2019-06-15 14:15:34 +02:00
constructor(rawFeatures: RawFeatures) : this(
rawFeatures.welcome?.let(::WelcomeFeature),
DebugFeature(),
HelpFeature(),
GetConfigFeature()
2019-06-15 14:15:34 +02:00
)
private val featureMap = mapOf(
"help" to help,
"debug" to debug,
"welcome" to welcome,
"getConfig" to getConfig
)
fun findByString(feature: String) = featureMap[feature]
2019-07-13 14:52:05 +02:00
}