fixes/fill of docs

This commit is contained in:
2022-08-13 20:30:10 +06:00
parent 751e9aa66c
commit 7dad3581f1
3 changed files with 16 additions and 2 deletions

View File

@@ -25,9 +25,19 @@ interface Plugin {
database: Database,
params: JsonObject
) {}
/**
* Override this method in cases when you want to declare common bot behaviour. In case you wish to use FSM, you
* should override the method with receiver [BehaviourContextWithFSM]
*/
suspend fun BehaviourContext.setupBotPlugin(
koin: Koin
) {}
/**
* Override this method in cases when you want to declare full behaviour of the plugin. It is recommended to declare
* common logic of plugin in the [setupBotPlugin] with [BehaviourContext] receiver and use override this one
* for the FSM configuration
*/
suspend fun BehaviourContextWithFSM<State>.setupBotPlugin(koin: Koin) {
(this as BehaviourContext).setupBotPlugin(koin)
}