mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2025-09-03 07:09:23 +00:00
remove suspend in all triggers
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
package dev.inmo.tgbotapi.extensions.behaviour_builder
|
||||
|
||||
import dev.inmo.kslog.common.KSLog
|
||||
import dev.inmo.micro_utils.coroutines.*
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.handlers_registrar.TriggersHolder
|
||||
@@ -153,12 +154,14 @@ fun <BC : BehaviourContext> BC.createSubContext(
|
||||
scope: CoroutineScope = LinkedSupervisorScope(),
|
||||
triggersHolder: TriggersHolder = this.triggersHolder,
|
||||
updatesUpstreamFlow: Flow<Update> = allUpdatesFlow,
|
||||
subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = this.subcontextInitialAction,
|
||||
subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BC, Unit, Update> = this.subcontextInitialAction,
|
||||
) = copy(
|
||||
scope = scope,
|
||||
upstreamUpdatesFlow = updatesUpstreamFlow,
|
||||
triggersHolder = triggersHolder,
|
||||
subcontextInitialAction = subcontextInitialAction
|
||||
subcontextInitialAction = {
|
||||
(this as BC).subcontextInitialAction(it)
|
||||
}
|
||||
) as BC
|
||||
|
||||
/**
|
||||
@@ -174,6 +177,52 @@ suspend fun <T, BC : BehaviourContext> BC.doInContext(
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Launch [behaviourContextReceiver] in context of [this] as [BehaviourContext] and as [kotlin.coroutines.CoroutineContext]
|
||||
*
|
||||
* [this] [BehaviourContext] will **NOT** be closed automatically
|
||||
*/
|
||||
suspend fun <T, BC : BehaviourContext> BC.doInNewSubContext(
|
||||
scope: CoroutineScope = LinkedSupervisorScope(),
|
||||
triggersHolder: TriggersHolder = this.triggersHolder,
|
||||
updatesUpstreamFlow: Flow<Update> = allUpdatesFlow,
|
||||
subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BC, Unit, Update> = this.subcontextInitialAction,
|
||||
behaviourContextReceiver: CustomBehaviourContextReceiver<BC, T>
|
||||
): T {
|
||||
return createSubContext(
|
||||
scope = scope,
|
||||
triggersHolder = triggersHolder,
|
||||
updatesUpstreamFlow = updatesUpstreamFlow,
|
||||
subcontextInitialAction = subcontextInitialAction
|
||||
).run {
|
||||
behaviourContextReceiver()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Launch [behaviourContextReceiver] in context of [this] as [BehaviourContext] and as [kotlin.coroutines.CoroutineContext]
|
||||
*
|
||||
* [this] [BehaviourContext] will **NOT** be closed automatically
|
||||
*/
|
||||
fun <T, BC : BehaviourContext> BC.launchInNewSubContext(
|
||||
scope: CoroutineScope = LinkedSupervisorScope(),
|
||||
triggersHolder: TriggersHolder = this.triggersHolder,
|
||||
updatesUpstreamFlow: Flow<Update> = allUpdatesFlow,
|
||||
subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BC, Unit, Update> = this.subcontextInitialAction,
|
||||
behaviourContextReceiver: CustomBehaviourContextReceiver<BC, T>
|
||||
): Job {
|
||||
return createSubContext(
|
||||
scope = scope,
|
||||
triggersHolder = triggersHolder,
|
||||
updatesUpstreamFlow = updatesUpstreamFlow,
|
||||
subcontextInitialAction = subcontextInitialAction
|
||||
).apply {
|
||||
launchLoggingDropExceptions(logger = Log ?: KSLog) {
|
||||
behaviourContextReceiver()
|
||||
}
|
||||
}.coroutineContext.job
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new one [BehaviourContext] using [createSubContext] and launches [behaviourContextReceiver] in a new context
|
||||
* using [doInContext].
|
||||
|
@@ -16,9 +16,9 @@ import kotlinx.coroutines.flow.mapNotNull
|
||||
typealias CommonMessageToContentMapper<T> = suspend CommonMessage<T>.() -> T?
|
||||
|
||||
@RiskFeature(lowLevelRiskFeatureMessage)
|
||||
inline fun BehaviourContext.waitContent(
|
||||
fun BehaviourContext.waitContent(
|
||||
initRequest: Request<*>? = null,
|
||||
noinline errorFactory: NullableRequestBuilder<*> = { null }
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
): Flow<MessageContent> = waitContentMessage(initRequest, errorFactory).map { it.content }
|
||||
|
||||
inline fun <reified T : MessageContent> Flow<MessageContent>.mapContent() = mapNotNull { it as? T }
|
||||
|
@@ -16,9 +16,9 @@ import kotlinx.coroutines.flow.mapNotNull
|
||||
typealias CommonMessageToCommonMessageMapper<T> = suspend CommonMessage<T>.() -> CommonMessage<T>?
|
||||
|
||||
@RiskFeature(lowLevelRiskFeatureMessage)
|
||||
inline fun BehaviourContext.waitContentMessage(
|
||||
fun BehaviourContext.waitContentMessage(
|
||||
initRequest: Request<*>? = null,
|
||||
noinline errorFactory: NullableRequestBuilder<*> = { null }
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
): Flow<CommonMessage<MessageContent>> = expectFlow(
|
||||
initRequest,
|
||||
errorFactory
|
||||
|
@@ -38,18 +38,18 @@ internal inline fun <BC : BehaviourContext, reified T : CallbackQuery> BC.onCall
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
internal suspend inline fun <BC : BehaviourContext, reified T : DataCallbackQuery> BC.onDataCallbackQueryCounted(
|
||||
internal inline fun <BC : BehaviourContext, reified T : DataCallbackQuery> BC.onDataCallbackQueryCounted(
|
||||
initialFilter: SimpleFilter<T>? = null,
|
||||
noinline subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, T, Update>? = CallbackQueryFilterByUser,
|
||||
markerFactory: MarkerFactory<in T, Any>? = ByUserCallbackQueryMarkerFactory,
|
||||
noinline additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, T>? = null,
|
||||
noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, T>
|
||||
): Job {
|
||||
): Job = launchInNewSubContext {
|
||||
val newInitialFilter = SimpleFilter<DataCallbackQuery> {
|
||||
it is T && initialFilter ?.invoke(it) ?: true
|
||||
it is T && initialFilter?.invoke(it) ?: true
|
||||
}::invoke
|
||||
return runCatching {
|
||||
onCallbackQuery (
|
||||
runCatching {
|
||||
onCallbackQuery(
|
||||
initialFilter,
|
||||
subcontextUpdatesFilter,
|
||||
markerFactory,
|
||||
@@ -83,7 +83,7 @@ internal suspend inline fun <BC : BehaviourContext, reified T : DataCallbackQuer
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onDataCallbackQuery(
|
||||
fun <BC : BehaviourContext> BC.onDataCallbackQuery(
|
||||
initialFilter: SimpleFilter<DataCallbackQuery>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, DataCallbackQuery, Update>? = CallbackQueryFilterByUser,
|
||||
markerFactory: MarkerFactory<in DataCallbackQuery, Any>? = ByUserCallbackQueryMarkerFactory,
|
||||
@@ -112,7 +112,7 @@ suspend fun <BC : BehaviourContext> BC.onDataCallbackQuery(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onDataCallbackQuery(
|
||||
fun <BC : BehaviourContext> BC.onDataCallbackQuery(
|
||||
dataRegex: Regex,
|
||||
initialFilter: SimpleFilter<DataCallbackQuery>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, DataCallbackQuery, Update>? = CallbackQueryFilterByUser,
|
||||
@@ -143,7 +143,7 @@ suspend fun <BC : BehaviourContext> BC.onDataCallbackQuery(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onDataCallbackQuery(
|
||||
fun <BC : BehaviourContext> BC.onDataCallbackQuery(
|
||||
data: String,
|
||||
initialFilter: SimpleFilter<DataCallbackQuery>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, DataCallbackQuery, Update>? = CallbackQueryFilterByUser,
|
||||
@@ -226,7 +226,7 @@ fun <BC : BehaviourContext> BC.onInlineMessageIdCallbackQuery(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onInlineMessageIdDataCallbackQuery(
|
||||
fun <BC : BehaviourContext> BC.onInlineMessageIdDataCallbackQuery(
|
||||
initialFilter: SimpleFilter<InlineMessageIdDataCallbackQuery>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, InlineMessageIdDataCallbackQuery, Update>? = CallbackQueryFilterByUser,
|
||||
markerFactory: MarkerFactory<in InlineMessageIdDataCallbackQuery, Any>? = ByUserCallbackQueryMarkerFactory,
|
||||
@@ -255,7 +255,7 @@ suspend fun <BC : BehaviourContext> BC.onInlineMessageIdDataCallbackQuery(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onInlineMessageIdDataCallbackQuery(
|
||||
fun <BC : BehaviourContext> BC.onInlineMessageIdDataCallbackQuery(
|
||||
dataRegex: Regex,
|
||||
initialFilter: SimpleFilter<InlineMessageIdDataCallbackQuery>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, InlineMessageIdDataCallbackQuery, Update>? = CallbackQueryFilterByUser,
|
||||
@@ -286,7 +286,7 @@ suspend fun <BC : BehaviourContext> BC.onInlineMessageIdDataCallbackQuery(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onInlineMessageIdDataCallbackQuery(
|
||||
fun <BC : BehaviourContext> BC.onInlineMessageIdDataCallbackQuery(
|
||||
data: String,
|
||||
initialFilter: SimpleFilter<InlineMessageIdDataCallbackQuery>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, InlineMessageIdDataCallbackQuery, Update>? = CallbackQueryFilterByUser,
|
||||
@@ -369,7 +369,7 @@ fun <BC : BehaviourContext> BC.onMessageCallbackQuery(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onMessageDataCallbackQuery(
|
||||
fun <BC : BehaviourContext> BC.onMessageDataCallbackQuery(
|
||||
initialFilter: SimpleFilter<MessageDataCallbackQuery>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MessageDataCallbackQuery, Update>? = CallbackQueryFilterByUser,
|
||||
markerFactory: MarkerFactory<in MessageDataCallbackQuery, Any>? = ByUserCallbackQueryMarkerFactory,
|
||||
@@ -398,7 +398,7 @@ suspend fun <BC : BehaviourContext> BC.onMessageDataCallbackQuery(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onMessageDataCallbackQuery(
|
||||
fun <BC : BehaviourContext> BC.onMessageDataCallbackQuery(
|
||||
dataRegex: Regex,
|
||||
initialFilter: SimpleFilter<MessageDataCallbackQuery>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MessageDataCallbackQuery, Update>? = CallbackQueryFilterByUser,
|
||||
@@ -429,7 +429,7 @@ suspend fun <BC : BehaviourContext> BC.onMessageDataCallbackQuery(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onMessageDataCallbackQuery(
|
||||
fun <BC : BehaviourContext> BC.onMessageDataCallbackQuery(
|
||||
data: String,
|
||||
initialFilter: SimpleFilter<MessageDataCallbackQuery>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MessageDataCallbackQuery, Update>? = CallbackQueryFilterByUser,
|
||||
@@ -485,7 +485,7 @@ fun <BC : BehaviourContext> BC.onMessageGameShortNameCallbackQuery(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onUnknownCallbackQueryType(
|
||||
fun <BC : BehaviourContext> BC.onUnknownCallbackQueryType(
|
||||
initialFilter: SimpleFilter<UnknownCallbackQueryType>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, UnknownCallbackQueryType, Update>? = CallbackQueryFilterByUser,
|
||||
markerFactory: MarkerFactory<in UnknownCallbackQueryType, Any>? = ByUserCallbackQueryMarkerFactory,
|
||||
|
@@ -469,7 +469,7 @@ fun <BC : BehaviourContext> BC.onChatMemberGotUnrestricted(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onChatMemberKicked(
|
||||
fun <BC : BehaviourContext> BC.onChatMemberKicked(
|
||||
initialFilter: SimpleFilter<ChatMemberUpdated>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatMemberUpdated, Update>? = ChatMemberUpdatedFilterByChat,
|
||||
markerFactory: MarkerFactory<ChatMemberUpdated, Any>? = ByChatChatMemberUpdatedMarkerFactory,
|
||||
@@ -496,7 +496,7 @@ suspend fun <BC : BehaviourContext> BC.onChatMemberKicked(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onCommonChatMemberJoined(
|
||||
fun <BC : BehaviourContext> BC.onCommonChatMemberJoined(
|
||||
initialFilter: SimpleFilter<ChatMemberUpdated>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatMemberUpdated, Update>? = ChatMemberUpdatedFilterByChat,
|
||||
markerFactory: MarkerFactory<ChatMemberUpdated, Any>? = ByChatChatMemberUpdatedMarkerFactory,
|
||||
@@ -523,7 +523,7 @@ suspend fun <BC : BehaviourContext> BC.onCommonChatMemberJoined(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onCommonChatMemberLeft(
|
||||
fun <BC : BehaviourContext> BC.onCommonChatMemberLeft(
|
||||
initialFilter: SimpleFilter<ChatMemberUpdated>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatMemberUpdated, Update>? = ChatMemberUpdatedFilterByChat,
|
||||
markerFactory: MarkerFactory<ChatMemberUpdated, Any>? = ByChatChatMemberUpdatedMarkerFactory,
|
||||
@@ -550,7 +550,7 @@ suspend fun <BC : BehaviourContext> BC.onCommonChatMemberLeft(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onCommonChatMemberSubscribed(
|
||||
fun <BC : BehaviourContext> BC.onCommonChatMemberSubscribed(
|
||||
initialFilter: SimpleFilter<ChatMemberUpdated>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatMemberUpdated, Update>? = ChatMemberUpdatedFilterByChat,
|
||||
markerFactory: MarkerFactory<ChatMemberUpdated, Any>? = ByChatChatMemberUpdatedMarkerFactory,
|
||||
@@ -577,7 +577,7 @@ suspend fun <BC : BehaviourContext> BC.onCommonChatMemberSubscribed(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onCommonChatMemberSubscriptionChanged(
|
||||
fun <BC : BehaviourContext> BC.onCommonChatMemberSubscriptionChanged(
|
||||
initialFilter: SimpleFilter<ChatMemberUpdated>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatMemberUpdated, Update>? = ChatMemberUpdatedFilterByChat,
|
||||
markerFactory: MarkerFactory<ChatMemberUpdated, Any>? = ByChatChatMemberUpdatedMarkerFactory,
|
||||
@@ -604,7 +604,7 @@ suspend fun <BC : BehaviourContext> BC.onCommonChatMemberSubscriptionChanged(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onCommonChatMemberUnsubscribed(
|
||||
fun <BC : BehaviourContext> BC.onCommonChatMemberUnsubscribed(
|
||||
initialFilter: SimpleFilter<ChatMemberUpdated>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatMemberUpdated, Update>? = ChatMemberUpdatedFilterByChat,
|
||||
markerFactory: MarkerFactory<ChatMemberUpdated, Any>? = ByChatChatMemberUpdatedMarkerFactory,
|
||||
@@ -631,7 +631,7 @@ suspend fun <BC : BehaviourContext> BC.onCommonChatMemberUnsubscribed(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onCommonChatMemberGotPromoted(
|
||||
fun <BC : BehaviourContext> BC.onCommonChatMemberGotPromoted(
|
||||
initialFilter: SimpleFilter<ChatMemberUpdated>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatMemberUpdated, Update>? = ChatMemberUpdatedFilterByChat,
|
||||
markerFactory: MarkerFactory<ChatMemberUpdated, Any>? = ByChatChatMemberUpdatedMarkerFactory,
|
||||
@@ -658,7 +658,7 @@ suspend fun <BC : BehaviourContext> BC.onCommonChatMemberGotPromoted(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onCommonChatMemberGotPromotionChanged(
|
||||
fun <BC : BehaviourContext> BC.onCommonChatMemberGotPromotionChanged(
|
||||
initialFilter: SimpleFilter<ChatMemberUpdated>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatMemberUpdated, Update>? = ChatMemberUpdatedFilterByChat,
|
||||
markerFactory: MarkerFactory<ChatMemberUpdated, Any>? = ByChatChatMemberUpdatedMarkerFactory,
|
||||
@@ -685,7 +685,7 @@ suspend fun <BC : BehaviourContext> BC.onCommonChatMemberGotPromotionChanged(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onCommonChatMemberGotDemoted(
|
||||
fun <BC : BehaviourContext> BC.onCommonChatMemberGotDemoted(
|
||||
initialFilter: SimpleFilter<ChatMemberUpdated>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatMemberUpdated, Update>? = ChatMemberUpdatedFilterByChat,
|
||||
markerFactory: MarkerFactory<ChatMemberUpdated, Any>? = ByChatChatMemberUpdatedMarkerFactory,
|
||||
@@ -712,7 +712,7 @@ suspend fun <BC : BehaviourContext> BC.onCommonChatMemberGotDemoted(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onCommonChatMemberBecameOwner(
|
||||
fun <BC : BehaviourContext> BC.onCommonChatMemberBecameOwner(
|
||||
initialFilter: SimpleFilter<ChatMemberUpdated>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatMemberUpdated, Update>? = ChatMemberUpdatedFilterByChat,
|
||||
markerFactory: MarkerFactory<ChatMemberUpdated, Any>? = ByChatChatMemberUpdatedMarkerFactory,
|
||||
@@ -739,7 +739,7 @@ suspend fun <BC : BehaviourContext> BC.onCommonChatMemberBecameOwner(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onCommonChatMemberCeasedOwnership(
|
||||
fun <BC : BehaviourContext> BC.onCommonChatMemberCeasedOwnership(
|
||||
initialFilter: SimpleFilter<ChatMemberUpdated>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatMemberUpdated, Update>? = ChatMemberUpdatedFilterByChat,
|
||||
markerFactory: MarkerFactory<ChatMemberUpdated, Any>? = ByChatChatMemberUpdatedMarkerFactory,
|
||||
@@ -766,7 +766,7 @@ suspend fun <BC : BehaviourContext> BC.onCommonChatMemberCeasedOwnership(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onCommonChatMemberGotRestricted(
|
||||
fun <BC : BehaviourContext> BC.onCommonChatMemberGotRestricted(
|
||||
initialFilter: SimpleFilter<ChatMemberUpdated>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatMemberUpdated, Update>? = ChatMemberUpdatedFilterByChat,
|
||||
markerFactory: MarkerFactory<ChatMemberUpdated, Any>? = ByChatChatMemberUpdatedMarkerFactory,
|
||||
@@ -793,7 +793,7 @@ suspend fun <BC : BehaviourContext> BC.onCommonChatMemberGotRestricted(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onCommonChatMemberGotRestrictionChanged(
|
||||
fun <BC : BehaviourContext> BC.onCommonChatMemberGotRestrictionChanged(
|
||||
initialFilter: SimpleFilter<ChatMemberUpdated>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatMemberUpdated, Update>? = ChatMemberUpdatedFilterByChat,
|
||||
markerFactory: MarkerFactory<ChatMemberUpdated, Any>? = ByChatChatMemberUpdatedMarkerFactory,
|
||||
@@ -820,7 +820,7 @@ suspend fun <BC : BehaviourContext> BC.onCommonChatMemberGotRestrictionChanged(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onCommonChatMemberGotUnrestricted(
|
||||
fun <BC : BehaviourContext> BC.onCommonChatMemberGotUnrestricted(
|
||||
initialFilter: SimpleFilter<ChatMemberUpdated>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatMemberUpdated, Update>? = ChatMemberUpdatedFilterByChat,
|
||||
markerFactory: MarkerFactory<ChatMemberUpdated, Any>? = ByChatChatMemberUpdatedMarkerFactory,
|
||||
@@ -847,7 +847,7 @@ suspend fun <BC : BehaviourContext> BC.onCommonChatMemberGotUnrestricted(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onCommonChatMemberKicked(
|
||||
fun <BC : BehaviourContext> BC.onCommonChatMemberKicked(
|
||||
initialFilter: SimpleFilter<ChatMemberUpdated>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatMemberUpdated, Update>? = ChatMemberUpdatedFilterByChat,
|
||||
markerFactory: MarkerFactory<ChatMemberUpdated, Any>? = ByChatChatMemberUpdatedMarkerFactory,
|
||||
@@ -874,7 +874,7 @@ suspend fun <BC : BehaviourContext> BC.onCommonChatMemberKicked(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onMyChatMemberJoined(
|
||||
fun <BC : BehaviourContext> BC.onMyChatMemberJoined(
|
||||
initialFilter: SimpleFilter<ChatMemberUpdated>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatMemberUpdated, Update>? = ChatMemberUpdatedFilterByChat,
|
||||
markerFactory: MarkerFactory<ChatMemberUpdated, Any>? = ByChatChatMemberUpdatedMarkerFactory,
|
||||
@@ -901,7 +901,7 @@ suspend fun <BC : BehaviourContext> BC.onMyChatMemberJoined(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onMyChatMemberLeft(
|
||||
fun <BC : BehaviourContext> BC.onMyChatMemberLeft(
|
||||
initialFilter: SimpleFilter<ChatMemberUpdated>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatMemberUpdated, Update>? = ChatMemberUpdatedFilterByChat,
|
||||
markerFactory: MarkerFactory<ChatMemberUpdated, Any>? = ByChatChatMemberUpdatedMarkerFactory,
|
||||
@@ -928,7 +928,7 @@ suspend fun <BC : BehaviourContext> BC.onMyChatMemberLeft(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onMyChatMemberSubscribed(
|
||||
fun <BC : BehaviourContext> BC.onMyChatMemberSubscribed(
|
||||
initialFilter: SimpleFilter<ChatMemberUpdated>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatMemberUpdated, Update>? = ChatMemberUpdatedFilterByChat,
|
||||
markerFactory: MarkerFactory<ChatMemberUpdated, Any>? = ByChatChatMemberUpdatedMarkerFactory,
|
||||
@@ -955,7 +955,7 @@ suspend fun <BC : BehaviourContext> BC.onMyChatMemberSubscribed(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onMyChatMemberSubscriptionChanged(
|
||||
fun <BC : BehaviourContext> BC.onMyChatMemberSubscriptionChanged(
|
||||
initialFilter: SimpleFilter<ChatMemberUpdated>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatMemberUpdated, Update>? = ChatMemberUpdatedFilterByChat,
|
||||
markerFactory: MarkerFactory<ChatMemberUpdated, Any>? = ByChatChatMemberUpdatedMarkerFactory,
|
||||
@@ -982,7 +982,7 @@ suspend fun <BC : BehaviourContext> BC.onMyChatMemberSubscriptionChanged(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onMyChatMemberUnsubscribed(
|
||||
fun <BC : BehaviourContext> BC.onMyChatMemberUnsubscribed(
|
||||
initialFilter: SimpleFilter<ChatMemberUpdated>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatMemberUpdated, Update>? = ChatMemberUpdatedFilterByChat,
|
||||
markerFactory: MarkerFactory<ChatMemberUpdated, Any>? = ByChatChatMemberUpdatedMarkerFactory,
|
||||
@@ -1009,7 +1009,7 @@ suspend fun <BC : BehaviourContext> BC.onMyChatMemberUnsubscribed(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onMyChatMemberGotPromoted(
|
||||
fun <BC : BehaviourContext> BC.onMyChatMemberGotPromoted(
|
||||
initialFilter: SimpleFilter<ChatMemberUpdated>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatMemberUpdated, Update>? = ChatMemberUpdatedFilterByChat,
|
||||
markerFactory: MarkerFactory<ChatMemberUpdated, Any>? = ByChatChatMemberUpdatedMarkerFactory,
|
||||
@@ -1036,7 +1036,7 @@ suspend fun <BC : BehaviourContext> BC.onMyChatMemberGotPromoted(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onMyChatMemberGotPromotionChanged(
|
||||
fun <BC : BehaviourContext> BC.onMyChatMemberGotPromotionChanged(
|
||||
initialFilter: SimpleFilter<ChatMemberUpdated>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatMemberUpdated, Update>? = ChatMemberUpdatedFilterByChat,
|
||||
markerFactory: MarkerFactory<ChatMemberUpdated, Any>? = ByChatChatMemberUpdatedMarkerFactory,
|
||||
@@ -1063,7 +1063,7 @@ suspend fun <BC : BehaviourContext> BC.onMyChatMemberGotPromotionChanged(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onMyChatMemberGotDemoted(
|
||||
fun <BC : BehaviourContext> BC.onMyChatMemberGotDemoted(
|
||||
initialFilter: SimpleFilter<ChatMemberUpdated>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatMemberUpdated, Update>? = ChatMemberUpdatedFilterByChat,
|
||||
markerFactory: MarkerFactory<ChatMemberUpdated, Any>? = ByChatChatMemberUpdatedMarkerFactory,
|
||||
@@ -1090,7 +1090,7 @@ suspend fun <BC : BehaviourContext> BC.onMyChatMemberGotDemoted(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onMyChatMemberBecameOwner(
|
||||
fun <BC : BehaviourContext> BC.onMyChatMemberBecameOwner(
|
||||
initialFilter: SimpleFilter<ChatMemberUpdated>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatMemberUpdated, Update>? = ChatMemberUpdatedFilterByChat,
|
||||
markerFactory: MarkerFactory<ChatMemberUpdated, Any>? = ByChatChatMemberUpdatedMarkerFactory,
|
||||
@@ -1117,7 +1117,7 @@ suspend fun <BC : BehaviourContext> BC.onMyChatMemberBecameOwner(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onMyChatMemberCeasedOwnership(
|
||||
fun <BC : BehaviourContext> BC.onMyChatMemberCeasedOwnership(
|
||||
initialFilter: SimpleFilter<ChatMemberUpdated>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatMemberUpdated, Update>? = ChatMemberUpdatedFilterByChat,
|
||||
markerFactory: MarkerFactory<ChatMemberUpdated, Any>? = ByChatChatMemberUpdatedMarkerFactory,
|
||||
@@ -1144,7 +1144,7 @@ suspend fun <BC : BehaviourContext> BC.onMyChatMemberCeasedOwnership(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onMyChatMemberGotRestricted(
|
||||
fun <BC : BehaviourContext> BC.onMyChatMemberGotRestricted(
|
||||
initialFilter: SimpleFilter<ChatMemberUpdated>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatMemberUpdated, Update>? = ChatMemberUpdatedFilterByChat,
|
||||
markerFactory: MarkerFactory<ChatMemberUpdated, Any>? = ByChatChatMemberUpdatedMarkerFactory,
|
||||
@@ -1171,7 +1171,7 @@ suspend fun <BC : BehaviourContext> BC.onMyChatMemberGotRestricted(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onMyChatMemberGotRestrictionChanged(
|
||||
fun <BC : BehaviourContext> BC.onMyChatMemberGotRestrictionChanged(
|
||||
initialFilter: SimpleFilter<ChatMemberUpdated>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatMemberUpdated, Update>? = ChatMemberUpdatedFilterByChat,
|
||||
markerFactory: MarkerFactory<ChatMemberUpdated, Any>? = ByChatChatMemberUpdatedMarkerFactory,
|
||||
@@ -1198,7 +1198,7 @@ suspend fun <BC : BehaviourContext> BC.onMyChatMemberGotRestrictionChanged(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onMyChatMemberGotUnrestricted(
|
||||
fun <BC : BehaviourContext> BC.onMyChatMemberGotUnrestricted(
|
||||
initialFilter: SimpleFilter<ChatMemberUpdated>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatMemberUpdated, Update>? = ChatMemberUpdatedFilterByChat,
|
||||
markerFactory: MarkerFactory<ChatMemberUpdated, Any>? = ByChatChatMemberUpdatedMarkerFactory,
|
||||
@@ -1225,7 +1225,7 @@ suspend fun <BC : BehaviourContext> BC.onMyChatMemberGotUnrestricted(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onMyChatMemberKicked(
|
||||
fun <BC : BehaviourContext> BC.onMyChatMemberKicked(
|
||||
initialFilter: SimpleFilter<ChatMemberUpdated>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatMemberUpdated, Update>? = ChatMemberUpdatedFilterByChat,
|
||||
markerFactory: MarkerFactory<ChatMemberUpdated, Any>? = ByChatChatMemberUpdatedMarkerFactory,
|
||||
|
@@ -2,6 +2,8 @@
|
||||
|
||||
package dev.inmo.tgbotapi.extensions.behaviour_builder.triggers_handling
|
||||
|
||||
import dev.inmo.kslog.common.KSLog
|
||||
import dev.inmo.micro_utils.coroutines.launchLoggingDropExceptions
|
||||
import dev.inmo.micro_utils.coroutines.launchSafelyWithoutExceptions
|
||||
import dev.inmo.micro_utils.coroutines.runCatchingSafely
|
||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.*
|
||||
@@ -19,6 +21,7 @@ import dev.inmo.tgbotapi.types.message.content.TextContent
|
||||
import dev.inmo.tgbotapi.types.message.content.TextMessage
|
||||
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
||||
import kotlinx.coroutines.Job
|
||||
import kotlinx.coroutines.job
|
||||
|
||||
internal fun <BC : BehaviourContext> BC.commandUncounted(
|
||||
commandRegex: Regex,
|
||||
@@ -49,7 +52,7 @@ internal fun <BC : BehaviourContext> BC.commandUncounted(
|
||||
scenarioReceiver
|
||||
)
|
||||
|
||||
suspend fun <BC : BehaviourContext> BC.command(
|
||||
fun <BC : BehaviourContext> BC.command(
|
||||
commandRegex: Regex,
|
||||
requireOnlyCommandInMessage: Boolean = true,
|
||||
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||
@@ -57,35 +60,37 @@ suspend fun <BC : BehaviourContext> BC.command(
|
||||
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
|
||||
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
|
||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage>
|
||||
): Job = runCatching {
|
||||
commandUncounted(
|
||||
commandRegex,
|
||||
requireOnlyCommandInMessage,
|
||||
initialFilter,
|
||||
subcontextUpdatesFilter,
|
||||
markerFactory,
|
||||
additionalSubcontextInitialAction,
|
||||
scenarioReceiver
|
||||
)
|
||||
}.onFailure {
|
||||
triggersHolder.handleableCommandsHolder.unregisterHandleable(commandRegex)
|
||||
}.onSuccess {
|
||||
triggersHolder.handleableCommandsHolder.registerHandleable(commandRegex)
|
||||
it.invokeOnCompletion {
|
||||
runCatching {
|
||||
launchSafelyWithoutExceptions {
|
||||
triggersHolder.handleableCommandsHolder.unregisterHandleable(commandRegex)
|
||||
): Job = launchInNewSubContext {
|
||||
runCatching {
|
||||
this@launchInNewSubContext.commandUncounted(
|
||||
commandRegex,
|
||||
requireOnlyCommandInMessage,
|
||||
initialFilter,
|
||||
subcontextUpdatesFilter,
|
||||
markerFactory,
|
||||
additionalSubcontextInitialAction,
|
||||
scenarioReceiver
|
||||
)
|
||||
}.onFailure {
|
||||
triggersHolder.handleableCommandsHolder.unregisterHandleable(commandRegex)
|
||||
}.onSuccess {
|
||||
triggersHolder.handleableCommandsHolder.registerHandleable(commandRegex)
|
||||
it.invokeOnCompletion {
|
||||
runCatching {
|
||||
launchSafelyWithoutExceptions {
|
||||
triggersHolder.handleableCommandsHolder.unregisterHandleable(commandRegex)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}.getOrThrow()
|
||||
}.getOrThrow()
|
||||
}
|
||||
|
||||
/**
|
||||
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
|
||||
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||
* "stream"
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.command(
|
||||
fun <BC : BehaviourContext> BC.command(
|
||||
command: String,
|
||||
requireOnlyCommandInMessage: Boolean = true,
|
||||
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||
@@ -100,7 +105,7 @@ suspend fun <BC : BehaviourContext> BC.command(
|
||||
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||
* "stream"
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.command(
|
||||
fun <BC : BehaviourContext> BC.command(
|
||||
botCommand: BotCommand,
|
||||
requireOnlyCommandInMessage: Boolean = true,
|
||||
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||
@@ -115,7 +120,7 @@ suspend fun <BC : BehaviourContext> BC.command(
|
||||
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||
* "stream"
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onCommand(
|
||||
fun <BC : BehaviourContext> BC.onCommand(
|
||||
commandRegex: Regex,
|
||||
requireOnlyCommandInMessage: Boolean = true,
|
||||
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||
@@ -130,7 +135,7 @@ suspend fun <BC : BehaviourContext> BC.onCommand(
|
||||
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||
* "stream"
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onCommand(
|
||||
fun <BC : BehaviourContext> BC.onCommand(
|
||||
command: String,
|
||||
requireOnlyCommandInMessage: Boolean = true,
|
||||
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||
@@ -145,7 +150,7 @@ suspend fun <BC : BehaviourContext> BC.onCommand(
|
||||
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||
* "stream"
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onCommand(
|
||||
fun <BC : BehaviourContext> BC.onCommand(
|
||||
botCommand: BotCommand,
|
||||
requireOnlyCommandInMessage: Boolean = true,
|
||||
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||
@@ -160,7 +165,7 @@ suspend fun <BC : BehaviourContext> BC.onCommand(
|
||||
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||
* "stream"
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.commandWithArgs(
|
||||
fun <BC : BehaviourContext> BC.commandWithArgs(
|
||||
commandRegex: Regex,
|
||||
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
||||
@@ -187,7 +192,7 @@ suspend fun <BC : BehaviourContext> BC.commandWithArgs(
|
||||
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||
* "stream"
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.commandWithArgs(
|
||||
fun <BC : BehaviourContext> BC.commandWithArgs(
|
||||
command: String,
|
||||
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
||||
@@ -209,7 +214,7 @@ suspend fun <BC : BehaviourContext> BC.commandWithArgs(
|
||||
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||
* "stream"
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.commandWithArgs(
|
||||
fun <BC : BehaviourContext> BC.commandWithArgs(
|
||||
botCommand: BotCommand,
|
||||
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
||||
@@ -231,7 +236,7 @@ suspend fun <BC : BehaviourContext> BC.commandWithArgs(
|
||||
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||
* "stream"
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.commandWithNamedArgs(
|
||||
fun <BC : BehaviourContext> BC.commandWithNamedArgs(
|
||||
commandRegex: Regex,
|
||||
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
||||
@@ -259,7 +264,7 @@ suspend fun <BC : BehaviourContext> BC.commandWithNamedArgs(
|
||||
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||
* "stream"
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.commandWithNamedArgs(
|
||||
fun <BC : BehaviourContext> BC.commandWithNamedArgs(
|
||||
command: String,
|
||||
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
||||
@@ -283,7 +288,7 @@ suspend fun <BC : BehaviourContext> BC.commandWithNamedArgs(
|
||||
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||
* "stream"
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.commandWithNamedArgs(
|
||||
fun <BC : BehaviourContext> BC.commandWithNamedArgs(
|
||||
botCommand: BotCommand,
|
||||
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
||||
@@ -307,7 +312,7 @@ suspend fun <BC : BehaviourContext> BC.commandWithNamedArgs(
|
||||
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||
* "stream"
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onCommandWithArgs(
|
||||
fun <BC : BehaviourContext> BC.onCommandWithArgs(
|
||||
commandRegex: Regex,
|
||||
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
||||
@@ -329,7 +334,7 @@ suspend fun <BC : BehaviourContext> BC.onCommandWithArgs(
|
||||
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||
* "stream"
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onCommandWithArgs(
|
||||
fun <BC : BehaviourContext> BC.onCommandWithArgs(
|
||||
command: String,
|
||||
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
||||
@@ -351,7 +356,7 @@ suspend fun <BC : BehaviourContext> BC.onCommandWithArgs(
|
||||
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||
* "stream"
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onCommandWithArgs(
|
||||
fun <BC : BehaviourContext> BC.onCommandWithArgs(
|
||||
botCommand: BotCommand,
|
||||
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
||||
@@ -373,7 +378,7 @@ suspend fun <BC : BehaviourContext> BC.onCommandWithArgs(
|
||||
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||
* "stream"
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onCommandWithNamedArgs(
|
||||
fun <BC : BehaviourContext> BC.onCommandWithNamedArgs(
|
||||
commandRegex: Regex,
|
||||
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
||||
@@ -397,7 +402,7 @@ suspend fun <BC : BehaviourContext> BC.onCommandWithNamedArgs(
|
||||
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||
* "stream"
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onCommandWithNamedArgs(
|
||||
fun <BC : BehaviourContext> BC.onCommandWithNamedArgs(
|
||||
command: String,
|
||||
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
||||
@@ -421,7 +426,7 @@ suspend fun <BC : BehaviourContext> BC.onCommandWithNamedArgs(
|
||||
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||
* "stream"
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onCommandWithNamedArgs(
|
||||
fun <BC : BehaviourContext> BC.onCommandWithNamedArgs(
|
||||
botCommand: BotCommand,
|
||||
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
||||
|
@@ -319,7 +319,7 @@ fun <BC : BehaviourContext> BC.onStory(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onTextedContent(
|
||||
fun <BC : BehaviourContext> BC.onTextedContent(
|
||||
initialFilter: CommonMessageFilter<TextedContent>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextedMessage, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in TextedMessage, Any>? = ByChatMessageMarkerFactory,
|
||||
@@ -346,7 +346,7 @@ suspend fun <BC : BehaviourContext> BC.onTextedContent(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onVenue(
|
||||
fun <BC : BehaviourContext> BC.onVenue(
|
||||
initialFilter: CommonMessageFilter<VenueContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, VenueMessage, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in VenueMessage, Any>? = ByChatMessageMarkerFactory,
|
||||
@@ -373,7 +373,7 @@ suspend fun <BC : BehaviourContext> BC.onVenue(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onAudioMediaGroup(
|
||||
fun <BC : BehaviourContext> BC.onAudioMediaGroup(
|
||||
initialFilter: CommonMessageFilter<AudioMediaGroupPartContent>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, AudioMediaGroupMessage, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in AudioMediaGroupMessage, Any>? = ByChatMessageMarkerFactory,
|
||||
@@ -400,7 +400,7 @@ suspend fun <BC : BehaviourContext> BC.onAudioMediaGroup(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onDocumentMediaGroupContent(
|
||||
fun <BC : BehaviourContext> BC.onDocumentMediaGroupContent(
|
||||
initialFilter: CommonMessageFilter<DocumentMediaGroupPartContent>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, DocumentMediaGroupMessage, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in DocumentMediaGroupMessage, Any>? = ByChatMessageMarkerFactory,
|
||||
@@ -427,7 +427,7 @@ suspend fun <BC : BehaviourContext> BC.onDocumentMediaGroupContent(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onTextedMediaContent(
|
||||
fun <BC : BehaviourContext> BC.onTextedMediaContent(
|
||||
initialFilter: CommonMessageFilter<TextedMediaContent>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextedMediaMessage, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in TextedMediaMessage, Any>? = ByChatMessageMarkerFactory,
|
||||
@@ -454,7 +454,7 @@ suspend fun <BC : BehaviourContext> BC.onTextedMediaContent(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onMediaCollection(
|
||||
fun <BC : BehaviourContext> BC.onMediaCollection(
|
||||
initialFilter: CommonMessageFilter<MediaCollectionContent<TelegramMediaFile>>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MediaCollectionMessage<TelegramMediaFile>, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in MediaCollectionMessage<TelegramMediaFile>, Any>? = ByChatMessageMarkerFactory,
|
||||
@@ -481,7 +481,7 @@ suspend fun <BC : BehaviourContext> BC.onMediaCollection(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onMedia(
|
||||
fun <BC : BehaviourContext> BC.onMedia(
|
||||
initialFilter: CommonMessageFilter<MediaContent>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MediaMessage, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in MediaMessage, Any>? = ByChatMessageMarkerFactory,
|
||||
@@ -508,7 +508,7 @@ suspend fun <BC : BehaviourContext> BC.onMedia(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onAnimation(
|
||||
fun <BC : BehaviourContext> BC.onAnimation(
|
||||
initialFilter: CommonMessageFilter<AnimationContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, AnimationMessage, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in AnimationMessage, Any>? = ByChatMessageMarkerFactory,
|
||||
@@ -535,7 +535,7 @@ suspend fun <BC : BehaviourContext> BC.onAnimation(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onAudio(
|
||||
fun <BC : BehaviourContext> BC.onAudio(
|
||||
initialFilter: CommonMessageFilter<AudioContent>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, AudioMessage, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in AudioMessage, Any>? = ByChatMessageMarkerFactory,
|
||||
@@ -562,7 +562,7 @@ suspend fun <BC : BehaviourContext> BC.onAudio(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onDocument(
|
||||
fun <BC : BehaviourContext> BC.onDocument(
|
||||
initialFilter: CommonMessageFilter<DocumentContent>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, DocumentMessage, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in DocumentMessage, Any>? = ByChatMessageMarkerFactory,
|
||||
@@ -589,7 +589,7 @@ suspend fun <BC : BehaviourContext> BC.onDocument(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onPhoto(
|
||||
fun <BC : BehaviourContext> BC.onPhoto(
|
||||
initialFilter: CommonMessageFilter<PhotoContent>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, PhotoMessage, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in PhotoMessage, Any>? = ByChatMessageMarkerFactory,
|
||||
@@ -616,7 +616,7 @@ suspend fun <BC : BehaviourContext> BC.onPhoto(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onSticker(
|
||||
fun <BC : BehaviourContext> BC.onSticker(
|
||||
initialFilter: CommonMessageFilter<StickerContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, StickerMessage, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in StickerMessage, Any>? = ByChatMessageMarkerFactory,
|
||||
@@ -643,7 +643,7 @@ suspend fun <BC : BehaviourContext> BC.onSticker(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onVideo(
|
||||
fun <BC : BehaviourContext> BC.onVideo(
|
||||
initialFilter: CommonMessageFilter<VideoContent>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, VideoMessage, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in VideoMessage, Any>? = ByChatMessageMarkerFactory,
|
||||
@@ -670,7 +670,7 @@ suspend fun <BC : BehaviourContext> BC.onVideo(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onVideoNote(
|
||||
fun <BC : BehaviourContext> BC.onVideoNote(
|
||||
initialFilter: CommonMessageFilter<VideoNoteContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, VideoNoteMessage, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in VideoNoteMessage, Any>? = ByChatMessageMarkerFactory,
|
||||
@@ -697,7 +697,7 @@ suspend fun <BC : BehaviourContext> BC.onVideoNote(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onVoice(
|
||||
fun <BC : BehaviourContext> BC.onVoice(
|
||||
initialFilter: CommonMessageFilter<VoiceContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, VoiceMessage, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in VoiceMessage, Any>? = ByChatMessageMarkerFactory,
|
||||
@@ -724,7 +724,7 @@ suspend fun <BC : BehaviourContext> BC.onVoice(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onInvoice(
|
||||
fun <BC : BehaviourContext> BC.onInvoice(
|
||||
initialFilter: CommonMessageFilter<InvoiceContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, InvoiceMessage, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in InvoiceMessage, Any>? = ByChatMessageMarkerFactory,
|
||||
@@ -751,7 +751,7 @@ suspend fun <BC : BehaviourContext> BC.onInvoice(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onVisualContent(
|
||||
fun <BC : BehaviourContext> BC.onVisualContent(
|
||||
initialFilter: CommonMessageFilter<VisualMediaGroupPartContent>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, VisualMediaGroupMessage, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in VisualMediaGroupMessage, Any>? = ByChatMessageMarkerFactory,
|
||||
@@ -778,7 +778,7 @@ suspend fun <BC : BehaviourContext> BC.onVisualContent(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onMediaContent(
|
||||
fun <BC : BehaviourContext> BC.onMediaContent(
|
||||
initialFilter: CommonMessageFilter<MediaContent>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MediaMessage, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in MediaMessage, Any>? = ByChatMessageMarkerFactory,
|
||||
@@ -805,7 +805,7 @@ suspend fun <BC : BehaviourContext> BC.onMediaContent(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onGiveawayContent(
|
||||
fun <BC : BehaviourContext> BC.onGiveawayContent(
|
||||
initialFilter: CommonMessageFilter<GiveawayContent>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ScheduledGiveawayContentMessage, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in ScheduledGiveawayContentMessage, Any>? = ByChatMessageMarkerFactory,
|
||||
@@ -833,7 +833,7 @@ suspend fun <BC : BehaviourContext> BC.onGiveawayContent(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onGiveawayPublicResultsContent(
|
||||
fun <BC : BehaviourContext> BC.onGiveawayPublicResultsContent(
|
||||
initialFilter: CommonMessageFilter<GiveawayPublicResultsContent>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, GiveawayPublicResultsContentMessage, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in GiveawayPublicResultsContentMessage, Any>? = ByChatMessageMarkerFactory,
|
||||
@@ -862,7 +862,7 @@ suspend fun <BC : BehaviourContext> BC.onGiveawayPublicResultsContent(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onGiveawayWinners(
|
||||
fun <BC : BehaviourContext> BC.onGiveawayWinners(
|
||||
initialFilter: CommonMessageFilter<GiveawayPublicResultsContent>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, GiveawayPublicResultsContentMessage, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in GiveawayPublicResultsContentMessage, Any>? = ByChatMessageMarkerFactory,
|
||||
@@ -886,7 +886,7 @@ suspend fun <BC : BehaviourContext> BC.onGiveawayWinners(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onPaidMediaInfoContent(
|
||||
fun <BC : BehaviourContext> BC.onPaidMediaInfoContent(
|
||||
initialFilter: CommonMessageFilter<PaidMediaInfoContent>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, PaidMediaInfoContentMessage, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in PaidMediaInfoContentMessage, Any>? = ByChatMessageMarkerFactory,
|
||||
|
@@ -19,30 +19,32 @@ import io.ktor.http.decodeURLQueryComponent
|
||||
import kotlinx.coroutines.Job
|
||||
|
||||
private val startRegex = Regex("start")
|
||||
suspend fun <BC : BehaviourContext> BC.onDeepLink(
|
||||
fun <BC : BehaviourContext> BC.onDeepLink(
|
||||
initialFilter: SimpleFilter<Pair<TextMessage, String>>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, Pair<TextMessage, String>, Update>? = { (message, _), update -> MessageFilterByChat(this, message, update) },
|
||||
markerFactory: MarkerFactory<Pair<TextMessage, String>, Any>? = MarkerFactory { (message, _) -> ByChatMessageMarkerFactory(message) },
|
||||
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, Pair<TextMessage, String>>? = null,
|
||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, Pair<TextMessage, String>>
|
||||
): Job = on(
|
||||
markerFactory,
|
||||
SimpleFilter<Pair<TextMessage, String>> { (message, _) ->
|
||||
message.content.textSources.size == 2
|
||||
&& message.content.textSources.firstOrNull() ?.asBotCommandTextSource() ?.command == "start"
|
||||
&& message.content.textSources.getOrNull(1) is RegularTextSource
|
||||
} * initialFilter,
|
||||
subcontextUpdatesFilter,
|
||||
additionalSubcontextInitialAction,
|
||||
scenarioReceiver,
|
||||
) {
|
||||
(it.messageUpdateOrNull()) ?.data ?.commonMessageOrNull() ?.withContentOrNull<TextContent>() ?.let { message ->
|
||||
message to (message.content.textSources.getOrNull(1) ?.source ?.removePrefix(" ") ?.decodeURLQueryComponent() ?: return@let null)
|
||||
} ?.let(::listOfNotNull)
|
||||
}.also {
|
||||
triggersHolder.handleableCommandsHolder.registerHandleable(startRegex)
|
||||
it.invokeOnCompletion {
|
||||
this@onDeepLink.launchSafelyWithoutExceptions { triggersHolder.handleableCommandsHolder.unregisterHandleable(startRegex) }
|
||||
): Job = launchInNewSubContext {
|
||||
on(
|
||||
markerFactory,
|
||||
SimpleFilter<Pair<TextMessage, String>> { (message, _) ->
|
||||
message.content.textSources.size == 2
|
||||
&& message.content.textSources.firstOrNull() ?.asBotCommandTextSource() ?.command == "start"
|
||||
&& message.content.textSources.getOrNull(1) is RegularTextSource
|
||||
} * initialFilter,
|
||||
subcontextUpdatesFilter,
|
||||
additionalSubcontextInitialAction,
|
||||
scenarioReceiver,
|
||||
) {
|
||||
(it.messageUpdateOrNull()) ?.data ?.commonMessageOrNull() ?.withContentOrNull<TextContent>() ?.let { message ->
|
||||
message to (message.content.textSources.getOrNull(1) ?.source ?.removePrefix(" ") ?.decodeURLQueryComponent() ?: return@let null)
|
||||
} ?.let(::listOfNotNull)
|
||||
}.also {
|
||||
triggersHolder.handleableCommandsHolder.registerHandleable(startRegex)
|
||||
it.invokeOnCompletion {
|
||||
this@onDeepLink.launchSafelyWithoutExceptions { triggersHolder.handleableCommandsHolder.unregisterHandleable(startRegex) }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,7 +53,7 @@ suspend fun <BC : BehaviourContext> BC.onDeepLink(
|
||||
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||
* "stream"
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onDeepLink(
|
||||
fun <BC : BehaviourContext> BC.onDeepLink(
|
||||
regex: Regex,
|
||||
initialFilter: SimpleFilter<Pair<TextMessage, String>>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, Pair<TextMessage, String>, Update>? = { (message, _), update -> MessageFilterByChat(this, message, update) },
|
||||
@@ -70,7 +72,7 @@ suspend fun <BC : BehaviourContext> BC.onDeepLink(
|
||||
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||
* "stream"
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onDeepLink(
|
||||
fun <BC : BehaviourContext> BC.onDeepLink(
|
||||
deepLink: String,
|
||||
initialFilter: SimpleFilter<Pair<TextMessage, String>>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, Pair<TextMessage, String>, Update>? = { (message, _), update -> MessageFilterByChat(this, message, update) },
|
||||
|
@@ -281,7 +281,7 @@ fun <BC : BehaviourContext> BC.onEditedDocumentMediaGroupContent(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onEditedTextedMediaContent(
|
||||
fun <BC : BehaviourContext> BC.onEditedTextedMediaContent(
|
||||
initialFilter: CommonMessageFilter<TextedMediaContent>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextedMediaMessage, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in TextedMediaMessage, Any>? = ByChatMessageMarkerFactory,
|
||||
@@ -308,7 +308,7 @@ suspend fun <BC : BehaviourContext> BC.onEditedTextedMediaContent(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onEditedMediaCollection(
|
||||
fun <BC : BehaviourContext> BC.onEditedMediaCollection(
|
||||
initialFilter: CommonMessageFilter<MediaCollectionContent<TelegramMediaFile>>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MediaCollectionMessage<TelegramMediaFile>, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in MediaCollectionMessage<TelegramMediaFile>, Any>? = ByChatMessageMarkerFactory,
|
||||
@@ -335,7 +335,7 @@ suspend fun <BC : BehaviourContext> BC.onEditedMediaCollection(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onEditedMedia(
|
||||
fun <BC : BehaviourContext> BC.onEditedMedia(
|
||||
initialFilter: CommonMessageFilter<MediaContent>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MediaMessage, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in MediaMessage, Any>? = ByChatMessageMarkerFactory,
|
||||
@@ -362,7 +362,7 @@ suspend fun <BC : BehaviourContext> BC.onEditedMedia(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onEditedAnimation(
|
||||
fun <BC : BehaviourContext> BC.onEditedAnimation(
|
||||
initialFilter: CommonMessageFilter<AnimationContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, AnimationMessage, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in AnimationMessage, Any>? = ByChatMessageMarkerFactory,
|
||||
@@ -389,7 +389,7 @@ suspend fun <BC : BehaviourContext> BC.onEditedAnimation(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onEditedAudio(
|
||||
fun <BC : BehaviourContext> BC.onEditedAudio(
|
||||
initialFilter: CommonMessageFilter<AudioContent>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, AudioMessage, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in AudioMessage, Any>? = ByChatMessageMarkerFactory,
|
||||
@@ -416,7 +416,7 @@ suspend fun <BC : BehaviourContext> BC.onEditedAudio(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onEditedDocument(
|
||||
fun <BC : BehaviourContext> BC.onEditedDocument(
|
||||
initialFilter: CommonMessageFilter<DocumentContent>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, DocumentMessage, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in DocumentMessage, Any>? = ByChatMessageMarkerFactory,
|
||||
@@ -443,7 +443,7 @@ suspend fun <BC : BehaviourContext> BC.onEditedDocument(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onEditedPhoto(
|
||||
fun <BC : BehaviourContext> BC.onEditedPhoto(
|
||||
initialFilter: CommonMessageFilter<PhotoContent>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, PhotoMessage, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in PhotoMessage, Any>? = ByChatMessageMarkerFactory,
|
||||
@@ -470,7 +470,7 @@ suspend fun <BC : BehaviourContext> BC.onEditedPhoto(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onEditedSticker(
|
||||
fun <BC : BehaviourContext> BC.onEditedSticker(
|
||||
initialFilter: CommonMessageFilter<StickerContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, StickerMessage, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in StickerMessage, Any>? = ByChatMessageMarkerFactory,
|
||||
@@ -497,7 +497,7 @@ suspend fun <BC : BehaviourContext> BC.onEditedSticker(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onEditedVideo(
|
||||
fun <BC : BehaviourContext> BC.onEditedVideo(
|
||||
initialFilter: CommonMessageFilter<VideoContent>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, VideoMessage, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in VideoMessage, Any>? = ByChatMessageMarkerFactory,
|
||||
@@ -524,7 +524,7 @@ suspend fun <BC : BehaviourContext> BC.onEditedVideo(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onEditedVideoNote(
|
||||
fun <BC : BehaviourContext> BC.onEditedVideoNote(
|
||||
initialFilter: CommonMessageFilter<VideoNoteContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, VideoNoteMessage, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in VideoNoteMessage, Any>? = ByChatMessageMarkerFactory,
|
||||
@@ -551,7 +551,7 @@ suspend fun <BC : BehaviourContext> BC.onEditedVideoNote(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onEditedVoice(
|
||||
fun <BC : BehaviourContext> BC.onEditedVoice(
|
||||
initialFilter: CommonMessageFilter<VoiceContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, VoiceMessage, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in VoiceMessage, Any>? = ByChatMessageMarkerFactory,
|
||||
@@ -578,7 +578,7 @@ suspend fun <BC : BehaviourContext> BC.onEditedVoice(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onEditedInvoice(
|
||||
fun <BC : BehaviourContext> BC.onEditedInvoice(
|
||||
initialFilter: CommonMessageFilter<InvoiceContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, InvoiceMessage, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in InvoiceMessage, Any>? = ByChatMessageMarkerFactory,
|
||||
|
@@ -238,7 +238,7 @@ fun <BC : BehaviourContext> BC.onMessageAutoDeleteTimerChangedEvent(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onPublicChatEvent(
|
||||
fun <BC : BehaviourContext> BC.onPublicChatEvent(
|
||||
initialFilter: SimpleFilter<ChatEventMessage<PublicChatEvent>>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<PublicChatEvent>, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in ChatEventMessage<PublicChatEvent>, Any>? = ByChatMessageMarkerFactory,
|
||||
@@ -259,7 +259,7 @@ suspend fun <BC : BehaviourContext> BC.onPublicChatEvent(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onCommonEvent(
|
||||
fun <BC : BehaviourContext> BC.onCommonEvent(
|
||||
initialFilter: SimpleFilter<ChatEventMessage<CommonEvent>>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<CommonEvent>, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in ChatEventMessage<CommonEvent>, Any>? = ByChatMessageMarkerFactory,
|
||||
@@ -280,7 +280,7 @@ suspend fun <BC : BehaviourContext> BC.onCommonEvent(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onGroupEvent(
|
||||
fun <BC : BehaviourContext> BC.onGroupEvent(
|
||||
initialFilter: SimpleFilter<ChatEventMessage<GroupEvent>>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<GroupEvent>, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in ChatEventMessage<GroupEvent>, Any>? = ByChatMessageMarkerFactory,
|
||||
@@ -301,7 +301,7 @@ suspend fun <BC : BehaviourContext> BC.onGroupEvent(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onSupergroupEvent(
|
||||
fun <BC : BehaviourContext> BC.onSupergroupEvent(
|
||||
initialFilter: SimpleFilter<ChatEventMessage<SupergroupEvent>>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<SupergroupEvent>, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in ChatEventMessage<SupergroupEvent>, Any>? = ByChatMessageMarkerFactory,
|
||||
@@ -322,7 +322,7 @@ suspend fun <BC : BehaviourContext> BC.onSupergroupEvent(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onChannelChatCreated(
|
||||
fun <BC : BehaviourContext> BC.onChannelChatCreated(
|
||||
initialFilter: SimpleFilter<ChatEventMessage<ChannelChatCreated>>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<ChannelChatCreated>, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in ChatEventMessage<ChannelChatCreated>, Any>? = ByChatMessageMarkerFactory,
|
||||
@@ -343,7 +343,7 @@ suspend fun <BC : BehaviourContext> BC.onChannelChatCreated(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onDeleteChatPhoto(
|
||||
fun <BC : BehaviourContext> BC.onDeleteChatPhoto(
|
||||
initialFilter: SimpleFilter<ChatEventMessage<DeleteChatPhoto>>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<DeleteChatPhoto>, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in ChatEventMessage<DeleteChatPhoto>, Any>? = ByChatMessageMarkerFactory,
|
||||
@@ -364,7 +364,7 @@ suspend fun <BC : BehaviourContext> BC.onDeleteChatPhoto(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onGroupChatCreated(
|
||||
fun <BC : BehaviourContext> BC.onGroupChatCreated(
|
||||
initialFilter: SimpleFilter<ChatEventMessage<GroupChatCreated>>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<GroupChatCreated>, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in ChatEventMessage<GroupChatCreated>, Any>? = ByChatMessageMarkerFactory,
|
||||
@@ -385,7 +385,7 @@ suspend fun <BC : BehaviourContext> BC.onGroupChatCreated(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onLeftChatMember(
|
||||
fun <BC : BehaviourContext> BC.onLeftChatMember(
|
||||
initialFilter: SimpleFilter<ChatEventMessage<LeftChatMemberEvent>>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<LeftChatMemberEvent>, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in ChatEventMessage<LeftChatMemberEvent>, Any>? = ByChatMessageMarkerFactory,
|
||||
@@ -406,7 +406,7 @@ suspend fun <BC : BehaviourContext> BC.onLeftChatMember(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onNewChatMembers(
|
||||
fun <BC : BehaviourContext> BC.onNewChatMembers(
|
||||
initialFilter: SimpleFilter<ChatEventMessage<NewChatMembers>>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<NewChatMembers>, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in ChatEventMessage<NewChatMembers>, Any>? = ByChatMessageMarkerFactory,
|
||||
@@ -427,7 +427,7 @@ suspend fun <BC : BehaviourContext> BC.onNewChatMembers(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onNewChatPhoto(
|
||||
fun <BC : BehaviourContext> BC.onNewChatPhoto(
|
||||
initialFilter: SimpleFilter<ChatEventMessage<NewChatPhoto>>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<NewChatPhoto>, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in ChatEventMessage<NewChatPhoto>, Any>? = ByChatMessageMarkerFactory,
|
||||
@@ -448,7 +448,7 @@ suspend fun <BC : BehaviourContext> BC.onNewChatPhoto(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onNewChatTitle(
|
||||
fun <BC : BehaviourContext> BC.onNewChatTitle(
|
||||
initialFilter: SimpleFilter<ChatEventMessage<NewChatTitle>>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<NewChatTitle>, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in ChatEventMessage<NewChatTitle>, Any>? = ByChatMessageMarkerFactory,
|
||||
@@ -469,7 +469,7 @@ suspend fun <BC : BehaviourContext> BC.onNewChatTitle(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onPinnedMessage(
|
||||
fun <BC : BehaviourContext> BC.onPinnedMessage(
|
||||
initialFilter: SimpleFilter<ChatEventMessage<PinnedMessage>>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<PinnedMessage>, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in ChatEventMessage<PinnedMessage>, Any>? = ByChatMessageMarkerFactory,
|
||||
@@ -490,7 +490,7 @@ suspend fun <BC : BehaviourContext> BC.onPinnedMessage(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onProximityAlertTriggered(
|
||||
fun <BC : BehaviourContext> BC.onProximityAlertTriggered(
|
||||
initialFilter: SimpleFilter<ChatEventMessage<ProximityAlertTriggered>>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<ProximityAlertTriggered>, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in ChatEventMessage<ProximityAlertTriggered>, Any>? = ByChatMessageMarkerFactory,
|
||||
@@ -511,7 +511,7 @@ suspend fun <BC : BehaviourContext> BC.onProximityAlertTriggered(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onSupergroupChatCreated(
|
||||
fun <BC : BehaviourContext> BC.onSupergroupChatCreated(
|
||||
initialFilter: SimpleFilter<ChatEventMessage<SupergroupChatCreated>>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<SupergroupChatCreated>, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in ChatEventMessage<SupergroupChatCreated>, Any>? = ByChatMessageMarkerFactory,
|
||||
@@ -535,7 +535,7 @@ suspend fun <BC : BehaviourContext> BC.onSupergroupChatCreated(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onSuccessfulPayment(
|
||||
fun <BC : BehaviourContext> BC.onSuccessfulPayment(
|
||||
initialFilter: SimpleFilter<ChatEventMessage<SuccessfulPaymentEvent>>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<SuccessfulPaymentEvent>, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in ChatEventMessage<SuccessfulPaymentEvent>, Any>? = ByChatMessageMarkerFactory,
|
||||
@@ -556,7 +556,7 @@ suspend fun <BC : BehaviourContext> BC.onSuccessfulPayment(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onRefundedPayment(
|
||||
fun <BC : BehaviourContext> BC.onRefundedPayment(
|
||||
initialFilter: SimpleFilter<ChatEventMessage<RefundedPaymentEvent>>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<RefundedPaymentEvent>, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in ChatEventMessage<RefundedPaymentEvent>, Any>? = ByChatMessageMarkerFactory,
|
||||
@@ -577,7 +577,7 @@ suspend fun <BC : BehaviourContext> BC.onRefundedPayment(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onUserLoggedIn(
|
||||
fun <BC : BehaviourContext> BC.onUserLoggedIn(
|
||||
initialFilter: SimpleFilter<ChatEventMessage<UserLoggedIn>>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<UserLoggedIn>, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in ChatEventMessage<UserLoggedIn>, Any>? = ByChatMessageMarkerFactory,
|
||||
@@ -598,7 +598,7 @@ suspend fun <BC : BehaviourContext> BC.onUserLoggedIn(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onWebAppData(
|
||||
fun <BC : BehaviourContext> BC.onWebAppData(
|
||||
initialFilter: SimpleFilter<PrivateEventMessage<WebAppData>>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, PrivateEventMessage<WebAppData>, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in ChatEventMessage<WebAppData>, Any>? = ByChatMessageMarkerFactory,
|
||||
@@ -619,7 +619,7 @@ suspend fun <BC : BehaviourContext> BC.onWebAppData(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onForumTopicClosed(
|
||||
fun <BC : BehaviourContext> BC.onForumTopicClosed(
|
||||
initialFilter: SimpleFilter<SupergroupEventMessage<ForumTopicClosed>>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, SupergroupEventMessage<ForumTopicClosed>, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in ChatEventMessage<ForumTopicClosed>, Any>? = ByChatMessageMarkerFactory,
|
||||
@@ -640,7 +640,7 @@ suspend fun <BC : BehaviourContext> BC.onForumTopicClosed(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onForumTopicCreated(
|
||||
fun <BC : BehaviourContext> BC.onForumTopicCreated(
|
||||
initialFilter: SimpleFilter<SupergroupEventMessage<ForumTopicCreated>>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, SupergroupEventMessage<ForumTopicCreated>, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in ChatEventMessage<ForumTopicCreated>, Any>? = ByChatMessageMarkerFactory,
|
||||
@@ -661,7 +661,7 @@ suspend fun <BC : BehaviourContext> BC.onForumTopicCreated(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onForumTopicReopened(
|
||||
fun <BC : BehaviourContext> BC.onForumTopicReopened(
|
||||
initialFilter: SimpleFilter<SupergroupEventMessage<ForumTopicReopened>>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, SupergroupEventMessage<ForumTopicReopened>, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in ChatEventMessage<ForumTopicReopened>, Any>? = ByChatMessageMarkerFactory,
|
||||
@@ -683,7 +683,7 @@ suspend fun <BC : BehaviourContext> BC.onForumTopicReopened(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onForumTopicEdited(
|
||||
fun <BC : BehaviourContext> BC.onForumTopicEdited(
|
||||
initialFilter: SimpleFilter<SupergroupEventMessage<ForumTopicEdited>>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, SupergroupEventMessage<ForumTopicEdited>, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in ChatEventMessage<ForumTopicEdited>, Any>? = ByChatMessageMarkerFactory,
|
||||
@@ -704,7 +704,7 @@ suspend fun <BC : BehaviourContext> BC.onForumTopicEdited(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onGeneralForumTopicHidden(
|
||||
fun <BC : BehaviourContext> BC.onGeneralForumTopicHidden(
|
||||
initialFilter: SimpleFilter<SupergroupEventMessage<GeneralForumTopicHidden>>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, SupergroupEventMessage<GeneralForumTopicHidden>, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in ChatEventMessage<GeneralForumTopicHidden>, Any>? = ByChatMessageMarkerFactory,
|
||||
@@ -725,7 +725,7 @@ suspend fun <BC : BehaviourContext> BC.onGeneralForumTopicHidden(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onGeneralForumTopicUnhidden(
|
||||
fun <BC : BehaviourContext> BC.onGeneralForumTopicUnhidden(
|
||||
initialFilter: SimpleFilter<SupergroupEventMessage<GeneralForumTopicUnhidden>>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, SupergroupEventMessage<GeneralForumTopicUnhidden>, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in ChatEventMessage<GeneralForumTopicUnhidden>, Any>? = ByChatMessageMarkerFactory,
|
||||
@@ -747,7 +747,7 @@ suspend fun <BC : BehaviourContext> BC.onGeneralForumTopicUnhidden(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onWriteAccessAllowed(
|
||||
fun <BC : BehaviourContext> BC.onWriteAccessAllowed(
|
||||
initialFilter: SimpleFilter<ChatEventMessage<WriteAccessAllowed>>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<WriteAccessAllowed>, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in ChatEventMessage<WriteAccessAllowed>, Any>? = ByChatMessageMarkerFactory,
|
||||
@@ -769,7 +769,7 @@ suspend fun <BC : BehaviourContext> BC.onWriteAccessAllowed(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onWriteAccessAllowedFromRequest(
|
||||
fun <BC : BehaviourContext> BC.onWriteAccessAllowedFromRequest(
|
||||
initialFilter: SimpleFilter<ChatEventMessage<WriteAccessAllowed.FromRequest>>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<WriteAccessAllowed.FromRequest>, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in ChatEventMessage<WriteAccessAllowed.FromRequest>, Any>? = ByChatMessageMarkerFactory,
|
||||
@@ -791,7 +791,7 @@ suspend fun <BC : BehaviourContext> BC.onWriteAccessAllowedFromRequest(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onWriteAccessAllowedFromAttachmentMenu(
|
||||
fun <BC : BehaviourContext> BC.onWriteAccessAllowedFromAttachmentMenu(
|
||||
initialFilter: SimpleFilter<ChatEventMessage<WriteAccessAllowed.FromAttachmentMenu>>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<WriteAccessAllowed.FromAttachmentMenu>, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in ChatEventMessage<WriteAccessAllowed.FromAttachmentMenu>, Any>? = ByChatMessageMarkerFactory,
|
||||
@@ -813,7 +813,7 @@ suspend fun <BC : BehaviourContext> BC.onWriteAccessAllowedFromAttachmentMenu(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onWriteAccessAllowedOther(
|
||||
fun <BC : BehaviourContext> BC.onWriteAccessAllowedOther(
|
||||
initialFilter: SimpleFilter<ChatEventMessage<WriteAccessAllowed.Other>>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<WriteAccessAllowed.Other>, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in ChatEventMessage<WriteAccessAllowed.Other>, Any>? = ByChatMessageMarkerFactory,
|
||||
@@ -835,7 +835,7 @@ suspend fun <BC : BehaviourContext> BC.onWriteAccessAllowedOther(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onWriteAccessAllowedFromWebAppLink(
|
||||
fun <BC : BehaviourContext> BC.onWriteAccessAllowedFromWebAppLink(
|
||||
initialFilter: SimpleFilter<ChatEventMessage<WriteAccessAllowed.FromWebAppLink>>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<WriteAccessAllowed.FromWebAppLink>, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in ChatEventMessage<WriteAccessAllowed.FromWebAppLink>, Any>? = ByChatMessageMarkerFactory,
|
||||
@@ -858,7 +858,7 @@ suspend fun <BC : BehaviourContext> BC.onWriteAccessAllowedFromWebAppLink(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onChatSharedRequest(
|
||||
fun <BC : BehaviourContext> BC.onChatSharedRequest(
|
||||
initialFilter: SimpleFilter<PrivateEventMessage<ChatSharedRequest>>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, PrivateEventMessage<ChatSharedRequest>, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in ChatEventMessage<ChatSharedRequest>, Any>? = ByChatMessageMarkerFactory,
|
||||
@@ -880,7 +880,7 @@ suspend fun <BC : BehaviourContext> BC.onChatSharedRequest(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onUsersShared(
|
||||
fun <BC : BehaviourContext> BC.onUsersShared(
|
||||
initialFilter: SimpleFilter<PrivateEventMessage<UsersShared>>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, PrivateEventMessage<UsersShared>, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in ChatEventMessage<UsersShared>, Any>? = ByChatMessageMarkerFactory,
|
||||
@@ -902,7 +902,7 @@ suspend fun <BC : BehaviourContext> BC.onUsersShared(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onUserShared(
|
||||
fun <BC : BehaviourContext> BC.onUserShared(
|
||||
initialFilter: SimpleFilter<PrivateEventMessage<UsersShared>>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, PrivateEventMessage<UsersShared>, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in ChatEventMessage<UsersShared>, Any>? = ByChatMessageMarkerFactory,
|
||||
@@ -925,7 +925,7 @@ suspend fun <BC : BehaviourContext> BC.onUserShared(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onChatShared(
|
||||
fun <BC : BehaviourContext> BC.onChatShared(
|
||||
initialFilter: SimpleFilter<PrivateEventMessage<ChatShared>>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, PrivateEventMessage<ChatShared>, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in ChatEventMessage<ChatShared>, Any>? = ByChatMessageMarkerFactory,
|
||||
@@ -948,7 +948,7 @@ suspend fun <BC : BehaviourContext> BC.onChatShared(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onChatBoostAdded(
|
||||
fun <BC : BehaviourContext> BC.onChatBoostAdded(
|
||||
initialFilter: SimpleFilter<ChatEventMessage<ChatBoostAdded>>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<ChatBoostAdded>, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in ChatEventMessage<ChatBoostAdded>, Any>? = ByChatMessageMarkerFactory,
|
||||
@@ -970,7 +970,7 @@ suspend fun <BC : BehaviourContext> BC.onChatBoostAdded(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onChatBackgroundSet(
|
||||
fun <BC : BehaviourContext> BC.onChatBackgroundSet(
|
||||
initialFilter: SimpleFilter<ChatEventMessage<ChatBackground>>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<ChatBackground>, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in ChatEventMessage<ChatBackground>, Any>? = ByChatMessageMarkerFactory,
|
||||
@@ -992,7 +992,7 @@ suspend fun <BC : BehaviourContext> BC.onChatBackgroundSet(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onGiveawayCreated(
|
||||
fun <BC : BehaviourContext> BC.onGiveawayCreated(
|
||||
initialFilter: SimpleFilter<ChatEventMessage<GiveawayCreated>>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<GiveawayCreated>, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in ChatEventMessage<GiveawayCreated>, Any>? = ByChatMessageMarkerFactory,
|
||||
@@ -1015,7 +1015,7 @@ suspend fun <BC : BehaviourContext> BC.onGiveawayCreated(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onGiveawayCompleted(
|
||||
fun <BC : BehaviourContext> BC.onGiveawayCompleted(
|
||||
initialFilter: SimpleFilter<ChatEventMessage<GiveawayPrivateResults>>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<GiveawayPrivateResults>, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in ChatEventMessage<GiveawayPrivateResults>, Any>? = ByChatMessageMarkerFactory,
|
||||
@@ -1039,7 +1039,7 @@ suspend fun <BC : BehaviourContext> BC.onGiveawayCompleted(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onGiveawayCompletedWithPrivateWinners(
|
||||
fun <BC : BehaviourContext> BC.onGiveawayCompletedWithPrivateWinners(
|
||||
initialFilter: SimpleFilter<ChatEventMessage<GiveawayPrivateResults>>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<GiveawayPrivateResults>, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in ChatEventMessage<GiveawayPrivateResults>, Any>? = ByChatMessageMarkerFactory,
|
||||
@@ -1061,7 +1061,7 @@ suspend fun <BC : BehaviourContext> BC.onGiveawayCompletedWithPrivateWinners(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onPaidMessagePriceChanged(
|
||||
fun <BC : BehaviourContext> BC.onPaidMessagePriceChanged(
|
||||
initialFilter: SimpleFilter<ChatEventMessage<PaidMessagePriceChanged>>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<PaidMessagePriceChanged>, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in ChatEventMessage<PaidMessagePriceChanged>, Any>? = ByChatMessageMarkerFactory,
|
||||
@@ -1083,7 +1083,7 @@ suspend fun <BC : BehaviourContext> BC.onPaidMessagePriceChanged(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onRegularGiftSentOrReceived(
|
||||
fun <BC : BehaviourContext> BC.onRegularGiftSentOrReceived(
|
||||
initialFilter: SimpleFilter<ChatEventMessage<GiftSentOrReceived.Regular>>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<GiftSentOrReceived.Regular>, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in ChatEventMessage<GiftSentOrReceived.Regular>, Any>? = ByChatMessageMarkerFactory,
|
||||
@@ -1105,7 +1105,7 @@ suspend fun <BC : BehaviourContext> BC.onRegularGiftSentOrReceived(
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onUniqueGiftSentOrReceived(
|
||||
fun <BC : BehaviourContext> BC.onUniqueGiftSentOrReceived(
|
||||
initialFilter: SimpleFilter<ChatEventMessage<GiftSentOrReceived.Unique>>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<GiftSentOrReceived.Unique>, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in ChatEventMessage<GiftSentOrReceived.Unique>, Any>? = ByChatMessageMarkerFactory,
|
||||
|
@@ -214,7 +214,7 @@ fun <BC : BehaviourContext> BC.onMentionWithMediaGroupContent(
|
||||
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||
* "stream"
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onMentionWithMediaGroupPartContent(
|
||||
fun <BC : BehaviourContext> BC.onMentionWithMediaGroupPartContent(
|
||||
username: Username,
|
||||
initialFilter: CommonMessageFilter<MediaGroupPartContent>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<MediaGroupPartContent>, Update>? = null,
|
||||
@@ -228,7 +228,7 @@ suspend fun <BC : BehaviourContext> BC.onMentionWithMediaGroupPartContent(
|
||||
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||
* "stream"
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onTextMentionWithMediaGroupPartContent(
|
||||
fun <BC : BehaviourContext> BC.onTextMentionWithMediaGroupPartContent(
|
||||
userId: UserId,
|
||||
initialFilter: CommonMessageFilter<MediaGroupPartContent>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<MediaGroupPartContent>, Update>? = null,
|
||||
@@ -242,7 +242,7 @@ suspend fun <BC : BehaviourContext> BC.onTextMentionWithMediaGroupPartContent(
|
||||
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||
* "stream"
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onMentionWithMediaGroupPartContent(
|
||||
fun <BC : BehaviourContext> BC.onMentionWithMediaGroupPartContent(
|
||||
user: User,
|
||||
initialFilter: CommonMessageFilter<MediaGroupPartContent>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<MediaGroupPartContent>, Update>? = null,
|
||||
@@ -258,7 +258,7 @@ suspend fun <BC : BehaviourContext> BC.onMentionWithMediaGroupPartContent(
|
||||
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||
* "stream"
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onMentionWithAudioContent(
|
||||
fun <BC : BehaviourContext> BC.onMentionWithAudioContent(
|
||||
username: Username,
|
||||
initialFilter: CommonMessageFilter<AudioContent>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<AudioContent>, Update>? = null,
|
||||
@@ -272,7 +272,7 @@ suspend fun <BC : BehaviourContext> BC.onMentionWithAudioContent(
|
||||
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||
* "stream"
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onTextMentionWithAudioContent(
|
||||
fun <BC : BehaviourContext> BC.onTextMentionWithAudioContent(
|
||||
userId: UserId,
|
||||
initialFilter: CommonMessageFilter<AudioContent>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<AudioContent>, Update>? = null,
|
||||
@@ -286,7 +286,7 @@ suspend fun <BC : BehaviourContext> BC.onTextMentionWithAudioContent(
|
||||
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||
* "stream"
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onMentionWithAudioContent(
|
||||
fun <BC : BehaviourContext> BC.onMentionWithAudioContent(
|
||||
user: User,
|
||||
initialFilter: CommonMessageFilter<AudioContent>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<AudioContent>, Update>? = null,
|
||||
@@ -302,7 +302,7 @@ suspend fun <BC : BehaviourContext> BC.onMentionWithAudioContent(
|
||||
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||
* "stream"
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onMentionWithDocumentContent(
|
||||
fun <BC : BehaviourContext> BC.onMentionWithDocumentContent(
|
||||
username: Username,
|
||||
initialFilter: CommonMessageFilter<DocumentContent>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<DocumentContent>, Update>? = null,
|
||||
@@ -316,7 +316,7 @@ suspend fun <BC : BehaviourContext> BC.onMentionWithDocumentContent(
|
||||
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||
* "stream"
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onTextMentionWithDocumentContent(
|
||||
fun <BC : BehaviourContext> BC.onTextMentionWithDocumentContent(
|
||||
userId: UserId,
|
||||
initialFilter: CommonMessageFilter<DocumentContent>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<DocumentContent>, Update>? = null,
|
||||
@@ -330,7 +330,7 @@ suspend fun <BC : BehaviourContext> BC.onTextMentionWithDocumentContent(
|
||||
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||
* "stream"
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onMentionWithDocumentContent(
|
||||
fun <BC : BehaviourContext> BC.onMentionWithDocumentContent(
|
||||
user: User,
|
||||
initialFilter: CommonMessageFilter<DocumentContent>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<DocumentContent>, Update>? = null,
|
||||
@@ -346,7 +346,7 @@ suspend fun <BC : BehaviourContext> BC.onMentionWithDocumentContent(
|
||||
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||
* "stream"
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onMentionWithVisualMediaGroupPartContent(
|
||||
fun <BC : BehaviourContext> BC.onMentionWithVisualMediaGroupPartContent(
|
||||
username: Username,
|
||||
initialFilter: CommonMessageFilter<VisualMediaGroupPartContent>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<VisualMediaGroupPartContent>, Update>? = null,
|
||||
@@ -360,7 +360,7 @@ suspend fun <BC : BehaviourContext> BC.onMentionWithVisualMediaGroupPartContent(
|
||||
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||
* "stream"
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onTextMentionWithVisualMediaGroupPartContent(
|
||||
fun <BC : BehaviourContext> BC.onTextMentionWithVisualMediaGroupPartContent(
|
||||
userId: UserId,
|
||||
initialFilter: CommonMessageFilter<VisualMediaGroupPartContent>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<VisualMediaGroupPartContent>, Update>? = null,
|
||||
@@ -374,7 +374,7 @@ suspend fun <BC : BehaviourContext> BC.onTextMentionWithVisualMediaGroupPartCont
|
||||
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||
* "stream"
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onMentionWithVisualMediaGroupPartContent(
|
||||
fun <BC : BehaviourContext> BC.onMentionWithVisualMediaGroupPartContent(
|
||||
user: User,
|
||||
initialFilter: CommonMessageFilter<VisualMediaGroupPartContent>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<VisualMediaGroupPartContent>, Update>? = null,
|
||||
@@ -390,7 +390,7 @@ suspend fun <BC : BehaviourContext> BC.onMentionWithVisualMediaGroupPartContent(
|
||||
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||
* "stream"
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onMentionWithVideoContent(
|
||||
fun <BC : BehaviourContext> BC.onMentionWithVideoContent(
|
||||
username: Username,
|
||||
initialFilter: CommonMessageFilter<VideoContent>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<VideoContent>, Update>? = null,
|
||||
@@ -404,7 +404,7 @@ suspend fun <BC : BehaviourContext> BC.onMentionWithVideoContent(
|
||||
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||
* "stream"
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onTextMentionWithVideoContent(
|
||||
fun <BC : BehaviourContext> BC.onTextMentionWithVideoContent(
|
||||
userId: UserId,
|
||||
initialFilter: CommonMessageFilter<VideoContent>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<VideoContent>, Update>? = null,
|
||||
@@ -418,7 +418,7 @@ suspend fun <BC : BehaviourContext> BC.onTextMentionWithVideoContent(
|
||||
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||
* "stream"
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onMentionWithVideoContent(
|
||||
fun <BC : BehaviourContext> BC.onMentionWithVideoContent(
|
||||
user: User,
|
||||
initialFilter: CommonMessageFilter<VideoContent>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<VideoContent>, Update>? = null,
|
||||
@@ -434,7 +434,7 @@ suspend fun <BC : BehaviourContext> BC.onMentionWithVideoContent(
|
||||
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||
* "stream"
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onMentionWithPhotoContent(
|
||||
fun <BC : BehaviourContext> BC.onMentionWithPhotoContent(
|
||||
username: Username,
|
||||
initialFilter: CommonMessageFilter<PhotoContent>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<PhotoContent>, Update>? = null,
|
||||
@@ -448,7 +448,7 @@ suspend fun <BC : BehaviourContext> BC.onMentionWithPhotoContent(
|
||||
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||
* "stream"
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onTextMentionWithPhotoContent(
|
||||
fun <BC : BehaviourContext> BC.onTextMentionWithPhotoContent(
|
||||
userId: UserId,
|
||||
initialFilter: CommonMessageFilter<PhotoContent>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<PhotoContent>, Update>? = null,
|
||||
@@ -462,7 +462,7 @@ suspend fun <BC : BehaviourContext> BC.onTextMentionWithPhotoContent(
|
||||
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||
* "stream"
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onMentionWithPhotoContent(
|
||||
fun <BC : BehaviourContext> BC.onMentionWithPhotoContent(
|
||||
user: User,
|
||||
initialFilter: CommonMessageFilter<PhotoContent>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<PhotoContent>, Update>? = null,
|
||||
@@ -478,7 +478,7 @@ suspend fun <BC : BehaviourContext> BC.onMentionWithPhotoContent(
|
||||
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||
* "stream"
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onMentionWithAnimationContent(
|
||||
fun <BC : BehaviourContext> BC.onMentionWithAnimationContent(
|
||||
username: Username,
|
||||
initialFilter: CommonMessageFilter<AnimationContent>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<AnimationContent>, Update>? = null,
|
||||
@@ -492,7 +492,7 @@ suspend fun <BC : BehaviourContext> BC.onMentionWithAnimationContent(
|
||||
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||
* "stream"
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onTextMentionWithAnimationContent(
|
||||
fun <BC : BehaviourContext> BC.onTextMentionWithAnimationContent(
|
||||
userId: UserId,
|
||||
initialFilter: CommonMessageFilter<AnimationContent>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<AnimationContent>, Update>? = null,
|
||||
@@ -506,7 +506,7 @@ suspend fun <BC : BehaviourContext> BC.onTextMentionWithAnimationContent(
|
||||
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||
* "stream"
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onMentionWithAnimationContent(
|
||||
fun <BC : BehaviourContext> BC.onMentionWithAnimationContent(
|
||||
user: User,
|
||||
initialFilter: CommonMessageFilter<AnimationContent>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<AnimationContent>, Update>? = null,
|
||||
@@ -522,7 +522,7 @@ suspend fun <BC : BehaviourContext> BC.onMentionWithAnimationContent(
|
||||
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||
* "stream"
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onMentionWithTextContent(
|
||||
fun <BC : BehaviourContext> BC.onMentionWithTextContent(
|
||||
username: Username,
|
||||
initialFilter: CommonMessageFilter<TextContent>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<TextContent>, Update>? = null,
|
||||
@@ -536,7 +536,7 @@ suspend fun <BC : BehaviourContext> BC.onMentionWithTextContent(
|
||||
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||
* "stream"
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onTextMentionWithTextContent(
|
||||
fun <BC : BehaviourContext> BC.onTextMentionWithTextContent(
|
||||
userId: UserId,
|
||||
initialFilter: CommonMessageFilter<TextContent>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<TextContent>, Update>? = null,
|
||||
@@ -550,7 +550,7 @@ suspend fun <BC : BehaviourContext> BC.onTextMentionWithTextContent(
|
||||
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||
* "stream"
|
||||
*/
|
||||
suspend fun <BC : BehaviourContext> BC.onMentionWithTextContent(
|
||||
fun <BC : BehaviourContext> BC.onMentionWithTextContent(
|
||||
user: User,
|
||||
initialFilter: CommonMessageFilter<TextContent>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<TextContent>, Update>? = null,
|
||||
|
Reference in New Issue
Block a user