From d605c8c6503879c2ae8b83e6dc75b20eb944d182 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Tue, 25 Oct 2022 12:51:45 +0600 Subject: [PATCH] small fixes --- ratings/source/src/jvmMain/kotlin/Plugin.kt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ratings/source/src/jvmMain/kotlin/Plugin.kt b/ratings/source/src/jvmMain/kotlin/Plugin.kt index 6c58f56..0f78266 100644 --- a/ratings/source/src/jvmMain/kotlin/Plugin.kt +++ b/ratings/source/src/jvmMain/kotlin/Plugin.kt @@ -38,6 +38,7 @@ import dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.CallbackDataInlineK import dev.inmo.tgbotapi.types.message.textsources.bold import dev.inmo.tgbotapi.types.message.textsources.regular import dev.inmo.tgbotapi.utils.buildEntities +import kotlinx.coroutines.delay import kotlinx.coroutines.flow.first import kotlinx.serialization.Serializable import kotlinx.serialization.json.* @@ -108,6 +109,9 @@ object Plugin : Plugin { pollsToPostsIdsRepo.set(sent.content.poll.id, postId) pollsToMessageInfoRepo.set(sent.content.poll.id, sent.short()) }.getOrNull() ?: continue + + delay(500L) + panelApi ?.forceRefresh(postId) return true } @@ -139,6 +143,7 @@ object Plugin : Plugin { if (config.autoAttach) { postsRepo.newObjectsFlow.subscribeSafelyWithoutExceptions(this) { + delay(500L) attachPoll(it.id) } }