chore: Prepare BotModule.setup()
This commit is contained in:
parent
0fa9a44640
commit
acde0d3ee5
2 changed files with 5 additions and 2 deletions
|
@ -29,7 +29,8 @@ abstract class AbstractBot(configurator: BotConfigurator.() -> Unit) {
|
|||
extensions = mutableMapOf()
|
||||
currentConfig.extensions.forEach {
|
||||
val module = it.call()
|
||||
module.setup(this, currentConfig)
|
||||
module.setup()
|
||||
module.install(this, currentConfig)
|
||||
extensions[module.name] = module
|
||||
}
|
||||
commands = currentConfig.commands
|
||||
|
|
|
@ -11,7 +11,9 @@ abstract class BotModule(val name: String, val description: String? = null) {
|
|||
var bot: AbstractBot? = null
|
||||
internal set
|
||||
|
||||
internal fun setup(bot: AbstractBot, configurator: BotConfigurator) {
|
||||
open fun setup() {}
|
||||
|
||||
internal fun install(bot: AbstractBot, configurator: BotConfigurator) {
|
||||
this.bot = bot
|
||||
|
||||
val methods = this::class.java.declaredMethods
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue