refactor: Use Koin more and API to register module to Koin

This commit is contained in:
Ahmad Ansori Palembani 2025-05-26 07:12:33 +07:00
parent 26e5ba9e85
commit 96c85a351e
Signed by: null2264
GPG key ID: BA64F8B60AF3EFB6
6 changed files with 29 additions and 21 deletions

View file

@ -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() {

View file

@ -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}")
}
}
}