From 47a762c8ba02876ddbb973d865c4051594bae398 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Mon, 11 Jul 2022 00:48:45 +0600 Subject: [PATCH] fixes --- welcome/src/main/kotlin/WelcomePlugin.kt | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/welcome/src/main/kotlin/WelcomePlugin.kt b/welcome/src/main/kotlin/WelcomePlugin.kt index 57f3697..2bd617a 100644 --- a/welcome/src/main/kotlin/WelcomePlugin.kt +++ b/welcome/src/main/kotlin/WelcomePlugin.kt @@ -78,9 +78,6 @@ class WelcomePlugin : Plugin { val user = groupMessage.user if (userIsAdmin(user, groupMessage.chat)) { - val cancelData = "cancel_${groupMessage.chat.id}" - val unsetData = "unset_${groupMessage.chat.id}" - val sentMessage = sendMessage( user, buildEntities { @@ -197,9 +194,7 @@ class WelcomePlugin : Plugin { onCommand( "welcome", - initialFilter = { - it.chat is GroupChat - } + initialFilter = { it.chat is GroupChat } ) { it.whenCommonGroupContentMessage { groupMessage -> launch { @@ -216,8 +211,8 @@ class WelcomePlugin : Plugin { } try { - copyMessage( - it.chat.id, + reply( + it, chatSettings.sourceChatId, chatSettings.sourceMessageId ) @@ -225,14 +220,11 @@ class WelcomePlugin : Plugin { welcomeTable.unset(it.chat.id) } } - - - allUpdatesFlow.subscribeSafelyWithoutExceptions(scope) { - println(it) - } } companion object { private const val pluginConfigSectionName = "welcome" + private const val cancelData = "cancel" + private const val unsetData = "unset" } }