1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2025-09-02 14:49:47 +00:00
This commit is contained in:
2025-07-21 22:55:36 +06:00
parent 2ba447b126
commit f7476188eb
5 changed files with 17 additions and 6 deletions

View File

@@ -13,7 +13,7 @@ ktor = "3.2.1"
ksp = "2.2.0-2.0.2"
kotlin-poet = "2.0.0"
microutils = "0.26.0"
microutils = "0.26.1"
kslog = "1.5.0"
versions = "0.52.0"

View File

@@ -3,6 +3,8 @@
package dev.inmo.tgbotapi.extensions.behaviour_builder.triggers_handling
import dev.inmo.micro_utils.coroutines.SpecialMutableStateFlow
import dev.inmo.micro_utils.coroutines.runCatchingLogging
import dev.inmo.micro_utils.coroutines.subscribeAsync
import dev.inmo.micro_utils.coroutines.subscribeLoggingDropExceptions
import dev.inmo.micro_utils.coroutines.subscribeSafelyWithoutExceptionsAsync
import dev.inmo.tgbotapi.extensions.behaviour_builder.*
@@ -69,12 +71,16 @@ internal fun <BC : BehaviourContext, T> BC.on(
createSubContextAndDoSynchronouslyWithUpdatesFilter(behaviourContextReceiver = { scenarioReceiver(triggerData) })
}
markerFactory ?.let {
subscribeSafelyWithoutExceptionsAsync(
subscribeAsync(
scope,
{ markerFactory(it.second) },
block = handler
)
} ?: subscribeLoggingDropExceptions(scope) {
logger = Log
) {
runCatchingLogging(logger = Log) {
handler(it)
}
}
} ?: subscribeLoggingDropExceptions(scope, logger = Log) {
scope.launchWithBotLogger {
handler(it)
}

View File

@@ -1,7 +1,8 @@
@file:Suppress("OPT_IN_USAGE")
package dev.inmo.tgbotapi.ksp.processor
import com.google.devtools.ksp.KspExperimental
import com.google.devtools.ksp.getAnnotationsByType
import com.google.devtools.ksp.isAnnotationPresent
import com.google.devtools.ksp.symbol.*
import com.squareup.kotlinpoet.*

View File

@@ -1,3 +1,5 @@
@file:Suppress("INLINE_CLASS_IN_EXTERNAL_DECLARATION_WARNING")
package dev.inmo.tgbotapi.webapps
import dev.inmo.tgbotapi.types.*

View File

@@ -1,3 +1,5 @@
@file:Suppress("INLINE_CLASS_IN_EXTERNAL_DECLARATION_WARNING")
package dev.inmo.tgbotapi.webapps
import dev.inmo.micro_utils.language_codes.IetfLang