mirror of
https://github.com/InsanusMokrassar/PlaguPoster.git
synced 2024-12-22 05:57:13 +00:00
update dependencies
This commit is contained in:
parent
c64faf75d0
commit
7bc7bf6e8c
@ -2,9 +2,11 @@
|
||||
|
||||
## 0.1.1
|
||||
|
||||
* Update dependencies
|
||||
|
||||
## 0.0.10
|
||||
|
||||
## 0.0.9
|
||||
|
||||
* Update depedencies
|
||||
* Update dependencies
|
||||
|
||||
|
@ -3,13 +3,13 @@
|
||||
kotlin = "1.8.10"
|
||||
kotlin-serialization = "1.5.0"
|
||||
|
||||
plagubot = "5.0.0"
|
||||
tgbotapi = "7.0.0"
|
||||
plagubot = "5.0.1"
|
||||
tgbotapi = "7.0.1"
|
||||
microutils = "0.17.5"
|
||||
kslog = "1.0.0"
|
||||
krontab = "0.9.0"
|
||||
tgbotapi-libraries = "0.10.0"
|
||||
plagubot-plugins = "0.10.0"
|
||||
krontab = "0.10.0-branch_0.10.0-build171"
|
||||
tgbotapi-libraries = "0.10.1"
|
||||
plagubot-plugins = "0.10.1"
|
||||
|
||||
dokka = "1.8.10"
|
||||
|
||||
|
@ -1,10 +1,9 @@
|
||||
package dev.inmo.plaguposter.ratings.gc
|
||||
|
||||
import com.soywiz.klock.milliseconds
|
||||
import com.soywiz.klock.seconds
|
||||
import dev.inmo.krontab.KrontabTemplate
|
||||
import dev.inmo.krontab.toSchedule
|
||||
import dev.inmo.krontab.utils.asFlow
|
||||
import dev.inmo.krontab.utils.asFlowWithDelays
|
||||
import dev.inmo.micro_utils.coroutines.subscribeSafelyWithoutExceptions
|
||||
import dev.inmo.micro_utils.repos.*
|
||||
import dev.inmo.plagubot.Plugin
|
||||
@ -12,7 +11,6 @@ import dev.inmo.plaguposter.posts.repo.PostsRepo
|
||||
import dev.inmo.plaguposter.ratings.models.Rating
|
||||
import dev.inmo.plaguposter.ratings.repo.RatingsRepo
|
||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
|
||||
import dev.inmo.tgbotapi.types.MilliSeconds
|
||||
import dev.inmo.tgbotapi.types.Seconds
|
||||
import kotlinx.serialization.Serializable
|
||||
import kotlinx.serialization.json.*
|
||||
@ -50,7 +48,7 @@ object Plugin : Plugin {
|
||||
}
|
||||
}
|
||||
config.autoclear ?.let { autoclear ->
|
||||
autoclear.autoClearKrontab.toSchedule().asFlow().subscribeSafelyWithoutExceptions(scope) {
|
||||
autoclear.autoClearKrontab.toSchedule().asFlowWithDelays().subscribeSafelyWithoutExceptions(scope) {
|
||||
val dropCreatedBefore = it - (autoclear.skipPostAge ?: 0).seconds
|
||||
ratingsRepo.getPostsWithRatingLessEq(autoclear.rating).keys.forEach {
|
||||
if ((postsRepo.getPostCreationTime(it) ?: return@forEach) < dropCreatedBefore) {
|
||||
|
@ -2,7 +2,7 @@ package dev.inmo.plaguposter.triggers.selector_with_timer
|
||||
|
||||
import dev.inmo.krontab.KrontabTemplate
|
||||
import dev.inmo.krontab.toSchedule
|
||||
import dev.inmo.krontab.utils.asFlow
|
||||
import dev.inmo.krontab.utils.asFlowWithDelays
|
||||
import dev.inmo.micro_utils.coroutines.subscribeSafelyWithoutExceptions
|
||||
import dev.inmo.plagubot.Plugin
|
||||
import dev.inmo.plaguposter.posts.sending.PostPublisher
|
||||
@ -35,7 +35,7 @@ object Plugin : Plugin {
|
||||
val publisher = koin.get<PostPublisher>()
|
||||
val selector = koin.get<Selector>()
|
||||
val filters = koin.getAll<AutopostFilter>().distinct()
|
||||
koin.get<Config>().krontab.asFlow().subscribeSafelyWithoutExceptions(this) { dateTime ->
|
||||
koin.get<Config>().krontab.asFlowWithDelays().subscribeSafelyWithoutExceptions(this) { dateTime ->
|
||||
selector.take(now = dateTime).forEach { postId ->
|
||||
if (filters.all { it.check(postId, dateTime) }) {
|
||||
publisher.publish(postId)
|
||||
|
Loading…
Reference in New Issue
Block a user