From 799e76b487bfbd8a219d4b1029efffeaa126e709 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 12 Nov 2020 12:16:43 +0600 Subject: [PATCH] add docs --- plugin/src/main/kotlin/dev/inmo/plagubot/Plugin.kt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/plugin/src/main/kotlin/dev/inmo/plagubot/Plugin.kt b/plugin/src/main/kotlin/dev/inmo/plagubot/Plugin.kt index b691c48..b37fb75 100644 --- a/plugin/src/main/kotlin/dev/inmo/plagubot/Plugin.kt +++ b/plugin/src/main/kotlin/dev/inmo/plagubot/Plugin.kt @@ -6,8 +6,22 @@ import dev.inmo.tgbotapi.updateshandlers.FlowsUpdatesFilter import kotlinx.coroutines.CoroutineScope import org.jetbrains.exposed.sql.Database +/** + * Use this interface for your bot. It is possible to use [kotlinx.serialization.SerialName] annotations on your plugins + * to set up short name for your plugin. Besides, simple name of your class will be used as key for deserialization + * too. + */ interface Plugin { + /** + * In case you want to publish some processed by your plugin commands, you can provide it via this method + * + * @see BotCommand + */ suspend fun getCommands(): List = emptyList() + + /** + * This method (usually) will be invoked just one time in the whole application. + */ suspend operator fun invoke( bot: TelegramBot, database: Database,