a lot of improvements

This commit is contained in:
2024-09-14 21:06:06 +06:00
parent bb06ba1ca7
commit 3b507a5668
4 changed files with 32 additions and 16 deletions

View File

@@ -10,6 +10,7 @@ import kotlinx.serialization.json.JsonObject
import org.jetbrains.exposed.sql.Database
import org.koin.core.Koin
import org.koin.core.module.Module
import org.koin.core.scope.Scope
/**
* **ANY REALIZATION OF [Plugin] MUST HAVE CONSTRUCTOR WITH ABSENCE OF INCOMING PARAMETERS**
@@ -20,8 +21,16 @@ import org.koin.core.module.Module
*/
@Serializable(PluginSerializer::class)
interface Plugin : StartPlugin {
@Deprecated("Deprecated in favor to setupBotClient with arguments")
fun KtorRequestsExecutorBuilder.setupBotClient() {}
fun KtorRequestsExecutorBuilder.setupBotClient(params: JsonObject) = setupBotClient()
/**
* Will be called on stage of bot setup
*
* @param scope The scope of [org.koin.core.module.Module.single] of bot definition
* @param params Params (in fact, the whole bot config)
*/
fun KtorRequestsExecutorBuilder.setupBotClient(scope: Scope, params: JsonObject) = setupBotClient()
/**
* This method will be called when this plugin should configure di module based on the incoming params