From 6c2cfbf06fcfbfb282454143a83749f05112ba21 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 18 Aug 2022 12:27:11 +0600 Subject: [PATCH] a little upgrade of hello plugin --- bot/src/main/kotlin/dev/inmo/plagubot/HelloPlugin.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bot/src/main/kotlin/dev/inmo/plagubot/HelloPlugin.kt b/bot/src/main/kotlin/dev/inmo/plagubot/HelloPlugin.kt index 67926e2..2f5a481 100644 --- a/bot/src/main/kotlin/dev/inmo/plagubot/HelloPlugin.kt +++ b/bot/src/main/kotlin/dev/inmo/plagubot/HelloPlugin.kt @@ -31,11 +31,12 @@ object HelloPlugin : Plugin { } } - override suspend fun BehaviourContext.setupBotPlugin(koin: Koin) { - logger.d { koin.get().print } + override suspend fun BehaviourContextWithFSM.setupBotPlugin(koin: Koin) { + val toPrint = koin.getOrNull() ?.print ?: "Hello :)" + logger.d { toPrint } logger.dS { getMe().toString() } onCommand("hello_world") { - reply(it, "Hello :)") + reply(it, toPrint) } } }