refactor: Use Koin more and API to register module to Koin
This commit is contained in:
parent
26e5ba9e85
commit
96c85a351e
6 changed files with 29 additions and 21 deletions
|
@ -1,10 +1,8 @@
|
|||
package io.github.null2264.tsukumogami.bot
|
||||
|
||||
import co.touchlab.kermit.Logger
|
||||
import io.github.null2264.tsukumogami.bot.core.di.appModule
|
||||
import io.github.null2264.tsukumogami.bot.core.module.generalModule
|
||||
import io.github.null2264.tsukumogami.core.bot
|
||||
import org.koin.core.context.GlobalContext.startKoin
|
||||
|
||||
suspend fun main() {
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package io.github.null2264.tsukumogami.bot.core.module
|
||||
|
||||
import dev.kord.core.entity.effectiveName
|
||||
import io.github.null2264.tsukumogami.bot.core.module.arguments.Test2Arguments
|
||||
import io.github.null2264.tsukumogami.bot.core.module.arguments.TestArguments
|
||||
import io.github.null2264.tsukumogami.core.module.api.botModules
|
||||
|
@ -18,6 +19,7 @@ val generalModule = botModules("General") {
|
|||
groups("group") {
|
||||
commands("test", alias = setOf("t")) { ctx ->
|
||||
ctx.reply("Hello world ${ctx.command?.module?.name}")
|
||||
ctx.reply("Bot: ${ctx.bot.self().effectiveName}")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue