mirror of
https://github.com/InsanusMokrassar/PlaguPoster.git
synced 2024-12-22 22:17:14 +00:00
small fixes
This commit is contained in:
parent
c47c7b09f4
commit
d605c8c650
@ -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.bold
|
||||||
import dev.inmo.tgbotapi.types.message.textsources.regular
|
import dev.inmo.tgbotapi.types.message.textsources.regular
|
||||||
import dev.inmo.tgbotapi.utils.buildEntities
|
import dev.inmo.tgbotapi.utils.buildEntities
|
||||||
|
import kotlinx.coroutines.delay
|
||||||
import kotlinx.coroutines.flow.first
|
import kotlinx.coroutines.flow.first
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
import kotlinx.serialization.json.*
|
import kotlinx.serialization.json.*
|
||||||
@ -108,6 +109,9 @@ object Plugin : Plugin {
|
|||||||
pollsToPostsIdsRepo.set(sent.content.poll.id, postId)
|
pollsToPostsIdsRepo.set(sent.content.poll.id, postId)
|
||||||
pollsToMessageInfoRepo.set(sent.content.poll.id, sent.short())
|
pollsToMessageInfoRepo.set(sent.content.poll.id, sent.short())
|
||||||
}.getOrNull() ?: continue
|
}.getOrNull() ?: continue
|
||||||
|
|
||||||
|
delay(500L)
|
||||||
|
|
||||||
panelApi ?.forceRefresh(postId)
|
panelApi ?.forceRefresh(postId)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
@ -139,6 +143,7 @@ object Plugin : Plugin {
|
|||||||
|
|
||||||
if (config.autoAttach) {
|
if (config.autoAttach) {
|
||||||
postsRepo.newObjectsFlow.subscribeSafelyWithoutExceptions(this) {
|
postsRepo.newObjectsFlow.subscribeSafelyWithoutExceptions(this) {
|
||||||
|
delay(500L)
|
||||||
attachPoll(it.id)
|
attachPoll(it.id)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user