1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2025-11-18 13:00:18 +00:00

Compare commits

..

69 Commits

Author SHA1 Message Date
9e2c23cf2d small note about edit methods changes 2024-06-26 00:50:22 +06:00
acd241e31e update dependencies and add note about 7.5 bots api support 2024-06-26 00:23:51 +06:00
9cfc98bb67 improve API and fix StarTransaction 2024-06-26 00:19:54 +06:00
6a9407f15c potentially implement Bot API 7.5 2024-06-23 16:02:19 +06:00
af79e26855 add support for businessConnectionId in stopPoll 2024-06-23 15:23:58 +06:00
02a404b805 rename api file GetTransactions 2024-06-23 15:16:43 +06:00
f2e97df44c add support of getStarTransactions 2024-06-23 15:16:05 +06:00
63a695dcc5 complete Star Transactions abstractions 2024-06-23 15:11:03 +06:00
66cf0689e1 start implement new bot api 2024-06-22 23:31:38 +06:00
c7b8187829 start 15.0.0 2024-06-22 21:54:40 +06:00
5cfc350c13 Merge pull request #863 from InsanusMokrassar/14.1.0
14.1.0
2024-06-21 18:14:05 +06:00
a3ef66bbfb migration due to potential breaking changes in microutils 2024-06-21 13:30:13 +06:00
738728f647 Update libs.versions.toml 2024-06-21 13:21:05 +06:00
abbb4e2dff update microutils 2024-06-16 22:34:44 +06:00
c3fa8a6d33 update microutils dependency 2024-06-16 00:29:13 +06:00
fb2b912f93 update docs 2024-06-15 13:05:16 +06:00
46c5c62e15 rewrite MainTrigger as noinline 2024-06-15 12:36:14 +06:00
60fdbb8ac4 small improvement in BehaviourContext 2024-06-14 19:54:06 +06:00
86bd5eaa07 fill changelog and change BehaviourContext updates flow subscription mechanism 2024-06-14 17:33:51 +06:00
57122cc2f9 update dependencies 2024-06-14 17:28:37 +06:00
91a8058a3a try to support nullable marker factory 2024-06-13 22:24:16 +06:00
97836c5f4e rewrite createSubContextAndDoWithUpdatesFilter and doInContext to work with supervisor scope 2024-06-13 21:32:04 +06:00
1a8cfefa4d start 14.0.2 2024-06-13 21:09:49 +06:00
0e97a63103 Merge pull request #861 from InsanusMokrassar/14.0.1
14.0.1
2024-06-07 02:25:15 +06:00
24269cc774 improve SendInvoice API one more time 2024-06-07 01:55:37 +06:00
d960d94c0d fix build 2024-06-07 01:45:23 +06:00
663d63b009 update invoices API 2024-06-07 01:18:55 +06:00
7118631213 start 14.0.1 2024-06-06 16:53:56 +06:00
ff34017a03 Merge pull request #859 from InsanusMokrassar/14.0.0
14.0.0
2024-06-01 13:36:13 +06:00
96a7a2acab fill changelog and add Telegram Bots API support note 2024-06-01 13:35:29 +06:00
71c830fc2e fix passing of effectId in a lot of functions 2024-06-01 13:17:40 +06:00
271e7d2157 fix in SendPhoto 2024-06-01 13:13:10 +06:00
cf5e5a1d1e update defaults in createResend 2024-05-31 19:46:29 +06:00
186d6931ac first working version 2024-05-31 16:55:52 +06:00
6ec686040c progress in fixes of api errors 2024-05-31 13:04:11 +06:00
211cef298c fix of core build 2024-05-31 12:39:12 +06:00
8de41bdd99 complete effects in core part 2024-05-30 22:13:18 +06:00
7a5c9c7ef8 add base support of effects 2024-05-30 21:58:47 +06:00
4dec85ee60 add note about TelegramPaymentChargeId 2024-05-28 23:59:01 +06:00
4622509356 add support of refundStarPayment 2024-05-28 23:57:48 +06:00
30e44d6bf2 migration onto 14.0.0 due to breaking changes 2024-05-28 23:47:20 +06:00
e403bbca0b add support of expandable blockquote 2024-05-28 23:46:30 +06:00
93e06a5765 add support of show_caption_above_media"" 2024-05-28 22:48:06 +06:00
718f6ab366 start add effects support 2024-05-28 21:35:27 +06:00
6f776576ab add support of ommiting provider_token in payment classes 2024-05-28 19:06:11 +06:00
fcdaeb2e8f start 13.1.0 2024-05-28 18:54:44 +06:00
1e679ce50b Merge pull request #848 from InsanusMokrassar/13.0.0
13.0.0
2024-05-10 19:59:06 +06:00
fe4be69051 add note about Telegram Bots API support 2024-05-10 19:55:00 +06:00
06ba14e8be apiDump 2024-05-10 19:45:35 +06:00
ca1b196942 updates in LiveFlowLocation behaviours 2024-05-10 19:43:54 +06:00
dc5d8afe32 Chat bacgrkoud became PublicChatEvent inheritor instead of CommonEvent 2024-05-10 19:25:33 +06:00
b843fd9188 fixes in support of text entities 2024-05-10 16:31:56 +06:00
d56173eceb dump api 2024-05-09 22:15:26 +06:00
97621bca67 add support of ChatBackground 2024-05-09 21:54:24 +06:00
7e986b2088 update polls 2024-05-07 18:17:20 +06:00
cfc2fd1b47 fixes in sends and poll.kt 2024-05-07 16:15:40 +06:00
905486fff9 add support of max_reaction_count 2024-05-07 00:25:27 +06:00
6acf4bc927 almost completed implementation of polls changes 2024-05-07 00:20:53 +06:00
64a1aeef2c migrate 12.1.0 -> 13.0.0 2024-05-06 22:10:19 +06:00
6db88eb8bd add live_period in editing of live location 2024-05-06 21:51:24 +06:00
4e416aaf44 add LiveLocation.Companion#INDEFINITE_LIVE_PERIOD 2024-05-06 21:41:01 +06:00
71b9f15e40 ChatMemberUpdated 2024-05-06 21:37:44 +06:00
4dc2bfc8bf start 12.1.0 2024-05-06 21:33:35 +06:00
31c1055f3d Merge pull request #846 from InsanusMokrassar/12.0.1
12.0.1
2024-04-22 16:23:34 +06:00
3da2229a9c Update CHANGELOG.md 2024-04-22 14:41:53 +06:00
624289cc8e Update MicroUtils to last 0.20.45 version 2024-04-22 14:41:31 +06:00
9edc8a0d5a update dependencies 2024-04-22 11:40:53 +06:00
3bf914471a start 12.0.1 2024-04-22 11:35:34 +06:00
7d3c8a2d27 Merge pull request #843 from InsanusMokrassar/12.0.0
12.0.0
2024-04-20 23:35:13 +06:00
199 changed files with 10705 additions and 4116 deletions

View File

@@ -1,5 +1,63 @@
# TelegramBotAPI changelog # TelegramBotAPI changelog
## 15.0.0
**THIS UPDATE CONTAINS BREAKING CHANGES**
**THIS UPDATE CONTAINS ADDING OF SUPPORT FOR BOTS API 7.5**
* `Version`:
* `MicroUtils`: `0.21.0` -> `0.21.1`
* A lot of `edit` methods and classes has been changed to support business connection id
## 14.1.0
* `Version`:
* `Coroutines`: `1.8.0` -> `1.8.1`
* `Ktor`: `2.3.10` -> `2.3.11`
* `MicroUtils`: `0.20.45` -> `0.21.0`
* `KSLog`: `1.3.3` -> `1.3.4`
* `BehaviourBuilder`:
* `BehaviourContext` updates listening job will be weakly subscribed. It means that `BehaviourContext` scope will
not be prevented from cancelling by this job anymore
* `BehaviourContext.doInContext` will not stop automatically current `BehaviourContext` job anymore
* `BehaviourContext.createSubContextAndDoWithUpdatesFilter` will use `supervisorScope` instead of
`LinkedSupervisorScope`. That will prevent scope leaking in runtime
## 14.0.1
* In `core` and `api` modules related to invoices changed their APIs to suite current API
## 14.0.0
**Add support of [Telegram Bots API 7.4](https://core.telegram.org/bots/api-changelog#may-28-2024)**
**THIS UPDATE CONTAINS BREAKING CHANGES**
* `Core`:
* `TelegramPaymentChargeId` has been added as value class and replaced raw strings in `SuccessfulPayment` type of `telegramPaymentChargeId`
* All the methods/classes related to sending of messages got `effectId` parameter
* All the methods/classes related to sending of photos/animations/videos got `showCaptionAboveMedia` parameter
## 13.0.0
**Add support of [Telegram Bots API 7.3](https://core.telegram.org/bots/api-changelog#may-6-2024)**
**THIS UPDATE CONTAINS BREAKING CHANGES**
* `Core`:
* For polls, `textSources` now means `question` text sources. For `QuizPoll` there are `explanation` and `explanationTextSources`
for hinting
* `API`:
* A lot of API related to `Poll`s has been changed to include opportunity to pass `ParseMode` and `TextSource`s list
## 12.0.1
* `Version`:
* `Ktor`: `2.3.9` -> `2.3.10`
* `MicroUtils`: `0.20.39` -> `0.20.45`
* `UUID`: `0.8.2` -> `0.8.4`
## 12.0.0 ## 12.0.0
**Add support of [Telegram Bots API 7.2](https://core.telegram.org/bots/api-changelog#march-31-2024)** **Add support of [Telegram Bots API 7.2](https://core.telegram.org/bots/api-changelog#march-31-2024)**

View File

@@ -1,4 +1,4 @@
# TelegramBotAPI [![Maven Central](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi/badge.svg)](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi) [![Supported version](https://img.shields.io/badge/Telegram%20Bot%20API-7.2-blue)](https://core.telegram.org/bots/api-changelog#march-31-2024) # TelegramBotAPI [![Maven Central](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi/badge.svg)](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi) [![Supported version](https://img.shields.io/badge/Telegram%20Bot%20API-7.5-blue)](https://core.telegram.org/bots/api-changelog#june-18-2024)
| Docs | [![KDocs](https://img.shields.io/static/v1?label=Dokka&message=KDocs&color=blue&logo=kotlin)](https://tgbotapi.inmo.dev/index.html) [![Mini tutorial](https://img.shields.io/static/v1?label=Mk&message=Docs&color=blue&logo=mkdocs)](https://docs.inmo.dev/tgbotapi/index.html) | | Docs | [![KDocs](https://img.shields.io/static/v1?label=Dokka&message=KDocs&color=blue&logo=kotlin)](https://tgbotapi.inmo.dev/index.html) [![Mini tutorial](https://img.shields.io/static/v1?label=Mk&message=Docs&color=blue&logo=mkdocs)](https://docs.inmo.dev/tgbotapi/index.html) |
|:----------------------:|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:| |:----------------------:|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|

View File

@@ -6,4 +6,4 @@ kotlin.incremental=true
kotlin.incremental.js=true kotlin.incremental.js=true
library_group=dev.inmo library_group=dev.inmo
library_version=12.0.0 library_version=15.0.0

View File

@@ -2,19 +2,19 @@
kotlin = "1.9.23" kotlin = "1.9.23"
kotlin-serialization = "1.6.3" kotlin-serialization = "1.6.3"
kotlin-coroutines = "1.8.0" kotlin-coroutines = "1.8.1"
javax-activation = "1.1.1" javax-activation = "1.1.1"
korlibs = "5.4.0" korlibs = "5.4.0"
uuid = "0.8.2" uuid = "0.8.4"
ktor = "2.3.9" ktor = "2.3.11"
ksp = "1.9.23-1.0.19" ksp = "1.9.23-1.0.20"
kotlin-poet = "1.16.0" kotlin-poet = "1.16.0"
microutils = "0.20.39" microutils = "0.21.1"
kslog = "1.3.3" kslog = "1.3.4"
versions = "0.51.0" versions = "0.51.0"

View File

@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,7 @@
package dev.inmo.tgbotapi.extensions.api package dev.inmo.tgbotapi.extensions.api
import dev.inmo.micro_utils.coroutines.LinkedSupervisorJob import dev.inmo.micro_utils.coroutines.LinkedSupervisorJob
import dev.inmo.micro_utils.coroutines.LinkedSupervisorScope
import dev.inmo.micro_utils.coroutines.launchSafelyWithoutExceptions import dev.inmo.micro_utils.coroutines.launchSafelyWithoutExceptions
import dev.inmo.tgbotapi.abstracts.* import dev.inmo.tgbotapi.abstracts.*
import dev.inmo.tgbotapi.abstracts.types.WithReplyMarkup import dev.inmo.tgbotapi.abstracts.types.WithReplyMarkup
@@ -46,26 +47,36 @@ suspend fun TelegramBot.handleLiveLocation(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
sentMessageFlow: FlowCollector<ContentMessage<LocationContent>>? = null sentMessageFlow: FlowCollector<ContentMessage<LocationContent>>? = null
) { ) {
var currentLiveLocationMessage: ContentMessage<LocationContent>? = null var currentLiveLocationMessage: ContentMessage<LocationContent>? = null
val updateMessageJob = CoroutineScope(currentCoroutineContext().LinkedSupervisorJob()).launchSafelyWithoutExceptions(start = CoroutineStart.LAZY) { val updateMessageJob = if (liveTimeMillis == indefiniteLivePeriodDelayMillis) { // do not launch refreshing of message for indefinite live locations
while (isActive) { null
delay(liveTimeMillis) } else {
// Remove previous location message info to resend live location message val scope = currentCoroutineContext().LinkedSupervisorScope()
currentLiveLocationMessage = null scope.launchSafelyWithoutExceptions(start = CoroutineStart.LAZY) {
while (scope.isActive) {
delay(liveTimeMillis)
// Remove previous location message info to resend live location message
currentLiveLocationMessage = null
}
} }
} }
locationsFlow.collect { locationsFlow.collect {
val capturedLiveLocationMessage = currentLiveLocationMessage val capturedLiveLocationMessage = currentLiveLocationMessage
if (capturedLiveLocationMessage == null) { if (capturedLiveLocationMessage == null) {
updateMessageJob.start() updateMessageJob ?.start()
currentLiveLocationMessage = send( currentLiveLocationMessage = send(
chatId, chatId,
it.latitude, it.latitude,
it.longitude, it.longitude,
ceil(liveTimeMillis.toDouble() / 1000).toInt(), if (liveTimeMillis == indefiniteLivePeriodDelayMillis) {
LiveLocation.INDEFINITE_LIVE_PERIOD
} else {
ceil(liveTimeMillis.toDouble() / 1000).toInt()
},
it.horizontalAccuracy, it.horizontalAccuracy,
it.heading, it.heading,
it.proximityAlertRadius, it.proximityAlertRadius,
@@ -73,6 +84,7 @@ suspend fun TelegramBot.handleLiveLocation(
businessConnectionId, businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
effectId,
replyParameters, replyParameters,
it.replyMarkup it.replyMarkup
).also { ).also {
@@ -80,13 +92,13 @@ suspend fun TelegramBot.handleLiveLocation(
} }
} else { } else {
edit( edit(
capturedLiveLocationMessage, message = capturedLiveLocationMessage,
it.latitude, latitude = it.latitude,
it.longitude, longitude = it.longitude,
it.horizontalAccuracy, horizontalAccuracy = it.horizontalAccuracy,
it.heading, heading = it.heading,
it.proximityAlertRadius, proximityAlertRadius = it.proximityAlertRadius,
it.replyMarkup replyMarkup = it.replyMarkup
).also { ).also {
sentMessageFlow ?.emit(it) sentMessageFlow ?.emit(it)
} }
@@ -108,12 +120,13 @@ suspend fun TelegramBot.handleLiveLocation(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
sentMessageFlow: FlowCollector<ContentMessage<LocationContent>>? = null sentMessageFlow: FlowCollector<ContentMessage<LocationContent>>? = null
) { ) {
handleLiveLocation( handleLiveLocation(
chatId, chatId = chatId,
locationsFlow.map { locationsFlow = locationsFlow.map {
EditLiveLocationInfo( EditLiveLocationInfo(
it.latitude, it.latitude,
it.longitude, it.longitude,
@@ -123,13 +136,14 @@ suspend fun TelegramBot.handleLiveLocation(
(it as? WithReplyMarkup) ?.replyMarkup as? InlineKeyboardMarkup (it as? WithReplyMarkup) ?.replyMarkup as? InlineKeyboardMarkup
) )
}, },
liveTimeMillis, liveTimeMillis = liveTimeMillis,
threadId, threadId = threadId,
businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification, disableNotification = disableNotification,
protectContent, protectContent = protectContent,
replyParameters, effectId = effectId,
sentMessageFlow replyParameters = replyParameters,
sentMessageFlow = sentMessageFlow
) )
} }
@@ -147,23 +161,25 @@ suspend fun TelegramBot.handleLiveLocation(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
sentMessageFlow: FlowCollector<ContentMessage<LocationContent>>? = null sentMessageFlow: FlowCollector<ContentMessage<LocationContent>>? = null
) { ) {
handleLiveLocation( handleLiveLocation(
chatId, chatId = chatId,
locationsFlow.map { (lat, long) -> locationsFlow = locationsFlow.map { (lat, long) ->
EditLiveLocationInfo( EditLiveLocationInfo(
lat, lat,
long long
) )
}, },
liveTimeMillis, liveTimeMillis = liveTimeMillis,
threadId, threadId = threadId,
businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification, disableNotification = disableNotification,
protectContent, protectContent = protectContent,
replyParameters, effectId = effectId,
sentMessageFlow replyParameters = replyParameters,
sentMessageFlow = sentMessageFlow
) )
} }

View File

@@ -23,7 +23,8 @@ import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
import kotlin.math.ceil import kotlin.math.ceil
val defaultLivePeriodDelayMillis = (livePeriodLimit.last - 60L) * 1000L const val indefiniteLivePeriodDelayMillis = LiveLocation.INDEFINITE_LIVE_PERIOD * 1000L
const val defaultLivePeriodDelayMillis = indefiniteLivePeriodDelayMillis
/** /**
* @see startLiveLocation * @see startLiveLocation
@@ -64,7 +65,7 @@ class LiveLocationProvider internal constructor(
message = requestsExecutor.editLiveLocation( message = requestsExecutor.editLiveLocation(
message, message,
location, location,
replyMarkup replyMarkup = replyMarkup
) )
return lastLocation return lastLocation
} else { } else {
@@ -98,6 +99,7 @@ suspend fun TelegramBot.startLiveLocation(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): LiveLocationProvider { ): LiveLocationProvider {
@@ -115,6 +117,7 @@ suspend fun TelegramBot.startLiveLocation(
businessConnectionId, businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
effectId,
replyParameters, replyParameters,
replyMarkup replyMarkup
) )
@@ -145,6 +148,7 @@ suspend fun TelegramBot.startLiveLocation(
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): LiveLocationProvider = startLiveLocation( ): LiveLocationProvider = startLiveLocation(
@@ -160,6 +164,7 @@ suspend fun TelegramBot.startLiveLocation(
businessConnectionId, businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
effectId,
replyParameters, replyParameters,
replyMarkup replyMarkup
) )
@@ -180,6 +185,7 @@ suspend fun TelegramBot.startLiveLocation(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): LiveLocationProvider = startLiveLocation( ): LiveLocationProvider = startLiveLocation(
@@ -195,6 +201,7 @@ suspend fun TelegramBot.startLiveLocation(
businessConnectionId, businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
effectId,
replyParameters, replyParameters,
replyMarkup replyMarkup
) )
@@ -215,6 +222,7 @@ suspend fun TelegramBot.startLiveLocation(
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): LiveLocationProvider = startLiveLocation( ): LiveLocationProvider = startLiveLocation(
@@ -230,6 +238,7 @@ suspend fun TelegramBot.startLiveLocation(
businessConnectionId, businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
effectId,
replyParameters, replyParameters,
replyMarkup replyMarkup
) )
@@ -251,6 +260,7 @@ suspend inline fun TelegramBot.replyWithLiveLocation(
businessConnectionId: BusinessConnectionId? = to.businessConnectionId, businessConnectionId: BusinessConnectionId? = to.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = startLiveLocation( ) = startLiveLocation(
@@ -266,6 +276,7 @@ suspend inline fun TelegramBot.replyWithLiveLocation(
businessConnectionId, businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
effectId,
ReplyParameters(to.metaInfo, allowSendingWithoutReply = allowSendingWithoutReply), ReplyParameters(to.metaInfo, allowSendingWithoutReply = allowSendingWithoutReply),
replyMarkup replyMarkup
) )
@@ -286,6 +297,7 @@ suspend inline fun TelegramBot.replyWithLiveLocation(
businessConnectionId: BusinessConnectionId? = to.businessConnectionId, businessConnectionId: BusinessConnectionId? = to.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = startLiveLocation( ) = startLiveLocation(
@@ -300,6 +312,7 @@ suspend inline fun TelegramBot.replyWithLiveLocation(
businessConnectionId, businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
effectId,
ReplyParameters(to.metaInfo, allowSendingWithoutReply = allowSendingWithoutReply), ReplyParameters(to.metaInfo, allowSendingWithoutReply = allowSendingWithoutReply),
replyMarkup replyMarkup
) )

View File

@@ -3,6 +3,7 @@ package dev.inmo.tgbotapi.extensions.api
import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.StopPoll import dev.inmo.tgbotapi.requests.StopPoll
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
import dev.inmo.tgbotapi.types.chat.Chat import dev.inmo.tgbotapi.types.chat.Chat
import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage
@@ -14,9 +15,10 @@ import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage
suspend fun TelegramBot.stopPoll( suspend fun TelegramBot.stopPoll(
chatId: ChatIdentifier, chatId: ChatIdentifier,
messageId: MessageId, messageId: MessageId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
replyMarkup: InlineKeyboardMarkup? = null replyMarkup: InlineKeyboardMarkup? = null
) = execute( ) = execute(
StopPoll(chatId, messageId, replyMarkup) StopPoll(chatId, messageId, businessConnectionId, replyMarkup)
) )
/** /**
@@ -26,8 +28,9 @@ suspend fun TelegramBot.stopPoll(
suspend fun TelegramBot.stopPoll( suspend fun TelegramBot.stopPoll(
chat: Chat, chat: Chat,
messageId: MessageId, messageId: MessageId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
replyMarkup: InlineKeyboardMarkup? = null replyMarkup: InlineKeyboardMarkup? = null
) = stopPoll(chat.id, messageId, replyMarkup) ) = stopPoll(chat.id, messageId, businessConnectionId, replyMarkup)
/** /**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
@@ -36,8 +39,9 @@ suspend fun TelegramBot.stopPoll(
suspend fun TelegramBot.stopPoll( suspend fun TelegramBot.stopPoll(
chatId: IdChatIdentifier, chatId: IdChatIdentifier,
message: AccessibleMessage, message: AccessibleMessage,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
replyMarkup: InlineKeyboardMarkup? = null replyMarkup: InlineKeyboardMarkup? = null
) = stopPoll(chatId, message.messageId, replyMarkup) ) = stopPoll(chatId, message.messageId, businessConnectionId, replyMarkup)
/** /**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
@@ -46,5 +50,6 @@ suspend fun TelegramBot.stopPoll(
suspend fun TelegramBot.stopPoll( suspend fun TelegramBot.stopPoll(
chat: Chat, chat: Chat,
message: AccessibleMessage, message: AccessibleMessage,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
replyMarkup: InlineKeyboardMarkup? = null replyMarkup: InlineKeyboardMarkup? = null
) = stopPoll(chat.id, message.messageId, replyMarkup) ) = stopPoll(chat.id, message.messageId, businessConnectionId, replyMarkup)

View File

@@ -8,6 +8,7 @@ import dev.inmo.tgbotapi.extensions.api.edit.media.editMessageMedia
import dev.inmo.tgbotapi.extensions.api.edit.reply_markup.editMessageReplyMarkup import dev.inmo.tgbotapi.extensions.api.edit.reply_markup.editMessageReplyMarkup
import dev.inmo.tgbotapi.extensions.api.edit.text.editMessageText import dev.inmo.tgbotapi.extensions.api.edit.text.editMessageText
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
import dev.inmo.tgbotapi.types.chat.Chat import dev.inmo.tgbotapi.types.chat.Chat
import dev.inmo.tgbotapi.types.location.LiveLocation import dev.inmo.tgbotapi.types.location.LiveLocation
@@ -29,9 +30,11 @@ suspend fun <T> TelegramBot.edit(
message: ContentMessage<T>, message: ContentMessage<T>,
text: String, text: String,
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
showCaptionAboveMedia: Boolean = false,
replyMarkup: InlineKeyboardMarkup? = null replyMarkup: InlineKeyboardMarkup? = null
): ContentMessage<T> where T : TextedWithTextSources, T : MediaContent { ): ContentMessage<T> where T : TextedWithTextSources, T : MediaContent {
return editMessageCaption(message, text, parseMode, replyMarkup) return editMessageCaption(message, text, parseMode, businessConnectionId, showCaptionAboveMedia, replyMarkup)
} }
/** /**
@@ -41,9 +44,11 @@ suspend fun <T> TelegramBot.edit(
suspend fun <T> TelegramBot.edit( suspend fun <T> TelegramBot.edit(
message: ContentMessage<T>, message: ContentMessage<T>,
entities: List<TextSource>, entities: List<TextSource>,
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
showCaptionAboveMedia: Boolean = false,
replyMarkup: InlineKeyboardMarkup? = null replyMarkup: InlineKeyboardMarkup? = null
): ContentMessage<T> where T : TextedWithTextSources, T : MediaContent { ): ContentMessage<T> where T : TextedWithTextSources, T : MediaContent {
return editMessageCaption(message, entities, replyMarkup) return editMessageCaption(message, entities, businessConnectionId, showCaptionAboveMedia, replyMarkup)
} }
/** /**
@@ -55,11 +60,13 @@ suspend fun TelegramBot.edit(
messageId: MessageId, messageId: MessageId,
latitude: Double, latitude: Double,
longitude: Double, longitude: Double,
livePeriod: Seconds? = null,
horizontalAccuracy: Meters? = null, horizontalAccuracy: Meters? = null,
heading: Degrees? = null, heading: Degrees? = null,
proximityAlertRadius: Meters? = null, proximityAlertRadius: Meters? = null,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
replyMarkup: InlineKeyboardMarkup? = null replyMarkup: InlineKeyboardMarkup? = null
) = editLiveLocation(chatId, messageId, latitude, longitude, horizontalAccuracy, heading, proximityAlertRadius, replyMarkup) ) = editLiveLocation(chatId, messageId, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, businessConnectionId, replyMarkup)
/** /**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
@@ -70,11 +77,13 @@ suspend fun TelegramBot.edit(
messageId: MessageId, messageId: MessageId,
latitude: Double, latitude: Double,
longitude: Double, longitude: Double,
livePeriod: Seconds? = null,
horizontalAccuracy: Meters? = null, horizontalAccuracy: Meters? = null,
heading: Degrees? = null, heading: Degrees? = null,
proximityAlertRadius: Meters? = null, proximityAlertRadius: Meters? = null,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
replyMarkup: InlineKeyboardMarkup? = null replyMarkup: InlineKeyboardMarkup? = null
) = editLiveLocation(chat, messageId, latitude, longitude, horizontalAccuracy, heading, proximityAlertRadius, replyMarkup) ) = editLiveLocation(chat, messageId, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, businessConnectionId, replyMarkup)
/** /**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
@@ -84,11 +93,13 @@ suspend fun TelegramBot.edit(
message: ContentMessage<LocationContent>, message: ContentMessage<LocationContent>,
latitude: Double, latitude: Double,
longitude: Double, longitude: Double,
livePeriod: Seconds? = null,
horizontalAccuracy: Meters? = null, horizontalAccuracy: Meters? = null,
heading: Degrees? = null, heading: Degrees? = null,
proximityAlertRadius: Meters? = null, proximityAlertRadius: Meters? = null,
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
replyMarkup: InlineKeyboardMarkup? = null replyMarkup: InlineKeyboardMarkup? = null
) = editLiveLocation(message, latitude, longitude, horizontalAccuracy, heading, proximityAlertRadius, replyMarkup) ) = editLiveLocation(message, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, businessConnectionId, replyMarkup)
/** /**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
@@ -98,9 +109,10 @@ suspend fun TelegramBot.edit(
chatId: ChatIdentifier, chatId: ChatIdentifier,
messageId: MessageId, messageId: MessageId,
location: LiveLocation, location: LiveLocation,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
replyMarkup: InlineKeyboardMarkup? = null replyMarkup: InlineKeyboardMarkup? = null
) = editLiveLocation( ) = editLiveLocation(
chatId, messageId, location, replyMarkup chatId, messageId, location, businessConnectionId, replyMarkup
) )
/** /**
@@ -111,8 +123,9 @@ suspend fun TelegramBot.edit(
chat: Chat, chat: Chat,
messageId: MessageId, messageId: MessageId,
location: LiveLocation, location: LiveLocation,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
replyMarkup: InlineKeyboardMarkup? = null replyMarkup: InlineKeyboardMarkup? = null
) = editLiveLocation(chat, messageId, location, replyMarkup) ) = editLiveLocation(chat, messageId, location, businessConnectionId, replyMarkup)
/** /**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
@@ -121,8 +134,9 @@ suspend fun TelegramBot.edit(
suspend fun TelegramBot.edit( suspend fun TelegramBot.edit(
message: ContentMessage<LocationContent>, message: ContentMessage<LocationContent>,
location: LiveLocation, location: LiveLocation,
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
replyMarkup: InlineKeyboardMarkup? = null replyMarkup: InlineKeyboardMarkup? = null
) = editLiveLocation(message, location, replyMarkup) ) = editLiveLocation(message, location, businessConnectionId, replyMarkup)
/** /**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
@@ -132,8 +146,9 @@ suspend fun TelegramBot.edit(
chatId: ChatIdentifier, chatId: ChatIdentifier,
messageId: MessageId, messageId: MessageId,
media: TelegramMedia, media: TelegramMedia,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
replyMarkup: InlineKeyboardMarkup? = null replyMarkup: InlineKeyboardMarkup? = null
) = editMessageMedia(chatId, messageId, media, replyMarkup) ) = editMessageMedia(chatId, messageId, media, businessConnectionId, replyMarkup)
/** /**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
@@ -143,8 +158,9 @@ suspend fun TelegramBot.edit(
chat: Chat, chat: Chat,
messageId: MessageId, messageId: MessageId,
media: TelegramMedia, media: TelegramMedia,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
replyMarkup: InlineKeyboardMarkup? = null replyMarkup: InlineKeyboardMarkup? = null
) = editMessageMedia(chat, messageId, media, replyMarkup) ) = editMessageMedia(chat, messageId, media, businessConnectionId, replyMarkup)
/** /**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
@@ -153,8 +169,9 @@ suspend fun TelegramBot.edit(
suspend fun TelegramBot.edit( suspend fun TelegramBot.edit(
message: ContentMessage<MediaContent>, message: ContentMessage<MediaContent>,
media: TelegramMedia, media: TelegramMedia,
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
replyMarkup: InlineKeyboardMarkup? = null replyMarkup: InlineKeyboardMarkup? = null
) = editMessageMedia(message, media, replyMarkup) ) = editMessageMedia(message, media, businessConnectionId, replyMarkup)
/** /**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
@@ -163,8 +180,9 @@ suspend fun TelegramBot.edit(
suspend fun TelegramBot.edit( suspend fun TelegramBot.edit(
chatId: ChatIdentifier, chatId: ChatIdentifier,
messageId: MessageId, messageId: MessageId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
replyMarkup: InlineKeyboardMarkup? = null replyMarkup: InlineKeyboardMarkup? = null
) = editMessageReplyMarkup(chatId, messageId, replyMarkup) ) = editMessageReplyMarkup(chatId, messageId, businessConnectionId, replyMarkup)
/** /**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
@@ -173,8 +191,9 @@ suspend fun TelegramBot.edit(
suspend fun TelegramBot.edit( suspend fun TelegramBot.edit(
chat: Chat, chat: Chat,
messageId: MessageId, messageId: MessageId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
replyMarkup: InlineKeyboardMarkup? = null replyMarkup: InlineKeyboardMarkup? = null
) = editMessageReplyMarkup(chat, messageId, replyMarkup) ) = editMessageReplyMarkup(chat, messageId, businessConnectionId, replyMarkup)
/** /**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
@@ -182,8 +201,9 @@ suspend fun TelegramBot.edit(
*/ */
suspend fun TelegramBot.edit( suspend fun TelegramBot.edit(
message: AccessibleMessage, message: AccessibleMessage,
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
replyMarkup: InlineKeyboardMarkup? = null replyMarkup: InlineKeyboardMarkup? = null
) = editMessageReplyMarkup(message, replyMarkup) ) = editMessageReplyMarkup(message, businessConnectionId, replyMarkup)
/** /**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
@@ -194,9 +214,10 @@ suspend fun TelegramBot.edit(
messageId: MessageId, messageId: MessageId,
text: String, text: String,
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
linkPreviewOptions: LinkPreviewOptions? = null, linkPreviewOptions: LinkPreviewOptions? = null,
replyMarkup: InlineKeyboardMarkup? = null replyMarkup: InlineKeyboardMarkup? = null
) = editMessageText(chatId, messageId, text, parseMode, linkPreviewOptions, replyMarkup) ) = editMessageText(chatId, messageId, text, parseMode, businessConnectionId, linkPreviewOptions, replyMarkup)
/** /**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
@@ -206,9 +227,10 @@ suspend fun TelegramBot.edit(
chatId: ChatIdentifier, chatId: ChatIdentifier,
messageId: MessageId, messageId: MessageId,
entities: TextSourcesList, entities: TextSourcesList,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
linkPreviewOptions: LinkPreviewOptions? = null, linkPreviewOptions: LinkPreviewOptions? = null,
replyMarkup: InlineKeyboardMarkup? = null replyMarkup: InlineKeyboardMarkup? = null
) = editMessageText(chatId, messageId, entities, linkPreviewOptions, replyMarkup) ) = editMessageText(chatId, messageId, entities, businessConnectionId, linkPreviewOptions, replyMarkup)
/** /**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
@@ -218,10 +240,11 @@ suspend fun TelegramBot.edit(
chatId: ChatIdentifier, chatId: ChatIdentifier,
messageId: MessageId, messageId: MessageId,
separator: TextSource? = null, separator: TextSource? = null,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
linkPreviewOptions: LinkPreviewOptions? = null, linkPreviewOptions: LinkPreviewOptions? = null,
replyMarkup: InlineKeyboardMarkup? = null, replyMarkup: InlineKeyboardMarkup? = null,
builderBody: EntitiesBuilderBody builderBody: EntitiesBuilderBody
) = edit(chatId, messageId, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup) ) = edit(chatId, messageId, buildEntities(separator, builderBody), businessConnectionId, linkPreviewOptions, replyMarkup)
/** /**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
@@ -231,10 +254,11 @@ suspend fun TelegramBot.edit(
chatId: ChatIdentifier, chatId: ChatIdentifier,
messageId: MessageId, messageId: MessageId,
separator: String, separator: String,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
linkPreviewOptions: LinkPreviewOptions? = null, linkPreviewOptions: LinkPreviewOptions? = null,
replyMarkup: InlineKeyboardMarkup? = null, replyMarkup: InlineKeyboardMarkup? = null,
builderBody: EntitiesBuilderBody builderBody: EntitiesBuilderBody
) = edit(chatId, messageId, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup) ) = edit(chatId, messageId, buildEntities(separator, builderBody), businessConnectionId, linkPreviewOptions, replyMarkup)
/** /**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
@@ -244,9 +268,10 @@ suspend fun TelegramBot.edit(
message: ContentMessage<TextContent>, message: ContentMessage<TextContent>,
text: String, text: String,
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
linkPreviewOptions: LinkPreviewOptions? = null, linkPreviewOptions: LinkPreviewOptions? = null,
replyMarkup: InlineKeyboardMarkup? = null replyMarkup: InlineKeyboardMarkup? = null
) = edit(message.chat.id, message.messageId, text, parseMode, linkPreviewOptions, replyMarkup) ) = edit(message.chat.id, message.messageId, text, parseMode, businessConnectionId, linkPreviewOptions, replyMarkup)
/** /**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
@@ -255,9 +280,10 @@ suspend fun TelegramBot.edit(
suspend fun TelegramBot.edit( suspend fun TelegramBot.edit(
message: ContentMessage<TextContent>, message: ContentMessage<TextContent>,
entities: TextSourcesList, entities: TextSourcesList,
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
linkPreviewOptions: LinkPreviewOptions? = null, linkPreviewOptions: LinkPreviewOptions? = null,
replyMarkup: InlineKeyboardMarkup? = null replyMarkup: InlineKeyboardMarkup? = null
) = edit(message.chat.id, message.messageId, entities, linkPreviewOptions, replyMarkup) ) = edit(message.chat.id, message.messageId, entities, businessConnectionId, linkPreviewOptions, replyMarkup)
/** /**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
@@ -266,10 +292,11 @@ suspend fun TelegramBot.edit(
suspend fun TelegramBot.edit( suspend fun TelegramBot.edit(
message: ContentMessage<TextContent>, message: ContentMessage<TextContent>,
separator: TextSource? = null, separator: TextSource? = null,
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
linkPreviewOptions: LinkPreviewOptions? = null, linkPreviewOptions: LinkPreviewOptions? = null,
replyMarkup: InlineKeyboardMarkup? = null, replyMarkup: InlineKeyboardMarkup? = null,
builderBody: EntitiesBuilderBody builderBody: EntitiesBuilderBody
) = edit(message, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup) ) = edit(message, buildEntities(separator, builderBody), businessConnectionId, linkPreviewOptions, replyMarkup)
/** /**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
@@ -278,10 +305,11 @@ suspend fun TelegramBot.edit(
suspend fun TelegramBot.edit( suspend fun TelegramBot.edit(
message: ContentMessage<TextContent>, message: ContentMessage<TextContent>,
separator: String, separator: String,
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
linkPreviewOptions: LinkPreviewOptions? = null, linkPreviewOptions: LinkPreviewOptions? = null,
replyMarkup: InlineKeyboardMarkup? = null, replyMarkup: InlineKeyboardMarkup? = null,
builderBody: EntitiesBuilderBody builderBody: EntitiesBuilderBody
) = edit(message, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup) ) = edit(message, buildEntities(separator, builderBody), businessConnectionId, linkPreviewOptions, replyMarkup)
/** /**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
@@ -290,10 +318,11 @@ suspend fun TelegramBot.edit(
suspend fun TelegramBot.editMessageText( suspend fun TelegramBot.editMessageText(
message: ContentMessage<TextContent>, message: ContentMessage<TextContent>,
separator: TextSource? = null, separator: TextSource? = null,
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
linkPreviewOptions: LinkPreviewOptions? = null, linkPreviewOptions: LinkPreviewOptions? = null,
replyMarkup: InlineKeyboardMarkup? = null, replyMarkup: InlineKeyboardMarkup? = null,
builderBody: EntitiesBuilderBody builderBody: EntitiesBuilderBody
) = edit(message, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup) ) = edit(message, buildEntities(separator, builderBody), businessConnectionId, linkPreviewOptions, replyMarkup)
/** /**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
@@ -302,7 +331,8 @@ suspend fun TelegramBot.editMessageText(
suspend fun TelegramBot.editMessageText( suspend fun TelegramBot.editMessageText(
message: ContentMessage<TextContent>, message: ContentMessage<TextContent>,
separator: String, separator: String,
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
linkPreviewOptions: LinkPreviewOptions? = null, linkPreviewOptions: LinkPreviewOptions? = null,
replyMarkup: InlineKeyboardMarkup? = null, replyMarkup: InlineKeyboardMarkup? = null,
builderBody: EntitiesBuilderBody builderBody: EntitiesBuilderBody
) = edit(message, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup) ) = edit(message, buildEntities(separator, builderBody), businessConnectionId, linkPreviewOptions, replyMarkup)

View File

@@ -68,9 +68,10 @@ suspend fun TelegramBot.edit(
messageId: InlineMessageId, messageId: InlineMessageId,
text: String, text: String,
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
showCaptionAboveMedia: Boolean = false,
linkPreviewOptions: LinkPreviewOptions? = null, linkPreviewOptions: LinkPreviewOptions? = null,
replyMarkup: InlineKeyboardMarkup? = null replyMarkup: InlineKeyboardMarkup? = null
) = editMessageText(messageId, text, parseMode, linkPreviewOptions, replyMarkup) ) = editMessageText(messageId, text, parseMode, showCaptionAboveMedia, linkPreviewOptions, replyMarkup)
/** /**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
@@ -79,9 +80,10 @@ suspend fun TelegramBot.edit(
suspend fun TelegramBot.edit( suspend fun TelegramBot.edit(
messageId: InlineMessageId, messageId: InlineMessageId,
entities: TextSourcesList, entities: TextSourcesList,
showCaptionAboveMedia: Boolean = false,
linkPreviewOptions: LinkPreviewOptions? = null, linkPreviewOptions: LinkPreviewOptions? = null,
replyMarkup: InlineKeyboardMarkup? = null replyMarkup: InlineKeyboardMarkup? = null
) = editMessageText(messageId, entities, linkPreviewOptions, replyMarkup) ) = editMessageText(messageId, entities, showCaptionAboveMedia, linkPreviewOptions, replyMarkup)
/** /**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
@@ -89,11 +91,12 @@ suspend fun TelegramBot.edit(
*/ */
suspend fun TelegramBot.edit( suspend fun TelegramBot.edit(
messageId: InlineMessageId, messageId: InlineMessageId,
showCaptionAboveMedia: Boolean = false,
separator: TextSource? = null, separator: TextSource? = null,
linkPreviewOptions: LinkPreviewOptions? = null, linkPreviewOptions: LinkPreviewOptions? = null,
replyMarkup: InlineKeyboardMarkup? = null, replyMarkup: InlineKeyboardMarkup? = null,
builderBody: EntitiesBuilderBody builderBody: EntitiesBuilderBody
) = edit(messageId, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup) ) = edit(messageId, buildEntities(separator, builderBody), showCaptionAboveMedia, linkPreviewOptions, replyMarkup)
/** /**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
@@ -102,7 +105,8 @@ suspend fun TelegramBot.edit(
suspend fun TelegramBot.edit( suspend fun TelegramBot.edit(
messageId: InlineMessageId, messageId: InlineMessageId,
separator: String, separator: String,
showCaptionAboveMedia: Boolean = false,
linkPreviewOptions: LinkPreviewOptions? = null, linkPreviewOptions: LinkPreviewOptions? = null,
replyMarkup: InlineKeyboardMarkup? = null, replyMarkup: InlineKeyboardMarkup? = null,
builderBody: EntitiesBuilderBody builderBody: EntitiesBuilderBody
) = edit(messageId, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup) ) = edit(messageId, buildEntities(separator, builderBody), showCaptionAboveMedia, linkPreviewOptions, replyMarkup)

View File

@@ -7,6 +7,8 @@ import dev.inmo.tgbotapi.types.ChatIdentifier
import dev.inmo.tgbotapi.types.message.textsources.TextSource import dev.inmo.tgbotapi.types.message.textsources.TextSource
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
import dev.inmo.tgbotapi.types.MessageId import dev.inmo.tgbotapi.types.MessageId
import dev.inmo.tgbotapi.types.businessConnectionId
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.message.ParseMode import dev.inmo.tgbotapi.types.message.ParseMode
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
import dev.inmo.tgbotapi.types.chat.Chat import dev.inmo.tgbotapi.types.chat.Chat
@@ -24,9 +26,11 @@ suspend fun TelegramBot.editMessageCaption(
messageId: MessageId, messageId: MessageId,
text: String, text: String,
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
showCaptionAboveMedia: Boolean = false,
replyMarkup: InlineKeyboardMarkup? = null replyMarkup: InlineKeyboardMarkup? = null
) = execute( ) = execute(
EditChatMessageCaption(chatId, messageId, text, parseMode, replyMarkup) EditChatMessageCaption(chatId, messageId, text, parseMode, businessConnectionId, showCaptionAboveMedia, replyMarkup)
) )
/** /**
@@ -38,8 +42,10 @@ suspend fun TelegramBot.editMessageCaption(
messageId: MessageId, messageId: MessageId,
text: String, text: String,
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
showCaptionAboveMedia: Boolean = false,
replyMarkup: InlineKeyboardMarkup? = null replyMarkup: InlineKeyboardMarkup? = null
) = editMessageCaption(chat.id, messageId, text, parseMode, replyMarkup) ) = editMessageCaption(chat.id, messageId, text, parseMode, businessConnectionId, showCaptionAboveMedia, replyMarkup)
/** /**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
@@ -49,10 +55,12 @@ suspend fun <T> TelegramBot.editMessageCaption(
message: ContentMessage<T>, message: ContentMessage<T>,
text: String, text: String,
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
showCaptionAboveMedia: Boolean = false,
replyMarkup: InlineKeyboardMarkup? = null replyMarkup: InlineKeyboardMarkup? = null
): ContentMessage<T> where T : TextedWithTextSources, T : MediaContent { ): ContentMessage<T> where T : TextedWithTextSources, T : MediaContent {
@Suppress("UNCHECKED_CAST") @Suppress("UNCHECKED_CAST")
return editMessageCaption(message.chat.id, message.messageId, text, parseMode, replyMarkup) as ContentMessage<T> return editMessageCaption(message.chat.id, message.messageId, text, parseMode, businessConnectionId, showCaptionAboveMedia, replyMarkup) as ContentMessage<T>
} }
/** /**
@@ -63,9 +71,11 @@ suspend fun TelegramBot.editMessageCaption(
chatId: ChatIdentifier, chatId: ChatIdentifier,
messageId: MessageId, messageId: MessageId,
entities: TextSourcesList, entities: TextSourcesList,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
showCaptionAboveMedia: Boolean = false,
replyMarkup: InlineKeyboardMarkup? = null replyMarkup: InlineKeyboardMarkup? = null
) = execute( ) = execute(
EditChatMessageCaption(chatId, messageId, entities, replyMarkup) EditChatMessageCaption(chatId, messageId, entities, businessConnectionId, showCaptionAboveMedia, replyMarkup)
) )
/** /**
@@ -75,9 +85,11 @@ suspend fun TelegramBot.editMessageCaption(
suspend fun TelegramBot.editMessageCaption( suspend fun TelegramBot.editMessageCaption(
chat: Chat, chat: Chat,
messageId: MessageId, messageId: MessageId,
entities: List<TextSource>, entities: TextSourcesList,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
showCaptionAboveMedia: Boolean = false,
replyMarkup: InlineKeyboardMarkup? = null replyMarkup: InlineKeyboardMarkup? = null
) = editMessageCaption(chat.id, messageId, entities, replyMarkup) ) = editMessageCaption(chat.id, messageId, entities, businessConnectionId, showCaptionAboveMedia, replyMarkup)
/** /**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
@@ -85,11 +97,13 @@ suspend fun TelegramBot.editMessageCaption(
*/ */
suspend fun <T> TelegramBot.editMessageCaption( suspend fun <T> TelegramBot.editMessageCaption(
message: ContentMessage<T>, message: ContentMessage<T>,
entities: List<TextSource>, entities: TextSourcesList,
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
showCaptionAboveMedia: Boolean = false,
replyMarkup: InlineKeyboardMarkup? = null replyMarkup: InlineKeyboardMarkup? = null
): ContentMessage<T> where T : TextedWithTextSources, T : MediaContent { ): ContentMessage<T> where T : TextedWithTextSources, T : MediaContent {
@Suppress("UNCHECKED_CAST") @Suppress("UNCHECKED_CAST")
return editMessageCaption(message.chat.id, message.messageId, entities, replyMarkup) as ContentMessage<T> return editMessageCaption(message.chat.id, message.messageId, entities, businessConnectionId, showCaptionAboveMedia, replyMarkup) as ContentMessage<T>
} }
/** /**
@@ -99,8 +113,10 @@ suspend fun <T> TelegramBot.editMessageCaption(
@RiskFeature("This method is unsafe due to absence of any guaranties about the type of message. In case if message is not media message this method will throw an exception") @RiskFeature("This method is unsafe due to absence of any guaranties about the type of message. In case if message is not media message this method will throw an exception")
suspend fun <T> TelegramBot.editMessageCaption( suspend fun <T> TelegramBot.editMessageCaption(
message: AccessibleMessage, message: AccessibleMessage,
entities: List<TextSource>, entities: TextSourcesList,
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
showCaptionAboveMedia: Boolean = false,
replyMarkup: InlineKeyboardMarkup? = null replyMarkup: InlineKeyboardMarkup? = null
): ContentMessage<MediaContent> where T : TextedWithTextSources, T : MediaContent { ): ContentMessage<MediaContent> where T : TextedWithTextSources, T : MediaContent {
return editMessageCaption(message.chat.id, message.messageId, entities, replyMarkup) return editMessageCaption(message.chat.id, message.messageId, entities, businessConnectionId, showCaptionAboveMedia, replyMarkup)
} }

View File

@@ -3,6 +3,7 @@ package dev.inmo.tgbotapi.extensions.api.edit.location.live
import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.edit.location.live.EditChatMessageLiveLocation import dev.inmo.tgbotapi.requests.edit.location.live.EditChatMessageLiveLocation
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
import dev.inmo.tgbotapi.types.chat.Chat import dev.inmo.tgbotapi.types.chat.Chat
import dev.inmo.tgbotapi.types.location.LiveLocation import dev.inmo.tgbotapi.types.location.LiveLocation
@@ -18,13 +19,15 @@ suspend fun TelegramBot.editLiveLocation(
messageId: MessageId, messageId: MessageId,
latitude: Double, latitude: Double,
longitude: Double, longitude: Double,
livePeriod: Seconds? = null,
horizontalAccuracy: Meters? = null, horizontalAccuracy: Meters? = null,
heading: Degrees? = null, heading: Degrees? = null,
proximityAlertRadius: Meters? = null, proximityAlertRadius: Meters? = null,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
replyMarkup: InlineKeyboardMarkup? = null replyMarkup: InlineKeyboardMarkup? = null
) = execute( ) = execute(
EditChatMessageLiveLocation( EditChatMessageLiveLocation(
chatId, messageId, latitude, longitude, horizontalAccuracy, heading, proximityAlertRadius, replyMarkup chatId, messageId, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, businessConnectionId, replyMarkup
) )
) )
@@ -37,11 +40,13 @@ suspend fun TelegramBot.editLiveLocation(
messageId: MessageId, messageId: MessageId,
latitude: Double, latitude: Double,
longitude: Double, longitude: Double,
livePeriod: Seconds? = null,
horizontalAccuracy: Meters? = null, horizontalAccuracy: Meters? = null,
heading: Degrees? = null, heading: Degrees? = null,
proximityAlertRadius: Meters? = null, proximityAlertRadius: Meters? = null,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
replyMarkup: InlineKeyboardMarkup? = null replyMarkup: InlineKeyboardMarkup? = null
) = editLiveLocation(chat.id, messageId, latitude, longitude, horizontalAccuracy, heading, proximityAlertRadius, replyMarkup) ) = editLiveLocation(chat.id, messageId, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, businessConnectionId, replyMarkup)
/** /**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
@@ -51,11 +56,13 @@ suspend fun TelegramBot.editLiveLocation(
message: ContentMessage<LocationContent>, message: ContentMessage<LocationContent>,
latitude: Double, latitude: Double,
longitude: Double, longitude: Double,
livePeriod: Seconds? = null,
horizontalAccuracy: Meters? = null, horizontalAccuracy: Meters? = null,
heading: Degrees? = null, heading: Degrees? = null,
proximityAlertRadius: Meters? = null, proximityAlertRadius: Meters? = null,
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
replyMarkup: InlineKeyboardMarkup? = null replyMarkup: InlineKeyboardMarkup? = null
) = editLiveLocation(message.chat, message.messageId, latitude, longitude, horizontalAccuracy, heading, proximityAlertRadius, replyMarkup) ) = editLiveLocation(message.chat, message.messageId, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, businessConnectionId, replyMarkup)
/** /**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
@@ -65,10 +72,11 @@ suspend fun TelegramBot.editLiveLocation(
chatId: ChatIdentifier, chatId: ChatIdentifier,
messageId: MessageId, messageId: MessageId,
location: LiveLocation, location: LiveLocation,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
replyMarkup: InlineKeyboardMarkup? = null replyMarkup: InlineKeyboardMarkup? = null
) = execute( ) = execute(
EditChatMessageLiveLocation( EditChatMessageLiveLocation(
chatId, messageId, location.latitude, location.longitude, location.horizontalAccuracy, location.heading, location.proximityAlertRadius, replyMarkup chatId, messageId, location.latitude, location.longitude, location.livePeriod, location.horizontalAccuracy, location.heading, location.proximityAlertRadius, businessConnectionId, replyMarkup
) )
) )
@@ -80,8 +88,9 @@ suspend fun TelegramBot.editLiveLocation(
chat: Chat, chat: Chat,
messageId: MessageId, messageId: MessageId,
location: LiveLocation, location: LiveLocation,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
replyMarkup: InlineKeyboardMarkup? = null replyMarkup: InlineKeyboardMarkup? = null
) = editLiveLocation(chat.id, messageId, location.latitude, location.longitude, location.horizontalAccuracy, location.heading, location.proximityAlertRadius, replyMarkup) ) = editLiveLocation(chat.id, messageId, location.latitude, location.longitude, location.livePeriod, location.horizontalAccuracy, location.heading, location.proximityAlertRadius, businessConnectionId, replyMarkup)
/** /**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
@@ -90,5 +99,6 @@ suspend fun TelegramBot.editLiveLocation(
suspend fun TelegramBot.editLiveLocation( suspend fun TelegramBot.editLiveLocation(
message: ContentMessage<LocationContent>, message: ContentMessage<LocationContent>,
location: LiveLocation, location: LiveLocation,
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
replyMarkup: InlineKeyboardMarkup? = null replyMarkup: InlineKeyboardMarkup? = null
) = editLiveLocation(message.chat, message.messageId, location.latitude, location.longitude, location.horizontalAccuracy, location.heading, location.proximityAlertRadius, replyMarkup) ) = editLiveLocation(message.chat, message.messageId, location.latitude, location.longitude, location.livePeriod, location.horizontalAccuracy, location.heading, location.proximityAlertRadius, businessConnectionId, replyMarkup)

View File

@@ -4,6 +4,8 @@ import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.edit.location.live.StopChatMessageLiveLocation import dev.inmo.tgbotapi.requests.edit.location.live.StopChatMessageLiveLocation
import dev.inmo.tgbotapi.types.ChatIdentifier import dev.inmo.tgbotapi.types.ChatIdentifier
import dev.inmo.tgbotapi.types.MessageId import dev.inmo.tgbotapi.types.MessageId
import dev.inmo.tgbotapi.types.businessConnectionId
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
import dev.inmo.tgbotapi.types.chat.Chat import dev.inmo.tgbotapi.types.chat.Chat
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
@@ -16,10 +18,11 @@ import dev.inmo.tgbotapi.types.message.content.LocationContent
suspend fun TelegramBot.stopLiveLocation( suspend fun TelegramBot.stopLiveLocation(
chatId: ChatIdentifier, chatId: ChatIdentifier,
messageId: MessageId, messageId: MessageId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
replyMarkup: InlineKeyboardMarkup? = null replyMarkup: InlineKeyboardMarkup? = null
) = execute( ) = execute(
StopChatMessageLiveLocation( StopChatMessageLiveLocation(
chatId, messageId, replyMarkup chatId, messageId, businessConnectionId, replyMarkup
) )
) )
@@ -30,8 +33,9 @@ suspend fun TelegramBot.stopLiveLocation(
suspend fun TelegramBot.stopLiveLocation( suspend fun TelegramBot.stopLiveLocation(
chat: Chat, chat: Chat,
messageId: MessageId, messageId: MessageId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
replyMarkup: InlineKeyboardMarkup? = null replyMarkup: InlineKeyboardMarkup? = null
) = stopLiveLocation(chat.id, messageId, replyMarkup) ) = stopLiveLocation(chat.id, messageId, businessConnectionId, replyMarkup)
/** /**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
@@ -39,5 +43,6 @@ suspend fun TelegramBot.stopLiveLocation(
*/ */
suspend fun TelegramBot.stopLiveLocation( suspend fun TelegramBot.stopLiveLocation(
message: ContentMessage<LocationContent>, message: ContentMessage<LocationContent>,
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
replyMarkup: InlineKeyboardMarkup? = null replyMarkup: InlineKeyboardMarkup? = null
) = stopLiveLocation(message.chat, message.messageId, replyMarkup) ) = stopLiveLocation(message.chat, message.messageId, businessConnectionId, replyMarkup)

View File

@@ -5,6 +5,8 @@ import dev.inmo.tgbotapi.requests.edit.media.EditChatMessageMedia
import dev.inmo.tgbotapi.types.ChatIdentifier import dev.inmo.tgbotapi.types.ChatIdentifier
import dev.inmo.tgbotapi.types.media.TelegramMedia import dev.inmo.tgbotapi.types.media.TelegramMedia
import dev.inmo.tgbotapi.types.MessageId import dev.inmo.tgbotapi.types.MessageId
import dev.inmo.tgbotapi.types.businessConnectionId
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
import dev.inmo.tgbotapi.types.chat.Chat import dev.inmo.tgbotapi.types.chat.Chat
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
@@ -18,9 +20,10 @@ suspend fun TelegramBot.editMessageMedia(
chatId: ChatIdentifier, chatId: ChatIdentifier,
messageId: MessageId, messageId: MessageId,
media: TelegramMedia, media: TelegramMedia,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
replyMarkup: InlineKeyboardMarkup? = null replyMarkup: InlineKeyboardMarkup? = null
) = execute( ) = execute(
EditChatMessageMedia(chatId, messageId, media, replyMarkup) EditChatMessageMedia(chatId, messageId, media, businessConnectionId, replyMarkup)
) )
/** /**
@@ -31,8 +34,9 @@ suspend fun TelegramBot.editMessageMedia(
chat: Chat, chat: Chat,
messageId: MessageId, messageId: MessageId,
media: TelegramMedia, media: TelegramMedia,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
replyMarkup: InlineKeyboardMarkup? = null replyMarkup: InlineKeyboardMarkup? = null
) = editMessageMedia(chat.id, messageId, media, replyMarkup) ) = editMessageMedia(chat.id, messageId, media, businessConnectionId, replyMarkup)
/** /**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
@@ -41,5 +45,6 @@ suspend fun TelegramBot.editMessageMedia(
suspend fun TelegramBot.editMessageMedia( suspend fun TelegramBot.editMessageMedia(
message: ContentMessage<out MediaContent>, message: ContentMessage<out MediaContent>,
media: TelegramMedia, media: TelegramMedia,
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
replyMarkup: InlineKeyboardMarkup? = null replyMarkup: InlineKeyboardMarkup? = null
) = editMessageMedia(message.chat.id, message.messageId, media, replyMarkup) ) = editMessageMedia(message.chat.id, message.messageId, media, businessConnectionId, replyMarkup)

View File

@@ -4,6 +4,8 @@ import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.edit.reply_markup.EditChatMessageReplyMarkup import dev.inmo.tgbotapi.requests.edit.reply_markup.EditChatMessageReplyMarkup
import dev.inmo.tgbotapi.types.ChatIdentifier import dev.inmo.tgbotapi.types.ChatIdentifier
import dev.inmo.tgbotapi.types.MessageId import dev.inmo.tgbotapi.types.MessageId
import dev.inmo.tgbotapi.types.businessConnectionId
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
import dev.inmo.tgbotapi.types.chat.Chat import dev.inmo.tgbotapi.types.chat.Chat
import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage
@@ -15,9 +17,10 @@ import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage
suspend fun TelegramBot.editMessageReplyMarkup( suspend fun TelegramBot.editMessageReplyMarkup(
chatId: ChatIdentifier, chatId: ChatIdentifier,
messageId: MessageId, messageId: MessageId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
replyMarkup: InlineKeyboardMarkup? = null replyMarkup: InlineKeyboardMarkup? = null
) = execute( ) = execute(
EditChatMessageReplyMarkup(chatId, messageId, replyMarkup) EditChatMessageReplyMarkup(chatId, messageId, businessConnectionId, replyMarkup)
) )
/** /**
@@ -27,8 +30,9 @@ suspend fun TelegramBot.editMessageReplyMarkup(
suspend fun TelegramBot.editMessageReplyMarkup( suspend fun TelegramBot.editMessageReplyMarkup(
chat: Chat, chat: Chat,
messageId: MessageId, messageId: MessageId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
replyMarkup: InlineKeyboardMarkup? = null replyMarkup: InlineKeyboardMarkup? = null
) = editMessageReplyMarkup(chat.id, messageId, replyMarkup) ) = editMessageReplyMarkup(chat.id, messageId, businessConnectionId, replyMarkup)
/** /**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
@@ -36,6 +40,7 @@ suspend fun TelegramBot.editMessageReplyMarkup(
*/ */
suspend fun TelegramBot.editMessageReplyMarkup( suspend fun TelegramBot.editMessageReplyMarkup(
message: AccessibleMessage, message: AccessibleMessage,
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
replyMarkup: InlineKeyboardMarkup? = null replyMarkup: InlineKeyboardMarkup? = null
) = editMessageReplyMarkup(message.chat.id, message.messageId, replyMarkup) ) = editMessageReplyMarkup(message.chat.id, message.messageId, businessConnectionId, replyMarkup)

View File

@@ -6,6 +6,8 @@ import dev.inmo.tgbotapi.types.ChatIdentifier
import dev.inmo.tgbotapi.types.LinkPreviewOptions import dev.inmo.tgbotapi.types.LinkPreviewOptions
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
import dev.inmo.tgbotapi.types.MessageId import dev.inmo.tgbotapi.types.MessageId
import dev.inmo.tgbotapi.types.businessConnectionId
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.message.ParseMode import dev.inmo.tgbotapi.types.message.ParseMode
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
import dev.inmo.tgbotapi.types.chat.Chat import dev.inmo.tgbotapi.types.chat.Chat
@@ -24,10 +26,11 @@ suspend fun TelegramBot.editMessageText(
messageId: MessageId, messageId: MessageId,
text: String, text: String,
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
linkPreviewOptions: LinkPreviewOptions? = null, linkPreviewOptions: LinkPreviewOptions? = null,
replyMarkup: InlineKeyboardMarkup? = null replyMarkup: InlineKeyboardMarkup? = null
) = execute( ) = execute(
EditChatMessageText(chatId, messageId, text, parseMode, linkPreviewOptions, replyMarkup) EditChatMessageText(chatId, messageId, text, parseMode, businessConnectionId, linkPreviewOptions, replyMarkup)
) )
/** /**
@@ -39,9 +42,10 @@ suspend fun TelegramBot.editMessageText(
messageId: MessageId, messageId: MessageId,
text: String, text: String,
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
linkPreviewOptions: LinkPreviewOptions? = null, linkPreviewOptions: LinkPreviewOptions? = null,
replyMarkup: InlineKeyboardMarkup? = null replyMarkup: InlineKeyboardMarkup? = null
) = editMessageText(chat.id, messageId, text, parseMode, linkPreviewOptions, replyMarkup) ) = editMessageText(chat.id, messageId, text, parseMode, businessConnectionId, linkPreviewOptions, replyMarkup)
/** /**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
@@ -51,9 +55,10 @@ suspend fun TelegramBot.editMessageText(
message: ContentMessage<TextContent>, message: ContentMessage<TextContent>,
text: String, text: String,
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
linkPreviewOptions: LinkPreviewOptions? = null, linkPreviewOptions: LinkPreviewOptions? = null,
replyMarkup: InlineKeyboardMarkup? = null replyMarkup: InlineKeyboardMarkup? = null
) = editMessageText(message.chat.id, message.messageId, text, parseMode, linkPreviewOptions, replyMarkup) ) = editMessageText(message.chat.id, message.messageId, text, parseMode, businessConnectionId, linkPreviewOptions, replyMarkup)
/** /**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
@@ -63,10 +68,11 @@ suspend fun TelegramBot.editMessageText(
chatId: ChatIdentifier, chatId: ChatIdentifier,
messageId: MessageId, messageId: MessageId,
entities: TextSourcesList, entities: TextSourcesList,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
linkPreviewOptions: LinkPreviewOptions? = null, linkPreviewOptions: LinkPreviewOptions? = null,
replyMarkup: InlineKeyboardMarkup? = null replyMarkup: InlineKeyboardMarkup? = null
) = execute( ) = execute(
EditChatMessageText(chatId, messageId, entities, linkPreviewOptions, replyMarkup) EditChatMessageText(chatId, messageId, entities, businessConnectionId, linkPreviewOptions, replyMarkup)
) )
/** /**
@@ -77,10 +83,11 @@ suspend fun TelegramBot.editMessageText(
chatId: ChatIdentifier, chatId: ChatIdentifier,
messageId: MessageId, messageId: MessageId,
separator: TextSource? = null, separator: TextSource? = null,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
linkPreviewOptions: LinkPreviewOptions? = null, linkPreviewOptions: LinkPreviewOptions? = null,
replyMarkup: InlineKeyboardMarkup? = null, replyMarkup: InlineKeyboardMarkup? = null,
builderBody: EntitiesBuilderBody builderBody: EntitiesBuilderBody
) = editMessageText(chatId, messageId, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup) ) = editMessageText(chatId, messageId, buildEntities(separator, builderBody), businessConnectionId, linkPreviewOptions, replyMarkup)
/** /**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
@@ -90,10 +97,11 @@ suspend fun TelegramBot.editMessageText(
chatId: ChatIdentifier, chatId: ChatIdentifier,
messageId: MessageId, messageId: MessageId,
separator: String, separator: String,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
linkPreviewOptions: LinkPreviewOptions? = null, linkPreviewOptions: LinkPreviewOptions? = null,
replyMarkup: InlineKeyboardMarkup? = null, replyMarkup: InlineKeyboardMarkup? = null,
builderBody: EntitiesBuilderBody builderBody: EntitiesBuilderBody
) = editMessageText(chatId, messageId, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup) ) = editMessageText(chatId, messageId, buildEntities(separator, builderBody), businessConnectionId, linkPreviewOptions, replyMarkup)
/** /**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
@@ -103,9 +111,10 @@ suspend fun TelegramBot.editMessageText(
chat: Chat, chat: Chat,
messageId: MessageId, messageId: MessageId,
entities: TextSourcesList, entities: TextSourcesList,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
linkPreviewOptions: LinkPreviewOptions? = null, linkPreviewOptions: LinkPreviewOptions? = null,
replyMarkup: InlineKeyboardMarkup? = null replyMarkup: InlineKeyboardMarkup? = null
) = editMessageText(chat.id, messageId, entities, linkPreviewOptions, replyMarkup) ) = editMessageText(chat.id, messageId, entities, businessConnectionId, linkPreviewOptions, replyMarkup)
/** /**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
@@ -115,10 +124,11 @@ suspend fun TelegramBot.editMessageText(
chat: Chat, chat: Chat,
messageId: MessageId, messageId: MessageId,
separator: TextSource? = null, separator: TextSource? = null,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
linkPreviewOptions: LinkPreviewOptions? = null, linkPreviewOptions: LinkPreviewOptions? = null,
replyMarkup: InlineKeyboardMarkup? = null, replyMarkup: InlineKeyboardMarkup? = null,
builderBody: EntitiesBuilderBody builderBody: EntitiesBuilderBody
) = editMessageText(chat.id, messageId, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup) ) = editMessageText(chat.id, messageId, buildEntities(separator, builderBody), businessConnectionId, linkPreviewOptions, replyMarkup)
/** /**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
@@ -128,10 +138,11 @@ suspend fun TelegramBot.editMessageText(
chat: Chat, chat: Chat,
messageId: MessageId, messageId: MessageId,
separator: String, separator: String,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
linkPreviewOptions: LinkPreviewOptions? = null, linkPreviewOptions: LinkPreviewOptions? = null,
replyMarkup: InlineKeyboardMarkup? = null, replyMarkup: InlineKeyboardMarkup? = null,
builderBody: EntitiesBuilderBody builderBody: EntitiesBuilderBody
) = editMessageText(chat.id, messageId, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup) ) = editMessageText(chat.id, messageId, buildEntities(separator, builderBody), businessConnectionId, linkPreviewOptions, replyMarkup)
/** /**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
@@ -140,9 +151,10 @@ suspend fun TelegramBot.editMessageText(
suspend fun TelegramBot.editMessageText( suspend fun TelegramBot.editMessageText(
message: ContentMessage<TextContent>, message: ContentMessage<TextContent>,
entities: TextSourcesList, entities: TextSourcesList,
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
linkPreviewOptions: LinkPreviewOptions? = null, linkPreviewOptions: LinkPreviewOptions? = null,
replyMarkup: InlineKeyboardMarkup? = null replyMarkup: InlineKeyboardMarkup? = null
) = editMessageText(message.chat.id, message.messageId, entities, linkPreviewOptions, replyMarkup) ) = editMessageText(message.chat.id, message.messageId, entities, businessConnectionId, linkPreviewOptions, replyMarkup)
/** /**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
@@ -151,10 +163,11 @@ suspend fun TelegramBot.editMessageText(
suspend fun TelegramBot.editMessageText( suspend fun TelegramBot.editMessageText(
message: ContentMessage<TextContent>, message: ContentMessage<TextContent>,
separator: TextSource? = null, separator: TextSource? = null,
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
linkPreviewOptions: LinkPreviewOptions? = null, linkPreviewOptions: LinkPreviewOptions? = null,
replyMarkup: InlineKeyboardMarkup? = null, replyMarkup: InlineKeyboardMarkup? = null,
builderBody: EntitiesBuilderBody builderBody: EntitiesBuilderBody
) = editMessageText(message.chat.id, message.messageId, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup) ) = editMessageText(message.chat.id, message.messageId, buildEntities(separator, builderBody), businessConnectionId, linkPreviewOptions, replyMarkup)
/** /**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
@@ -163,10 +176,11 @@ suspend fun TelegramBot.editMessageText(
suspend fun TelegramBot.editMessageText( suspend fun TelegramBot.editMessageText(
message: ContentMessage<TextContent>, message: ContentMessage<TextContent>,
separator: String, separator: String,
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
linkPreviewOptions: LinkPreviewOptions? = null, linkPreviewOptions: LinkPreviewOptions? = null,
replyMarkup: InlineKeyboardMarkup? = null, replyMarkup: InlineKeyboardMarkup? = null,
builderBody: EntitiesBuilderBody builderBody: EntitiesBuilderBody
) = editMessageText(message.chat.id, message.messageId, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup) ) = editMessageText(message.chat.id, message.messageId, buildEntities(separator, builderBody), businessConnectionId, linkPreviewOptions, replyMarkup)
/** /**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
@@ -176,9 +190,10 @@ suspend fun TelegramBot.editMessageText(
suspend fun TelegramBot.editMessageText( suspend fun TelegramBot.editMessageText(
message: AccessibleMessage, message: AccessibleMessage,
entities: TextSourcesList, entities: TextSourcesList,
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
linkPreviewOptions: LinkPreviewOptions? = null, linkPreviewOptions: LinkPreviewOptions? = null,
replyMarkup: InlineKeyboardMarkup? = null replyMarkup: InlineKeyboardMarkup? = null
) = editMessageText(message.chat.id, message.messageId, entities, linkPreviewOptions, replyMarkup) ) = editMessageText(message.chat.id, message.messageId, entities, businessConnectionId, linkPreviewOptions, replyMarkup)
/** /**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
@@ -188,10 +203,11 @@ suspend fun TelegramBot.editMessageText(
suspend fun TelegramBot.editMessageText( suspend fun TelegramBot.editMessageText(
message: AccessibleMessage, message: AccessibleMessage,
separator: TextSource? = null, separator: TextSource? = null,
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
linkPreviewOptions: LinkPreviewOptions? = null, linkPreviewOptions: LinkPreviewOptions? = null,
replyMarkup: InlineKeyboardMarkup? = null, replyMarkup: InlineKeyboardMarkup? = null,
builderBody: EntitiesBuilderBody builderBody: EntitiesBuilderBody
) = editMessageText(message.chat.id, message.messageId, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup) ) = editMessageText(message.chat.id, message.messageId, buildEntities(separator, builderBody), businessConnectionId, linkPreviewOptions, replyMarkup)
/** /**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
@@ -201,7 +217,8 @@ suspend fun TelegramBot.editMessageText(
suspend fun TelegramBot.editMessageText( suspend fun TelegramBot.editMessageText(
message: AccessibleMessage, message: AccessibleMessage,
separator: String, separator: String,
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
linkPreviewOptions: LinkPreviewOptions? = null, linkPreviewOptions: LinkPreviewOptions? = null,
replyMarkup: InlineKeyboardMarkup? = null, replyMarkup: InlineKeyboardMarkup? = null,
builderBody: EntitiesBuilderBody builderBody: EntitiesBuilderBody
) = editMessageText(message.chat.id, message.messageId, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup) ) = editMessageText(message.chat.id, message.messageId, buildEntities(separator, builderBody), businessConnectionId, linkPreviewOptions, replyMarkup)

View File

@@ -19,9 +19,10 @@ suspend fun TelegramBot.editMessageText(
inlineMessageId: InlineMessageId, inlineMessageId: InlineMessageId,
text: String, text: String,
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
showCaptionAboveMedia: Boolean = false,
linkPreviewOptions: LinkPreviewOptions? = null, linkPreviewOptions: LinkPreviewOptions? = null,
replyMarkup: InlineKeyboardMarkup? = null replyMarkup: InlineKeyboardMarkup? = null
) = execute(EditInlineMessageText(inlineMessageId, text, parseMode, linkPreviewOptions, replyMarkup)) ) = execute(EditInlineMessageText(inlineMessageId, text, parseMode, showCaptionAboveMedia, linkPreviewOptions, replyMarkup))
/** /**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
@@ -30,9 +31,10 @@ suspend fun TelegramBot.editMessageText(
suspend fun TelegramBot.editMessageText( suspend fun TelegramBot.editMessageText(
inlineMessageId: InlineMessageId, inlineMessageId: InlineMessageId,
entities: TextSourcesList, entities: TextSourcesList,
showCaptionAboveMedia: Boolean = false,
linkPreviewOptions: LinkPreviewOptions? = null, linkPreviewOptions: LinkPreviewOptions? = null,
replyMarkup: InlineKeyboardMarkup? = null replyMarkup: InlineKeyboardMarkup? = null
) = execute(EditInlineMessageText(inlineMessageId, entities, linkPreviewOptions, replyMarkup)) ) = execute(EditInlineMessageText(inlineMessageId, entities, showCaptionAboveMedia, linkPreviewOptions, replyMarkup))
/** /**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
@@ -41,10 +43,11 @@ suspend fun TelegramBot.editMessageText(
suspend fun TelegramBot.editMessageText( suspend fun TelegramBot.editMessageText(
inlineMessageId: InlineMessageId, inlineMessageId: InlineMessageId,
separator: TextSource? = null, separator: TextSource? = null,
showCaptionAboveMedia: Boolean = false,
linkPreviewOptions: LinkPreviewOptions? = null, linkPreviewOptions: LinkPreviewOptions? = null,
replyMarkup: InlineKeyboardMarkup? = null, replyMarkup: InlineKeyboardMarkup? = null,
builderBody: EntitiesBuilderBody builderBody: EntitiesBuilderBody
) = editMessageText(inlineMessageId, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup) ) = editMessageText(inlineMessageId, buildEntities(separator, builderBody), showCaptionAboveMedia, linkPreviewOptions, replyMarkup)
/** /**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
@@ -53,7 +56,8 @@ suspend fun TelegramBot.editMessageText(
suspend fun TelegramBot.editMessageText( suspend fun TelegramBot.editMessageText(
inlineMessageId: InlineMessageId, inlineMessageId: InlineMessageId,
separator: String, separator: String,
showCaptionAboveMedia: Boolean = false,
linkPreviewOptions: LinkPreviewOptions? = null, linkPreviewOptions: LinkPreviewOptions? = null,
replyMarkup: InlineKeyboardMarkup? = null, replyMarkup: InlineKeyboardMarkup? = null,
builderBody: EntitiesBuilderBody builderBody: EntitiesBuilderBody
) = editMessageText(inlineMessageId, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup) ) = editMessageText(inlineMessageId, buildEntities(separator, builderBody), showCaptionAboveMedia, linkPreviewOptions, replyMarkup)

View File

@@ -0,0 +1,14 @@
package dev.inmo.tgbotapi.extensions.api.get
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.get.GetStarTransactions
suspend fun TelegramBot.getStarTransactions(
offset: Int? = null,
limit: Int? = null,
) = execute(
GetStarTransactions(
offset = offset,
limit = limit
)
)

View File

@@ -19,6 +19,7 @@ suspend inline fun TelegramBot.copyMessage(
toChatId: ChatIdentifier, toChatId: ChatIdentifier,
text: String? = null, text: String? = null,
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
showCaptionAboveMedia: Boolean = false,
threadId: MessageThreadId? = toChatId.threadId, threadId: MessageThreadId? = toChatId.threadId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
@@ -31,6 +32,7 @@ suspend inline fun TelegramBot.copyMessage(
toChatId, toChatId,
text, text,
parseMode, parseMode,
showCaptionAboveMedia,
threadId, threadId,
disableNotification, disableNotification,
protectContent, protectContent,
@@ -49,12 +51,13 @@ suspend inline fun TelegramBot.copyMessage(
toChatId: ChatIdentifier, toChatId: ChatIdentifier,
text: String? = null, text: String? = null,
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
showCaptionAboveMedia: Boolean = false,
threadId: MessageThreadId? = toChatId.threadId, threadId: MessageThreadId? = toChatId.threadId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = copyMessage(fromChat.id, messageId, toChatId, text, parseMode, threadId, disableNotification, protectContent, replyParameters, replyMarkup) ) = copyMessage(fromChat.id, messageId, toChatId, text, parseMode, showCaptionAboveMedia, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@@ -66,12 +69,13 @@ suspend inline fun TelegramBot.copyMessage(
toChat: Chat, toChat: Chat,
text: String? = null, text: String? = null,
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
showCaptionAboveMedia: Boolean = false,
threadId: MessageThreadId? = toChat.id.threadId, threadId: MessageThreadId? = toChat.id.threadId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = copyMessage(fromChatId, messageId, toChat.id, text, parseMode, threadId, disableNotification, protectContent, replyParameters, replyMarkup) ) = copyMessage(fromChatId, messageId, toChat.id, text, parseMode, showCaptionAboveMedia, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@@ -83,12 +87,13 @@ suspend inline fun TelegramBot.copyMessage(
toChat: Chat, toChat: Chat,
text: String? = null, text: String? = null,
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
showCaptionAboveMedia: Boolean = false,
threadId: MessageThreadId? = toChat.id.threadId, threadId: MessageThreadId? = toChat.id.threadId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = copyMessage(fromChat.id, messageId, toChat.id, text, parseMode, threadId, disableNotification, protectContent, replyParameters, replyMarkup) ) = copyMessage(fromChat.id, messageId, toChat.id, text, parseMode, showCaptionAboveMedia, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
/** /**
@@ -100,6 +105,7 @@ suspend inline fun TelegramBot.copyMessage(
messageId: MessageId, messageId: MessageId,
toChatId: ChatIdentifier, toChatId: ChatIdentifier,
entities: TextSourcesList, entities: TextSourcesList,
showCaptionAboveMedia: Boolean = false,
threadId: MessageThreadId? = toChatId.threadId, threadId: MessageThreadId? = toChatId.threadId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
@@ -111,6 +117,7 @@ suspend inline fun TelegramBot.copyMessage(
messageId, messageId,
toChatId, toChatId,
entities, entities,
showCaptionAboveMedia,
threadId, threadId,
disableNotification, disableNotification,
protectContent, protectContent,
@@ -128,12 +135,13 @@ suspend inline fun TelegramBot.copyMessage(
messageId: MessageId, messageId: MessageId,
toChatId: ChatIdentifier, toChatId: ChatIdentifier,
entities: TextSourcesList, entities: TextSourcesList,
showCaptionAboveMedia: Boolean = false,
threadId: MessageThreadId? = toChatId.threadId, threadId: MessageThreadId? = toChatId.threadId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = copyMessage(fromChat.id, messageId, toChatId, entities, threadId, disableNotification, protectContent, replyParameters, replyMarkup) ) = copyMessage(fromChat.id, messageId, toChatId, entities, showCaptionAboveMedia, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@@ -144,12 +152,13 @@ suspend inline fun TelegramBot.copyMessage(
messageId: MessageId, messageId: MessageId,
toChat: Chat, toChat: Chat,
entities: TextSourcesList, entities: TextSourcesList,
showCaptionAboveMedia: Boolean = false,
threadId: MessageThreadId? = toChat.id.threadId, threadId: MessageThreadId? = toChat.id.threadId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = copyMessage(fromChatId, messageId, toChat.id, entities, threadId, disableNotification, protectContent, replyParameters, replyMarkup) ) = copyMessage(fromChatId, messageId, toChat.id, entities, showCaptionAboveMedia, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@@ -160,12 +169,13 @@ suspend inline fun TelegramBot.copyMessage(
messageId: MessageId, messageId: MessageId,
toChat: Chat, toChat: Chat,
entities: TextSourcesList, entities: TextSourcesList,
showCaptionAboveMedia: Boolean = false,
threadId: MessageThreadId? = toChat.id.threadId, threadId: MessageThreadId? = toChat.id.threadId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = copyMessage(fromChat.id, messageId, toChat.id, entities, threadId, disableNotification, protectContent, replyParameters, replyMarkup) ) = copyMessage(fromChat.id, messageId, toChat.id, entities, showCaptionAboveMedia, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@@ -176,12 +186,13 @@ suspend inline fun TelegramBot.copyMessage(
message: AccessibleMessage, message: AccessibleMessage,
text: String? = null, text: String? = null,
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
showCaptionAboveMedia: Boolean = false,
threadId: MessageThreadId? = toChatId.threadId, threadId: MessageThreadId? = toChatId.threadId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = copyMessage(message.chat, message.messageId, toChatId, text, parseMode, threadId, disableNotification, protectContent, replyParameters, replyMarkup) ) = copyMessage(message.chat, message.messageId, toChatId, text, parseMode, showCaptionAboveMedia, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@@ -192,12 +203,13 @@ suspend inline fun TelegramBot.copyMessage(
message: AccessibleMessage, message: AccessibleMessage,
text: String? = null, text: String? = null,
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
showCaptionAboveMedia: Boolean = false,
threadId: MessageThreadId? = toChat.id.threadId, threadId: MessageThreadId? = toChat.id.threadId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = copyMessage(message.chat, message.messageId, toChat, text, parseMode, threadId, disableNotification, protectContent, replyParameters, replyMarkup) ) = copyMessage(message.chat, message.messageId, toChat, text, parseMode, showCaptionAboveMedia, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@@ -207,12 +219,13 @@ suspend inline fun TelegramBot.copyMessage(
toChatId: ChatIdentifier, toChatId: ChatIdentifier,
message: AccessibleMessage, message: AccessibleMessage,
entities: TextSourcesList, entities: TextSourcesList,
showCaptionAboveMedia: Boolean = false,
threadId: MessageThreadId? = toChatId.threadId, threadId: MessageThreadId? = toChatId.threadId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = copyMessage(message.chat, message.messageId, toChatId, entities, threadId, disableNotification, protectContent, replyParameters, replyMarkup) ) = copyMessage(message.chat, message.messageId, toChatId, entities, showCaptionAboveMedia, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@@ -222,12 +235,13 @@ suspend inline fun TelegramBot.copyMessage(
toChat: Chat, toChat: Chat,
message: AccessibleMessage, message: AccessibleMessage,
entities: TextSourcesList, entities: TextSourcesList,
showCaptionAboveMedia: Boolean = false,
threadId: MessageThreadId? = toChat.id.threadId, threadId: MessageThreadId? = toChat.id.threadId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = copyMessage(message.chat, message.messageId, toChat, entities, threadId, disableNotification, protectContent, replyParameters, replyMarkup) ) = copyMessage(message.chat, message.messageId, toChat, entities, showCaptionAboveMedia, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@@ -239,6 +253,7 @@ suspend inline fun TelegramBot.copyMessage(
messageId: MessageId, messageId: MessageId,
text: String? = null, text: String? = null,
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
showCaptionAboveMedia: Boolean = false,
threadId: MessageThreadId? = toChatId.threadId, threadId: MessageThreadId? = toChatId.threadId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
@@ -251,6 +266,7 @@ suspend inline fun TelegramBot.copyMessage(
toChatId, toChatId,
text, text,
parseMode, parseMode,
showCaptionAboveMedia,
threadId, threadId,
disableNotification, disableNotification,
protectContent, protectContent,
@@ -269,6 +285,7 @@ suspend inline fun TelegramBot.copyMessage(
messageId: MessageId, messageId: MessageId,
text: String? = null, text: String? = null,
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
showCaptionAboveMedia: Boolean = false,
threadId: MessageThreadId? = toChatId.threadId, threadId: MessageThreadId? = toChatId.threadId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
@@ -280,6 +297,7 @@ suspend inline fun TelegramBot.copyMessage(
messageId, messageId,
text, text,
parseMode, parseMode,
showCaptionAboveMedia,
threadId, threadId,
disableNotification, disableNotification,
protectContent, protectContent,
@@ -297,6 +315,7 @@ suspend inline fun TelegramBot.copyMessage(
messageId: MessageId, messageId: MessageId,
text: String? = null, text: String? = null,
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
showCaptionAboveMedia: Boolean = false,
threadId: MessageThreadId? = toChat.id.threadId, threadId: MessageThreadId? = toChat.id.threadId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
@@ -308,6 +327,7 @@ suspend inline fun TelegramBot.copyMessage(
messageId, messageId,
text, text,
parseMode, parseMode,
showCaptionAboveMedia,
threadId, threadId,
disableNotification, disableNotification,
protectContent, protectContent,
@@ -325,6 +345,7 @@ suspend inline fun TelegramBot.copyMessage(
messageId: MessageId, messageId: MessageId,
text: String? = null, text: String? = null,
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
showCaptionAboveMedia: Boolean = false,
threadId: MessageThreadId? = toChat.id.threadId, threadId: MessageThreadId? = toChat.id.threadId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
@@ -336,6 +357,7 @@ suspend inline fun TelegramBot.copyMessage(
messageId, messageId,
text, text,
parseMode, parseMode,
showCaptionAboveMedia,
threadId, threadId,
disableNotification, disableNotification,
protectContent, protectContent,
@@ -353,6 +375,7 @@ suspend inline fun TelegramBot.copyMessage(
fromChatId: ChatIdentifier, fromChatId: ChatIdentifier,
messageId: MessageId, messageId: MessageId,
entities: TextSourcesList, entities: TextSourcesList,
showCaptionAboveMedia: Boolean = false,
threadId: MessageThreadId? = toChatId.threadId, threadId: MessageThreadId? = toChatId.threadId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
@@ -364,6 +387,7 @@ suspend inline fun TelegramBot.copyMessage(
messageId, messageId,
toChatId, toChatId,
entities, entities,
showCaptionAboveMedia,
threadId, threadId,
disableNotification, disableNotification,
protectContent, protectContent,
@@ -381,6 +405,7 @@ suspend inline fun TelegramBot.copyMessage(
fromChat: Chat, fromChat: Chat,
messageId: MessageId, messageId: MessageId,
entities: TextSourcesList, entities: TextSourcesList,
showCaptionAboveMedia: Boolean = false,
threadId: MessageThreadId? = toChatId.threadId, threadId: MessageThreadId? = toChatId.threadId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
@@ -391,6 +416,7 @@ suspend inline fun TelegramBot.copyMessage(
fromChat.id, fromChat.id,
messageId, messageId,
entities, entities,
showCaptionAboveMedia,
threadId, threadId,
disableNotification, disableNotification,
protectContent, protectContent,
@@ -407,6 +433,7 @@ suspend inline fun TelegramBot.copyMessage(
fromChatId: ChatIdentifier, fromChatId: ChatIdentifier,
messageId: MessageId, messageId: MessageId,
entities: TextSourcesList, entities: TextSourcesList,
showCaptionAboveMedia: Boolean = false,
threadId: MessageThreadId? = toChat.id.threadId, threadId: MessageThreadId? = toChat.id.threadId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
@@ -417,6 +444,7 @@ suspend inline fun TelegramBot.copyMessage(
fromChatId, fromChatId,
messageId, messageId,
entities, entities,
showCaptionAboveMedia,
threadId, threadId,
disableNotification, disableNotification,
protectContent, protectContent,
@@ -433,6 +461,7 @@ suspend inline fun TelegramBot.copyMessage(
fromChat: Chat, fromChat: Chat,
messageId: MessageId, messageId: MessageId,
entities: TextSourcesList, entities: TextSourcesList,
showCaptionAboveMedia: Boolean = false,
threadId: MessageThreadId? = toChat.id.threadId, threadId: MessageThreadId? = toChat.id.threadId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
@@ -443,6 +472,7 @@ suspend inline fun TelegramBot.copyMessage(
fromChat.id, fromChat.id,
messageId, messageId,
entities, entities,
showCaptionAboveMedia,
threadId, threadId,
disableNotification, disableNotification,
protectContent, protectContent,

View File

@@ -16,6 +16,7 @@ suspend inline fun <T : MessageContent> TelegramBot.resend(
messageThreadId: MessageThreadId? = chatId.threadId, messageThreadId: MessageThreadId? = chatId.threadId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = execute( ) = execute(
@@ -24,13 +25,14 @@ suspend inline fun <T : MessageContent> TelegramBot.resend(
messageThreadId = messageThreadId, messageThreadId = messageThreadId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
effectId = effectId,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
) as ContentMessage<T> ) as ContentMessage<T>
/** /**
* This method will send [content] to the [chatId] as is * This method will send [content] to the [chat] as is
*/ */
suspend inline fun <T : MessageContent> TelegramBot.resend( suspend inline fun <T : MessageContent> TelegramBot.resend(
chat: Chat, chat: Chat,
@@ -38,6 +40,7 @@ suspend inline fun <T : MessageContent> TelegramBot.resend(
messageThreadId: MessageThreadId? = chat.id.threadId, messageThreadId: MessageThreadId? = chat.id.threadId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = resend( ) = resend(
@@ -46,6 +49,7 @@ suspend inline fun <T : MessageContent> TelegramBot.resend(
messageThreadId = messageThreadId, messageThreadId = messageThreadId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
effectId = effectId,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -61,6 +65,7 @@ suspend inline fun <T : MessageContent> TelegramBot.resend(
messageThreadId: MessageThreadId? = chatId.threadId, messageThreadId: MessageThreadId? = chatId.threadId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = resend( ) = resend(
@@ -69,6 +74,7 @@ suspend inline fun <T : MessageContent> TelegramBot.resend(
messageThreadId = messageThreadId, messageThreadId = messageThreadId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
effectId = effectId,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -84,6 +90,7 @@ suspend inline fun <T : MessageContent> TelegramBot.resend(
messageThreadId: MessageThreadId? = chat.id.threadId, messageThreadId: MessageThreadId? = chat.id.threadId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = resend( ) = resend(
@@ -92,6 +99,7 @@ suspend inline fun <T : MessageContent> TelegramBot.resend(
messageThreadId = messageThreadId, messageThreadId = messageThreadId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
effectId = effectId,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )

View File

@@ -20,11 +20,12 @@ suspend fun TelegramBot.sendContact(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = execute( ) = execute(
SendContact( SendContact(
chatId, phoneNumber, firstName, lastName, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup chatId, phoneNumber, firstName, lastName, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup
) )
) )
@@ -39,11 +40,12 @@ suspend fun TelegramBot.sendContact(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = execute( ) = execute(
SendContact( SendContact(
chatId, contact, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup chatId, contact, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup
) )
) )
@@ -60,10 +62,11 @@ suspend fun TelegramBot.sendContact(
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendContact( ) = sendContact(
chat.id, phoneNumber, firstName, lastName, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup chat.id, phoneNumber, firstName, lastName, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup
) )
/** /**
@@ -77,8 +80,9 @@ suspend fun TelegramBot.sendContact(
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendContact( ) = sendContact(
chat.id, contact, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup chat.id, contact, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup
) )

View File

@@ -19,10 +19,11 @@ suspend fun TelegramBot.sendDice(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = execute( ) = execute(
SendDice(chatId, animationType, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup) SendDice(chatId, animationType, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
) )
/** /**
@@ -36,6 +37,7 @@ suspend fun TelegramBot.sendDice(
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendDice(chat.id, animationType, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendDice(chat.id, animationType, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)

View File

@@ -24,6 +24,7 @@ suspend fun TelegramBot.sendLocation(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = execute( ) = execute(
@@ -39,6 +40,7 @@ suspend fun TelegramBot.sendLocation(
businessConnectionId, businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
effectId,
replyParameters, replyParameters,
replyMarkup replyMarkup
) )
@@ -59,6 +61,7 @@ suspend fun TelegramBot.sendLocation(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendLocation( ) = sendLocation(
@@ -73,6 +76,7 @@ suspend fun TelegramBot.sendLocation(
businessConnectionId, businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
effectId,
replyParameters, replyParameters,
replyMarkup replyMarkup
) )
@@ -93,6 +97,7 @@ suspend fun TelegramBot.sendLocation(
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendLocation( ) = sendLocation(
@@ -107,6 +112,7 @@ suspend fun TelegramBot.sendLocation(
businessConnectionId, businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
effectId,
replyParameters, replyParameters,
replyMarkup replyMarkup
) )
@@ -126,22 +132,24 @@ suspend fun TelegramBot.sendLocation(
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendLocation( ) = sendLocation(
chat.id, chatId = chat.id,
location.latitude, latitude = location.latitude,
location.longitude, longitude = location.longitude,
livePeriod, livePeriod = livePeriod,
horizontalAccuracy, horizontalAccuracy = horizontalAccuracy,
heading, heading = heading,
proximityAlertRadius, proximityAlertRadius = proximityAlertRadius,
threadId, threadId = threadId,
businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification, disableNotification = disableNotification,
protectContent, protectContent = protectContent,
replyParameters, effectId = effectId,
replyMarkup replyParameters = replyParameters,
replyMarkup = replyMarkup
) )
/** /**
@@ -160,9 +168,10 @@ suspend fun TelegramBot.sendLiveLocation(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendLocation(chatId, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendLocation(chatId, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@@ -179,9 +188,10 @@ suspend fun TelegramBot.sendLiveLocation(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendLocation(chatId, location.latitude, location.longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendLocation(chatId, location.latitude, location.longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@@ -199,9 +209,10 @@ suspend fun TelegramBot.sendLiveLocation(
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendLocation(chat.id, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendLocation(chat.id, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@@ -218,6 +229,7 @@ suspend fun TelegramBot.sendLiveLocation(
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendLocation(chat.id, location.latitude, location.longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendLocation(chat.id, location.latitude, location.longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)

View File

@@ -25,6 +25,7 @@ suspend fun TelegramBot.sendMessage(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = execute( ) = execute(
@@ -37,6 +38,7 @@ suspend fun TelegramBot.sendMessage(
businessConnectionId, businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
effectId,
replyParameters, replyParameters,
replyMarkup replyMarkup
) )
@@ -55,10 +57,11 @@ suspend fun TelegramBot.sendTextMessage(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendMessage( ) = sendMessage(
chatId, text, parseMode, linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup chatId, text, parseMode, linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup
) )
/** /**
@@ -74,9 +77,10 @@ suspend fun TelegramBot.sendTextMessage(
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendTextMessage(chat.id, text, parseMode, linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendTextMessage(chat.id, text, parseMode, linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
/** /**
@@ -92,9 +96,10 @@ suspend fun TelegramBot.sendMessage(
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendMessage(chat.id, text, parseMode, linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendMessage(chat.id, text, parseMode, linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@@ -108,14 +113,15 @@ suspend fun TelegramBot.sendMessage(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = execute( ) = execute(
SendTextMessage(chatId, entities, linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup) SendTextMessage(chatId, entities, linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
) )
/** /**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * @param replyMarkup Some [dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that * as a builder for that
*/ */
suspend fun TelegramBot.sendMessage( suspend fun TelegramBot.sendMessage(
@@ -126,14 +132,15 @@ suspend fun TelegramBot.sendMessage(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null, replyMarkup: KeyboardMarkup? = null,
builderBody: EntitiesBuilderBody builderBody: EntitiesBuilderBody
) = sendMessage(chatId, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendMessage(chatId, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
/** /**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * @param replyMarkup Some [dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that * as a builder for that
*/ */
suspend fun TelegramBot.sendMessage( suspend fun TelegramBot.sendMessage(
@@ -144,10 +151,11 @@ suspend fun TelegramBot.sendMessage(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null, replyMarkup: KeyboardMarkup? = null,
builderBody: EntitiesBuilderBody builderBody: EntitiesBuilderBody
) = sendMessage(chatId, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendMessage(chatId, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@@ -161,14 +169,15 @@ suspend fun TelegramBot.sendTextMessage(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendMessage( ) = sendMessage(
chatId, entities, linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup chatId, entities, linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup
) )
/** /**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * @param replyMarkup Some [dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that * as a builder for that
*/ */
suspend fun TelegramBot.sendTextMessage( suspend fun TelegramBot.sendTextMessage(
@@ -179,14 +188,15 @@ suspend fun TelegramBot.sendTextMessage(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null, replyMarkup: KeyboardMarkup? = null,
builderBody: EntitiesBuilderBody builderBody: EntitiesBuilderBody
) = sendTextMessage(chatId, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendTextMessage(chatId, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
/** /**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * @param replyMarkup Some [dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that * as a builder for that
*/ */
suspend fun TelegramBot.sendTextMessage( suspend fun TelegramBot.sendTextMessage(
@@ -197,10 +207,11 @@ suspend fun TelegramBot.sendTextMessage(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null, replyMarkup: KeyboardMarkup? = null,
builderBody: EntitiesBuilderBody builderBody: EntitiesBuilderBody
) = sendTextMessage(chatId, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendTextMessage(chatId, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@@ -214,12 +225,13 @@ suspend fun TelegramBot.sendMessage(
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendMessage(chat.id, entities, linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendMessage(chat.id, entities, linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
/** /**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * @param replyMarkup Some [dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that * as a builder for that
*/ */
suspend fun TelegramBot.sendMessage( suspend fun TelegramBot.sendMessage(
@@ -230,14 +242,15 @@ suspend fun TelegramBot.sendMessage(
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null, replyMarkup: KeyboardMarkup? = null,
builderBody: EntitiesBuilderBody builderBody: EntitiesBuilderBody
) = sendMessage(chat, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendMessage(chat, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
/** /**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * @param replyMarkup Some [dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that * as a builder for that
*/ */
suspend fun TelegramBot.sendMessage( suspend fun TelegramBot.sendMessage(
@@ -248,10 +261,11 @@ suspend fun TelegramBot.sendMessage(
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null, replyMarkup: KeyboardMarkup? = null,
builderBody: EntitiesBuilderBody builderBody: EntitiesBuilderBody
) = sendMessage(chat, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendMessage(chat, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
/** /**
@@ -266,12 +280,13 @@ suspend fun TelegramBot.sendTextMessage(
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendTextMessage(chat.id, entities, linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendTextMessage(chat.id, entities, linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
/** /**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * @param replyMarkup Some [dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that * as a builder for that
*/ */
suspend fun TelegramBot.sendTextMessage( suspend fun TelegramBot.sendTextMessage(
@@ -282,14 +297,15 @@ suspend fun TelegramBot.sendTextMessage(
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null, replyMarkup: KeyboardMarkup? = null,
builderBody: EntitiesBuilderBody builderBody: EntitiesBuilderBody
) = sendTextMessage(chat, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendTextMessage(chat, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
/** /**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * @param replyMarkup Some [dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that * as a builder for that
*/ */
suspend fun TelegramBot.sendTextMessage( suspend fun TelegramBot.sendTextMessage(
@@ -300,7 +316,8 @@ suspend fun TelegramBot.sendTextMessage(
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null, replyMarkup: KeyboardMarkup? = null,
builderBody: EntitiesBuilderBody builderBody: EntitiesBuilderBody
) = sendTextMessage(chat, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendTextMessage(chat, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)

View File

@@ -20,6 +20,7 @@ suspend fun TelegramBot.sendLocation(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = execute( ) = execute(
@@ -31,6 +32,7 @@ suspend fun TelegramBot.sendLocation(
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
effectId = effectId,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -47,6 +49,7 @@ suspend fun TelegramBot.sendLocation(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendLocation( ) = sendLocation(
@@ -57,6 +60,7 @@ suspend fun TelegramBot.sendLocation(
businessConnectionId, businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
effectId,
replyParameters, replyParameters,
replyMarkup replyMarkup
) )
@@ -73,6 +77,7 @@ suspend fun TelegramBot.sendLocation(
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendLocation( ) = sendLocation(
@@ -83,6 +88,7 @@ suspend fun TelegramBot.sendLocation(
businessConnectionId, businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
effectId,
replyParameters, replyParameters,
replyMarkup replyMarkup
) )
@@ -98,6 +104,7 @@ suspend fun TelegramBot.sendLocation(
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendLocation( ) = sendLocation(
@@ -108,6 +115,7 @@ suspend fun TelegramBot.sendLocation(
businessConnectionId, businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
effectId,
replyParameters, replyParameters,
replyMarkup replyMarkup
) )
@@ -124,9 +132,10 @@ suspend fun TelegramBot.sendStaticLocation(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendLocation(chatId, latitude, longitude, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendLocation(chatId, latitude, longitude, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@@ -139,9 +148,10 @@ suspend fun TelegramBot.sendStaticLocation(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendLocation(chatId, location.latitude, location.longitude, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendLocation(chatId, location.latitude, location.longitude, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@@ -155,9 +165,10 @@ suspend fun TelegramBot.sendStaticLocation(
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendLocation(chat.id, latitude, longitude, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendLocation(chat.id, latitude, longitude, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@@ -170,6 +181,7 @@ suspend fun TelegramBot.sendStaticLocation(
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendLocation(chat.id, location.latitude, location.longitude, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendLocation(chat.id, location.latitude, location.longitude, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)

View File

@@ -27,6 +27,7 @@ suspend fun TelegramBot.sendVenue(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = execute( ) = execute(
@@ -44,6 +45,7 @@ suspend fun TelegramBot.sendVenue(
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
effectId = effectId,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -67,6 +69,7 @@ suspend fun TelegramBot.sendVenue(
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendVenue( ) = sendVenue(
@@ -83,6 +86,7 @@ suspend fun TelegramBot.sendVenue(
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
effectId = effectId,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -104,6 +108,7 @@ suspend fun TelegramBot.sendVenue(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendVenue( ) = sendVenue(
@@ -120,6 +125,7 @@ suspend fun TelegramBot.sendVenue(
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
effectId = effectId,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -141,6 +147,7 @@ suspend fun TelegramBot.sendVenue(
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendVenue( ) = sendVenue(
@@ -157,6 +164,7 @@ suspend fun TelegramBot.sendVenue(
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
effectId = effectId,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -172,6 +180,7 @@ suspend fun TelegramBot.sendVenue(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = execute( ) = execute(
@@ -182,6 +191,7 @@ suspend fun TelegramBot.sendVenue(
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
effectId = effectId,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -198,6 +208,7 @@ suspend fun TelegramBot.sendVenue(
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendVenue( ) = sendVenue(
@@ -207,6 +218,7 @@ suspend fun TelegramBot.sendVenue(
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
effectId = effectId,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )

View File

@@ -8,7 +8,6 @@ import dev.inmo.tgbotapi.types.chat.Chat
import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage
import dev.inmo.tgbotapi.types.message.abstracts.Message import dev.inmo.tgbotapi.types.message.abstracts.Message
import dev.inmo.tgbotapi.types.reactions.Reaction import dev.inmo.tgbotapi.types.reactions.Reaction
import kotlin.js.JsName
import kotlin.jvm.JvmName import kotlin.jvm.JvmName
suspend fun TelegramBot.setMessageReactions( suspend fun TelegramBot.setMessageReactions(

View File

@@ -19,11 +19,12 @@ suspend fun TelegramBot.sendGame(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = execute( ) = execute(
SendGame( SendGame(
chatId, gameShortName, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup chatId, gameShortName, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup
) )
) )
@@ -38,10 +39,11 @@ suspend fun TelegramBot.sendGame(
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendGame( ) = sendGame(
chat.id, gameShortName, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup chat.id, gameShortName, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup
) )
/** /**
@@ -55,10 +57,11 @@ suspend fun TelegramBot.sendGame(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendGame( ) = sendGame(
chatId, game.title, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup chatId, game.title, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup
) )
/** /**
@@ -72,8 +75,9 @@ suspend fun TelegramBot.sendGame(
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendGame( ) = sendGame(
chat.id, game.title, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup chat.id, game.title, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup
) )

View File

@@ -21,6 +21,7 @@ suspend fun TelegramBot.sendAnimation(
thumb: InputFile? = null, thumb: InputFile? = null,
text: String? = null, text: String? = null,
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
showCaptionAboveMedia: Boolean = false,
spoilered: Boolean = false, spoilered: Boolean = false,
duration: Long? = null, duration: Long? = null,
width: Int? = null, width: Int? = null,
@@ -29,25 +30,28 @@ suspend fun TelegramBot.sendAnimation(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = execute( ) = execute(
SendAnimation( SendAnimation(
chatId, chatId = chatId,
animation, animation = animation,
thumb, thumbnail = thumb,
text, text = text,
parseMode, parseMode = parseMode,
spoilered, showCaptionAboveMedia = showCaptionAboveMedia,
duration, spoilered = spoilered,
width, duration = duration,
height, width = width,
threadId, height = height,
businessConnectionId, threadId = threadId,
disableNotification, businessConnectionId = businessConnectionId,
protectContent, disableNotification = disableNotification,
replyParameters, protectContent = protectContent,
replyMarkup effectId = effectId,
replyParameters = replyParameters,
replyMarkup = replyMarkup
) )
) )
@@ -60,6 +64,7 @@ suspend fun TelegramBot.sendAnimation(
animation: AnimationFile, animation: AnimationFile,
text: String? = null, text: String? = null,
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
showCaptionAboveMedia: Boolean = false,
spoilered: Boolean = false, spoilered: Boolean = false,
duration: Long? = null, duration: Long? = null,
width: Int? = null, width: Int? = null,
@@ -68,10 +73,27 @@ suspend fun TelegramBot.sendAnimation(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendAnimation( ) = sendAnimation(
chatId, animation.fileId, animation.thumbnail ?.fileId, text, parseMode, spoilered, duration, width, height, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup chatId = chatId,
animation = animation.fileId,
thumb = animation.thumbnail ?.fileId,
text = text,
parseMode = parseMode,
showCaptionAboveMedia = showCaptionAboveMedia,
spoilered = spoilered,
duration = duration,
width = width,
height = height,
threadId = threadId,
businessConnectionId = businessConnectionId,
disableNotification = disableNotification,
protectContent = protectContent,
effectId = effectId,
replyParameters = replyParameters,
replyMarkup = replyMarkup
) )
/** /**
@@ -84,6 +106,7 @@ suspend fun TelegramBot.sendAnimation(
thumb: InputFile? = null, thumb: InputFile? = null,
text: String? = null, text: String? = null,
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
showCaptionAboveMedia: Boolean = false,
spoilered: Boolean = false, spoilered: Boolean = false,
duration: Long? = null, duration: Long? = null,
width: Int? = null, width: Int? = null,
@@ -92,9 +115,28 @@ suspend fun TelegramBot.sendAnimation(
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendAnimation(chat.id, animation, thumb, text, parseMode, spoilered, duration, width, height, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendAnimation(
chatId = chat.id,
animation = animation,
thumb = thumb,
text = text,
parseMode = parseMode,
showCaptionAboveMedia = showCaptionAboveMedia,
spoilered = spoilered,
duration = duration,
width = width,
height = height,
threadId = threadId,
businessConnectionId = businessConnectionId,
disableNotification = disableNotification,
protectContent = protectContent,
effectId = effectId,
replyParameters = replyParameters,
replyMarkup = replyMarkup
)
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@@ -105,6 +147,7 @@ suspend fun TelegramBot.sendAnimation(
animation: AnimationFile, animation: AnimationFile,
text: String? = null, text: String? = null,
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
showCaptionAboveMedia: Boolean = false,
spoilered: Boolean = false, spoilered: Boolean = false,
duration: Long? = null, duration: Long? = null,
width: Int? = null, width: Int? = null,
@@ -113,9 +156,27 @@ suspend fun TelegramBot.sendAnimation(
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendAnimation(chat.id, animation, text, parseMode, spoilered, duration, width, height, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendAnimation(
chatId = chat.id,
animation = animation,
text = text,
parseMode = parseMode,
showCaptionAboveMedia = showCaptionAboveMedia,
spoilered = spoilered,
duration = duration,
width = width,
height = height,
threadId = threadId,
businessConnectionId = businessConnectionId,
disableNotification = disableNotification,
protectContent = protectContent,
effectId = effectId,
replyParameters = replyParameters,
replyMarkup = replyMarkup
)
/** /**
@@ -127,6 +188,7 @@ suspend fun TelegramBot.sendAnimation(
animation: InputFile, animation: InputFile,
thumb: InputFile? = null, thumb: InputFile? = null,
entities: TextSourcesList, entities: TextSourcesList,
showCaptionAboveMedia: Boolean = false,
spoilered: Boolean = false, spoilered: Boolean = false,
duration: Long? = null, duration: Long? = null,
width: Int? = null, width: Int? = null,
@@ -135,24 +197,27 @@ suspend fun TelegramBot.sendAnimation(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = execute( ) = execute(
SendAnimation( SendAnimation(
chatId, chatId = chatId,
animation, animation = animation,
thumb, thumbnail = thumb,
entities, entities = entities,
spoilered, showCaptionAboveMedia = showCaptionAboveMedia,
duration, spoilered = spoilered,
width, duration = duration,
height, width = width,
threadId, height = height,
businessConnectionId, threadId = threadId,
disableNotification, businessConnectionId = businessConnectionId,
protectContent, disableNotification = disableNotification,
replyParameters, protectContent = protectContent,
replyMarkup effectId = effectId,
replyParameters = replyParameters,
replyMarkup = replyMarkup
) )
) )
@@ -164,6 +229,7 @@ suspend fun TelegramBot.sendAnimation(
chatId: ChatIdentifier, chatId: ChatIdentifier,
animation: AnimationFile, animation: AnimationFile,
entities: TextSourcesList, entities: TextSourcesList,
showCaptionAboveMedia: Boolean = false,
spoilered: Boolean = false, spoilered: Boolean = false,
duration: Long? = null, duration: Long? = null,
width: Int? = null, width: Int? = null,
@@ -172,10 +238,26 @@ suspend fun TelegramBot.sendAnimation(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendAnimation( ) = sendAnimation(
chatId, animation.fileId, animation.thumbnail ?.fileId, entities, spoilered, duration, width, height, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup chatId = chatId,
animation = animation.fileId,
thumb = animation.thumbnail ?.fileId,
entities = entities,
showCaptionAboveMedia = showCaptionAboveMedia,
spoilered = spoilered,
duration = duration,
width = width,
height = height,
threadId = threadId,
businessConnectionId = businessConnectionId,
disableNotification = disableNotification,
protectContent = protectContent,
effectId = effectId,
replyParameters = replyParameters,
replyMarkup = replyMarkup
) )
/** /**
@@ -187,6 +269,7 @@ suspend fun TelegramBot.sendAnimation(
animation: InputFile, animation: InputFile,
thumb: InputFile? = null, thumb: InputFile? = null,
entities: TextSourcesList, entities: TextSourcesList,
showCaptionAboveMedia: Boolean = false,
spoilered: Boolean = false, spoilered: Boolean = false,
duration: Long? = null, duration: Long? = null,
width: Int? = null, width: Int? = null,
@@ -195,9 +278,27 @@ suspend fun TelegramBot.sendAnimation(
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendAnimation(chat.id, animation, thumb, entities, spoilered, duration, width, height, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendAnimation(
chatId = chat.id,
animation = animation,
thumb = thumb,
entities = entities,
showCaptionAboveMedia = showCaptionAboveMedia,
spoilered = spoilered,
duration = duration,
width = width,
height = height,
threadId = threadId,
businessConnectionId = businessConnectionId,
disableNotification = disableNotification,
protectContent = protectContent,
effectId = effectId,
replyParameters = replyParameters,
replyMarkup = replyMarkup
)
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@@ -207,6 +308,7 @@ suspend fun TelegramBot.sendAnimation(
chat: Chat, chat: Chat,
animation: AnimationFile, animation: AnimationFile,
entities: TextSourcesList, entities: TextSourcesList,
showCaptionAboveMedia: Boolean = false,
spoilered: Boolean = false, spoilered: Boolean = false,
duration: Long? = null, duration: Long? = null,
width: Int? = null, width: Int? = null,
@@ -215,6 +317,23 @@ suspend fun TelegramBot.sendAnimation(
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendAnimation(chat.id, animation, entities, spoilered, duration, width, height, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendAnimation(
chatId = chat.id,
animation = animation,
entities = entities,
showCaptionAboveMedia = showCaptionAboveMedia,
spoilered = spoilered,
duration = duration,
width = width,
height = height,
threadId = threadId,
businessConnectionId = businessConnectionId,
disableNotification = disableNotification,
protectContent = protectContent,
effectId = effectId,
replyParameters = replyParameters,
replyMarkup = replyMarkup
)

View File

@@ -28,6 +28,7 @@ suspend fun TelegramBot.sendAudio(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = execute( ) = execute(
@@ -44,6 +45,7 @@ suspend fun TelegramBot.sendAudio(
businessConnectionId, businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
effectId,
replyParameters, replyParameters,
replyMarkup replyMarkup
) )
@@ -66,9 +68,10 @@ suspend fun TelegramBot.sendAudio(
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendAudio(chat.id, audio, thumb, text, parseMode, duration, performer, title, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendAudio(chat.id, audio, thumb, text, parseMode, duration, performer, title, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@@ -84,9 +87,10 @@ suspend fun TelegramBot.sendAudio(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendAudio(chatId, audio.fileId, audio.thumbnail ?.fileId, text, parseMode, audio.duration, audio.performer, title, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendAudio(chatId, audio.fileId, audio.thumbnail ?.fileId, text, parseMode, audio.duration, audio.performer, title, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@@ -102,9 +106,10 @@ suspend fun TelegramBot.sendAudio(
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendAudio(chat.id, audio, text, parseMode, title, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendAudio(chat.id, audio, text, parseMode, title, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
/** /**
@@ -123,6 +128,7 @@ suspend inline fun TelegramBot.sendAudio(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = execute( ) = execute(
@@ -138,6 +144,7 @@ suspend inline fun TelegramBot.sendAudio(
businessConnectionId, businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
effectId,
replyParameters, replyParameters,
replyMarkup replyMarkup
) )
@@ -159,9 +166,10 @@ suspend inline fun TelegramBot.sendAudio(
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendAudio(chat.id, audio, thumb, entities, duration, performer, title, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendAudio(chat.id, audio, thumb, entities, duration, performer, title, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@@ -176,9 +184,10 @@ suspend inline fun TelegramBot.sendAudio(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendAudio(chatId, audio.fileId, audio.thumbnail ?.fileId, entities, audio.duration, audio.performer, title, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendAudio(chatId, audio.fileId, audio.thumbnail ?.fileId, entities, audio.duration, audio.performer, title, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@@ -193,6 +202,7 @@ suspend inline fun TelegramBot.sendAudio(
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendAudio(chat.id, audio, entities, title, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendAudio(chat.id, audio, entities, title, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)

View File

@@ -25,6 +25,7 @@ suspend fun TelegramBot.sendDocument(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null, replyMarkup: KeyboardMarkup? = null,
disableContentTypeDetection: Boolean? = null disableContentTypeDetection: Boolean? = null
@@ -39,6 +40,7 @@ suspend fun TelegramBot.sendDocument(
businessConnectionId, businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
effectId,
replyParameters, replyParameters,
replyMarkup, replyMarkup,
disableContentTypeDetection disableContentTypeDetection
@@ -59,10 +61,11 @@ suspend fun TelegramBot.sendDocument(
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null, replyMarkup: KeyboardMarkup? = null,
disableContentTypeDetection: Boolean? = null disableContentTypeDetection: Boolean? = null
) = sendDocument(chat.id, document, thumb, text, parseMode, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup, disableContentTypeDetection) ) = sendDocument(chat.id, document, thumb, text, parseMode, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup, disableContentTypeDetection)
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@@ -77,11 +80,12 @@ suspend fun TelegramBot.sendDocument(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null, replyMarkup: KeyboardMarkup? = null,
disableContentTypeDetection: Boolean? = null disableContentTypeDetection: Boolean? = null
) = sendDocument( ) = sendDocument(
chatId, document.fileId, document.thumbnail ?.fileId, text, parseMode, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup, disableContentTypeDetection chatId, document.fileId, document.thumbnail ?.fileId, text, parseMode, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup, disableContentTypeDetection
) )
/** /**
@@ -97,10 +101,11 @@ suspend fun TelegramBot.sendDocument(
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null, replyMarkup: KeyboardMarkup? = null,
disableContentTypeDetection: Boolean? = null disableContentTypeDetection: Boolean? = null
) = sendDocument(chat.id, document, text, parseMode, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup, disableContentTypeDetection) ) = sendDocument(chat.id, document, text, parseMode, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup, disableContentTypeDetection)
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@@ -115,6 +120,7 @@ suspend inline fun TelegramBot.sendDocument(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null, replyMarkup: KeyboardMarkup? = null,
disableContentTypeDetection: Boolean? = null disableContentTypeDetection: Boolean? = null
@@ -128,6 +134,7 @@ suspend inline fun TelegramBot.sendDocument(
businessConnectionId, businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
effectId,
replyParameters, replyParameters,
replyMarkup, replyMarkup,
disableContentTypeDetection disableContentTypeDetection
@@ -147,10 +154,11 @@ suspend inline fun TelegramBot.sendDocument(
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null, replyMarkup: KeyboardMarkup? = null,
disableContentTypeDetection: Boolean? = null disableContentTypeDetection: Boolean? = null
) = sendDocument(chat.id, document, thumb, entities, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup, disableContentTypeDetection) ) = sendDocument(chat.id, document, thumb, entities, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup, disableContentTypeDetection)
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@@ -164,11 +172,12 @@ suspend inline fun TelegramBot.sendDocument(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null, replyMarkup: KeyboardMarkup? = null,
disableContentTypeDetection: Boolean? = null disableContentTypeDetection: Boolean? = null
) = sendDocument( ) = sendDocument(
chatId, document.fileId, document.thumbnail ?.fileId, entities, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup, disableContentTypeDetection chatId, document.fileId, document.thumbnail ?.fileId, entities, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup, disableContentTypeDetection
) )
/** /**
@@ -183,7 +192,8 @@ suspend inline fun TelegramBot.sendDocument(
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null, replyMarkup: KeyboardMarkup? = null,
disableContentTypeDetection: Boolean? = null disableContentTypeDetection: Boolean? = null
) = sendDocument(chat.id, document, entities, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup, disableContentTypeDetection) ) = sendDocument(chat.id, document, entities, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup, disableContentTypeDetection)

View File

@@ -24,10 +24,11 @@ suspend fun TelegramBot.sendMediaGroup(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null replyParameters: ReplyParameters? = null
) = execute( ) = execute(
SendMediaGroup<MediaGroupPartContent>( SendMediaGroup<MediaGroupPartContent>(
chatId, media, threadId, businessConnectionId, disableNotification, protectContent, replyParameters chatId, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
) )
) )
@@ -42,9 +43,10 @@ suspend fun TelegramBot.sendMediaGroup(
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null replyParameters: ReplyParameters? = null
) = sendMediaGroup( ) = sendMediaGroup(
chat.id, media, threadId, businessConnectionId, disableNotification, protectContent, replyParameters chat.id, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
) )
/** /**
@@ -59,9 +61,10 @@ suspend fun TelegramBot.sendMediaGroup(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null replyParameters: ReplyParameters? = null
) = sendMediaGroup( ) = sendMediaGroup(
chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, threadId, businessConnectionId, disableNotification, protectContent, replyParameters chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
) )
/** /**
@@ -76,9 +79,10 @@ suspend fun TelegramBot.sendMediaGroup(
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null replyParameters: ReplyParameters? = null
) = sendMediaGroup( ) = sendMediaGroup(
chat.id, media, threadId, businessConnectionId, disableNotification, protectContent, replyParameters chat.id, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
) )
/** /**
@@ -91,10 +95,11 @@ suspend fun TelegramBot.sendPlaylist(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null replyParameters: ReplyParameters? = null
) = execute( ) = execute(
SendPlaylist( SendPlaylist(
chatId, media, threadId, businessConnectionId, disableNotification, protectContent, replyParameters chatId, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
) )
) )
@@ -108,9 +113,10 @@ suspend fun TelegramBot.sendPlaylist(
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null replyParameters: ReplyParameters? = null
) = sendPlaylist( ) = sendPlaylist(
chat.id, media, threadId, businessConnectionId, disableNotification, protectContent, replyParameters chat.id, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
) )
/** /**
@@ -124,9 +130,10 @@ suspend fun TelegramBot.sendPlaylist(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null replyParameters: ReplyParameters? = null
) = sendPlaylist( ) = sendPlaylist(
chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, threadId, businessConnectionId, disableNotification, protectContent, replyParameters chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
) )
/** /**
@@ -140,9 +147,10 @@ suspend fun TelegramBot.sendPlaylist(
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null replyParameters: ReplyParameters? = null
) = sendPlaylist( ) = sendPlaylist(
chat.id, media, threadId, businessConnectionId, disableNotification, protectContent, replyParameters chat.id, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
) )
/** /**
@@ -155,10 +163,11 @@ suspend fun TelegramBot.sendDocumentsGroup(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null replyParameters: ReplyParameters? = null
) = execute( ) = execute(
SendDocumentsGroup( SendDocumentsGroup(
chatId, media, threadId, businessConnectionId, disableNotification, protectContent, replyParameters chatId, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
) )
) )
@@ -172,9 +181,10 @@ suspend fun TelegramBot.sendDocumentsGroup(
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null replyParameters: ReplyParameters? = null
) = sendDocumentsGroup( ) = sendDocumentsGroup(
chat.id, media, threadId, businessConnectionId, disableNotification, protectContent, replyParameters chat.id, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
) )
/** /**
@@ -188,9 +198,10 @@ suspend fun TelegramBot.sendDocumentsGroup(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null replyParameters: ReplyParameters? = null
) = sendDocumentsGroup( ) = sendDocumentsGroup(
chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, threadId, businessConnectionId, disableNotification, protectContent, replyParameters chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
) )
/** /**
@@ -204,9 +215,10 @@ suspend fun TelegramBot.sendDocumentsGroup(
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null replyParameters: ReplyParameters? = null
) = sendDocumentsGroup( ) = sendDocumentsGroup(
chat.id, media, threadId, businessConnectionId, disableNotification, protectContent, replyParameters chat.id, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
) )
/** /**
@@ -219,10 +231,11 @@ suspend fun TelegramBot.sendVisualMediaGroup(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null replyParameters: ReplyParameters? = null
) = execute( ) = execute(
SendVisualMediaGroup( SendVisualMediaGroup(
chatId, media, threadId, businessConnectionId, disableNotification, protectContent, replyParameters chatId, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
) )
) )
@@ -236,9 +249,10 @@ suspend fun TelegramBot.sendVisualMediaGroup(
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null replyParameters: ReplyParameters? = null
) = sendVisualMediaGroup( ) = sendVisualMediaGroup(
chat.id, media, threadId, businessConnectionId, disableNotification, protectContent, replyParameters chat.id, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
) )
/** /**
@@ -252,9 +266,10 @@ suspend fun TelegramBot.sendVisualMediaGroup(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null replyParameters: ReplyParameters? = null
) = sendVisualMediaGroup( ) = sendVisualMediaGroup(
chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, threadId, businessConnectionId, disableNotification, protectContent, replyParameters chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
) )
/** /**
@@ -268,7 +283,8 @@ suspend fun TelegramBot.sendVisualMediaGroup(
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null replyParameters: ReplyParameters? = null
) = sendVisualMediaGroup( ) = sendVisualMediaGroup(
chat.id, media, threadId, businessConnectionId, disableNotification, protectContent, replyParameters chat.id, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
) )

View File

@@ -20,26 +20,30 @@ suspend fun TelegramBot.sendPhoto(
fileId: InputFile, fileId: InputFile,
text: String? = null, text: String? = null,
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
showCaptionAboveMedia: Boolean = false,
spoilered: Boolean = false, spoilered: Boolean = false,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = execute( ) = execute(
SendPhoto( SendPhoto(
chatId, chatId = chatId,
fileId, photo = fileId,
text, text = text,
parseMode, parseMode = parseMode,
spoilered, showCaptionAboveMedia = showCaptionAboveMedia,
threadId, spoilered = spoilered,
businessConnectionId, threadId = threadId,
disableNotification, businessConnectionId = businessConnectionId,
protectContent, disableNotification = disableNotification,
replyParameters, protectContent = protectContent,
replyMarkup effectId = effectId,
replyParameters = replyParameters,
replyMarkup = replyMarkup
) )
) )
@@ -52,14 +56,30 @@ suspend fun TelegramBot.sendPhoto(
fileId: InputFile, fileId: InputFile,
text: String? = null, text: String? = null,
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
showCaptionAboveMedia: Boolean = false,
spoilered: Boolean = false, spoilered: Boolean = false,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendPhoto(chat.id, fileId, text, parseMode, spoilered, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendPhoto(
chatId = chat.id,
fileId = fileId,
text = text,
parseMode = parseMode,
showCaptionAboveMedia = showCaptionAboveMedia,
spoilered = spoilered,
threadId = threadId,
businessConnectionId = businessConnectionId,
disableNotification = disableNotification,
protectContent = protectContent,
effectId = effectId,
replyParameters = replyParameters,
replyMarkup = replyMarkup
)
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@@ -70,14 +90,30 @@ suspend fun TelegramBot.sendPhoto(
photo: Photo, photo: Photo,
text: String? = null, text: String? = null,
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
showCaptionAboveMedia: Boolean = false,
spoilered: Boolean = false, spoilered: Boolean = false,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendPhoto(chatId, photo.biggest() ?.fileId ?: error("Photo content must not be empty"), text, parseMode, spoilered, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendPhoto(
chatId = chatId,
fileId = photo.biggest() ?.fileId ?: error("Photo content must not be empty"),
text = text,
parseMode = parseMode,
showCaptionAboveMedia = showCaptionAboveMedia,
spoilered = spoilered,
threadId = threadId,
businessConnectionId = businessConnectionId,
disableNotification = disableNotification,
protectContent = protectContent,
effectId = effectId,
replyParameters = replyParameters,
replyMarkup = replyMarkup
)
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@@ -88,14 +124,30 @@ suspend fun TelegramBot.sendPhoto(
photo: Photo, photo: Photo,
text: String? = null, text: String? = null,
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
showCaptionAboveMedia: Boolean = false,
spoilered: Boolean = false, spoilered: Boolean = false,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendPhoto(chat.id, photo, text, parseMode, spoilered, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendPhoto(
chatId = chat.id,
photo = photo,
text = text,
parseMode = parseMode,
showCaptionAboveMedia = showCaptionAboveMedia,
spoilered = spoilered,
threadId = threadId,
businessConnectionId = businessConnectionId,
disableNotification = disableNotification,
protectContent = protectContent,
effectId = effectId,
replyParameters = replyParameters,
replyMarkup = replyMarkup
)
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@@ -106,14 +158,30 @@ suspend fun TelegramBot.sendPhoto(
photoSize: PhotoSize, photoSize: PhotoSize,
text: String? = null, text: String? = null,
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
showCaptionAboveMedia: Boolean = false,
spoilered: Boolean = false, spoilered: Boolean = false,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendPhoto(chatId, photoSize.fileId, text, parseMode, spoilered, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendPhoto(
chatId = chatId,
fileId = photoSize.fileId,
text = text,
parseMode = parseMode,
showCaptionAboveMedia = showCaptionAboveMedia,
spoilered = spoilered,
threadId = threadId,
businessConnectionId = businessConnectionId,
disableNotification = disableNotification,
protectContent = protectContent,
effectId = effectId,
replyParameters = replyParameters,
replyMarkup = replyMarkup
)
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@@ -124,14 +192,30 @@ suspend fun TelegramBot.sendPhoto(
photoSize: PhotoSize, photoSize: PhotoSize,
text: String? = null, text: String? = null,
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
showCaptionAboveMedia: Boolean = false,
spoilered: Boolean = false, spoilered: Boolean = false,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendPhoto(chat.id, photoSize, text, parseMode, spoilered, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendPhoto(
chatId = chat.id,
photoSize = photoSize,
text = text,
parseMode = parseMode,
showCaptionAboveMedia = showCaptionAboveMedia,
spoilered = spoilered,
threadId = threadId,
businessConnectionId = businessConnectionId,
disableNotification = disableNotification,
protectContent = protectContent,
effectId = effectId,
replyParameters = replyParameters,
replyMarkup = replyMarkup
)
/** /**
@@ -142,25 +226,29 @@ suspend inline fun TelegramBot.sendPhoto(
chatId: ChatIdentifier, chatId: ChatIdentifier,
fileId: InputFile, fileId: InputFile,
entities: TextSourcesList, entities: TextSourcesList,
showCaptionAboveMedia: Boolean = false,
spoilered: Boolean = false, spoilered: Boolean = false,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = execute( ) = execute(
SendPhoto( SendPhoto(
chatId, chatId = chatId,
fileId, photo = fileId,
entities, entities = entities,
spoilered, showCaptionAboveMedia = showCaptionAboveMedia,
threadId, spoilered = spoilered,
businessConnectionId, threadId = threadId,
disableNotification, businessConnectionId = businessConnectionId,
protectContent, disableNotification = disableNotification,
replyParameters, protectContent = protectContent,
replyMarkup effectId = effectId,
replyParameters = replyParameters,
replyMarkup = replyMarkup
) )
) )
@@ -172,14 +260,29 @@ suspend inline fun TelegramBot.sendPhoto(
chat: Chat, chat: Chat,
fileId: InputFile, fileId: InputFile,
entities: TextSourcesList, entities: TextSourcesList,
showCaptionAboveMedia: Boolean = false,
spoilered: Boolean = false, spoilered: Boolean = false,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendPhoto(chat.id, fileId, entities, spoilered, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendPhoto(
chatId = chat.id,
fileId = fileId,
entities = entities,
showCaptionAboveMedia = showCaptionAboveMedia,
spoilered = spoilered,
threadId = threadId,
businessConnectionId = businessConnectionId,
disableNotification = disableNotification,
protectContent = protectContent,
effectId = effectId,
replyParameters = replyParameters,
replyMarkup = replyMarkup
)
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@@ -189,14 +292,29 @@ suspend inline fun TelegramBot.sendPhoto(
chatId: ChatIdentifier, chatId: ChatIdentifier,
photo: Photo, photo: Photo,
entities: TextSourcesList, entities: TextSourcesList,
showCaptionAboveMedia: Boolean = false,
spoilered: Boolean = false, spoilered: Boolean = false,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendPhoto(chatId, photo.biggest() ?.fileId ?: error("Photo content must not be empty"), entities, spoilered, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendPhoto(
chatId = chatId,
fileId = photo.biggest() ?.fileId ?: error("Photo content must not be empty"),
entities = entities,
showCaptionAboveMedia = showCaptionAboveMedia,
spoilered = spoilered,
threadId = threadId,
businessConnectionId = businessConnectionId,
disableNotification = disableNotification,
protectContent = protectContent,
effectId = effectId,
replyParameters = replyParameters,
replyMarkup = replyMarkup
)
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@@ -206,14 +324,29 @@ suspend inline fun TelegramBot.sendPhoto(
chat: Chat, chat: Chat,
photo: Photo, photo: Photo,
entities: TextSourcesList, entities: TextSourcesList,
showCaptionAboveMedia: Boolean = false,
spoilered: Boolean = false, spoilered: Boolean = false,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendPhoto(chat.id, photo, entities, spoilered, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendPhoto(
chatId = chat.id,
photo = photo,
entities = entities,
showCaptionAboveMedia = showCaptionAboveMedia,
spoilered = spoilered,
threadId = threadId,
businessConnectionId = businessConnectionId,
disableNotification = disableNotification,
protectContent = protectContent,
effectId = effectId,
replyParameters = replyParameters,
replyMarkup = replyMarkup
)
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@@ -223,14 +356,29 @@ suspend inline fun TelegramBot.sendPhoto(
chatId: ChatIdentifier, chatId: ChatIdentifier,
photoSize: PhotoSize, photoSize: PhotoSize,
entities: TextSourcesList, entities: TextSourcesList,
showCaptionAboveMedia: Boolean = false,
spoilered: Boolean = false, spoilered: Boolean = false,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendPhoto(chatId, photoSize.fileId, entities, spoilered, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendPhoto(
chatId = chatId,
fileId = photoSize.fileId,
entities = entities,
showCaptionAboveMedia = showCaptionAboveMedia,
spoilered = spoilered,
threadId = threadId,
businessConnectionId = businessConnectionId,
disableNotification = disableNotification,
protectContent = protectContent,
effectId = effectId,
replyParameters = replyParameters,
replyMarkup = replyMarkup
)
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@@ -240,11 +388,26 @@ suspend inline fun TelegramBot.sendPhoto(
chat: Chat, chat: Chat,
photoSize: PhotoSize, photoSize: PhotoSize,
entities: TextSourcesList, entities: TextSourcesList,
showCaptionAboveMedia: Boolean = false,
spoilered: Boolean = false, spoilered: Boolean = false,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendPhoto(chat.id, photoSize, entities, spoilered, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendPhoto(
chatId = chat.id,
photoSize = photoSize,
entities = entities,
showCaptionAboveMedia = showCaptionAboveMedia,
spoilered = spoilered,
threadId = threadId,
businessConnectionId = businessConnectionId,
disableNotification = disableNotification,
protectContent = protectContent,
effectId = effectId,
replyParameters = replyParameters,
replyMarkup = replyMarkup
)

View File

@@ -21,10 +21,11 @@ suspend fun TelegramBot.sendSticker(
emoji: String? = null, emoji: String? = null,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = execute( ) = execute(
SendSticker(chatId, sticker, threadId, businessConnectionId, emoji, disableNotification, protectContent, replyParameters, replyMarkup) SendSticker(chatId, sticker, threadId, businessConnectionId, emoji, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
) )
/** /**
@@ -39,9 +40,10 @@ suspend fun TelegramBot.sendSticker(
emoji: String? = null, emoji: String? = null,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendSticker(chat.id, sticker, threadId, businessConnectionId, emoji, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendSticker(chat.id, sticker, threadId, businessConnectionId, emoji, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@@ -55,9 +57,10 @@ suspend fun TelegramBot.sendSticker(
emoji: String? = null, emoji: String? = null,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendSticker(chatId, sticker.fileId, threadId, businessConnectionId, emoji, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendSticker(chatId, sticker.fileId, threadId, businessConnectionId, emoji, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@@ -71,6 +74,7 @@ suspend fun TelegramBot.sendSticker(
emoji: String? = null, emoji: String? = null,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendSticker(chat, sticker.fileId, threadId, businessConnectionId, emoji, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendSticker(chat, sticker.fileId, threadId, businessConnectionId, emoji, disableNotification, protectContent, effectId, replyParameters, replyMarkup)

View File

@@ -21,6 +21,7 @@ suspend fun TelegramBot.sendVideo(
thumb: InputFile? = null, thumb: InputFile? = null,
text: String? = null, text: String? = null,
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
showCaptionAboveMedia: Boolean = false,
spoilered: Boolean = false, spoilered: Boolean = false,
duration: Long? = null, duration: Long? = null,
width: Int? = null, width: Int? = null,
@@ -29,26 +30,29 @@ suspend fun TelegramBot.sendVideo(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = execute( ) = execute(
SendVideo( SendVideo(
chatId, chatId = chatId,
video, video = video,
thumb, thumbnail = thumb,
text, text = text,
parseMode, parseMode = parseMode,
spoilered, showCaptionAboveMedia = showCaptionAboveMedia,
duration, spoilered = spoilered,
width, duration = duration,
height, width = width,
null, height = height,
threadId, supportStreaming = null,
businessConnectionId, threadId = threadId,
disableNotification, businessConnectionId = businessConnectionId,
protectContent, disableNotification = disableNotification,
replyParameters, protectContent = protectContent,
replyMarkup effectId = effectId,
replyParameters = replyParameters,
replyMarkup = replyMarkup
) )
) )
@@ -61,14 +65,34 @@ suspend fun TelegramBot.sendVideo(
video: VideoFile, video: VideoFile,
text: String? = null, text: String? = null,
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
showCaptionAboveMedia: Boolean = false,
spoilered: Boolean = false, spoilered: Boolean = false,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendVideo(chatId, video.fileId, video.thumbnail ?.fileId, text, parseMode, spoilered, video.duration, video.width, video.height, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendVideo(
chatId = chatId,
video = video.fileId,
thumb = video.thumbnail ?.fileId,
text = text,
parseMode = parseMode,
showCaptionAboveMedia = showCaptionAboveMedia,
spoilered = spoilered,
duration = video.duration,
width = video.width,
height = video.height,
threadId = threadId,
businessConnectionId = businessConnectionId,
disableNotification = disableNotification,
protectContent = protectContent,
effectId = effectId,
replyParameters = replyParameters,
replyMarkup = replyMarkup
)
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@@ -80,6 +104,7 @@ suspend fun TelegramBot.sendVideo(
thumb: InputFile? = null, thumb: InputFile? = null,
text: String? = null, text: String? = null,
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
showCaptionAboveMedia: Boolean = false,
spoilered: Boolean = false, spoilered: Boolean = false,
duration: Long? = null, duration: Long? = null,
width: Int? = null, width: Int? = null,
@@ -88,9 +113,28 @@ suspend fun TelegramBot.sendVideo(
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendVideo(chat.id, video, thumb, text, parseMode, spoilered, duration, width, height, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendVideo(
chatId = chat.id,
video = video,
thumb = thumb,
text = text,
parseMode = parseMode,
showCaptionAboveMedia = showCaptionAboveMedia,
spoilered = spoilered,
duration = duration,
width = width,
height = height,
threadId = threadId,
businessConnectionId = businessConnectionId,
disableNotification = disableNotification,
protectContent = protectContent,
effectId = effectId,
replyParameters = replyParameters,
replyMarkup = replyMarkup
)
/** /**
@@ -102,14 +146,30 @@ suspend fun TelegramBot.sendVideo(
video: VideoFile, video: VideoFile,
text: String? = null, text: String? = null,
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
showCaptionAboveMedia: Boolean = false,
spoilered: Boolean = false, spoilered: Boolean = false,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendVideo(chat.id, video, text, parseMode, spoilered, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendVideo(
chatId = chat.id,
video = video,
text = text,
parseMode = parseMode,
showCaptionAboveMedia = showCaptionAboveMedia,
spoilered = spoilered,
threadId = threadId,
businessConnectionId = businessConnectionId,
disableNotification = disableNotification,
protectContent = protectContent,
effectId = effectId,
replyParameters = replyParameters,
replyMarkup = replyMarkup
)
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@@ -120,6 +180,7 @@ suspend inline fun TelegramBot.sendVideo(
video: InputFile, video: InputFile,
thumb: InputFile? = null, thumb: InputFile? = null,
entities: TextSourcesList, entities: TextSourcesList,
showCaptionAboveMedia: Boolean = false,
spoilered: Boolean = false, spoilered: Boolean = false,
duration: Long? = null, duration: Long? = null,
width: Int? = null, width: Int? = null,
@@ -128,25 +189,28 @@ suspend inline fun TelegramBot.sendVideo(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = execute( ) = execute(
SendVideo( SendVideo(
chatId, chatId = chatId,
video, video = video,
thumb, thumbnail = thumb,
entities, entities = entities,
spoilered, showCaptionAboveMedia = showCaptionAboveMedia,
duration, spoilered = spoilered,
width, duration = duration,
height, width = width,
null, height = height,
threadId, supportStreaming = null,
businessConnectionId, threadId = threadId,
disableNotification, businessConnectionId = businessConnectionId,
protectContent, disableNotification = disableNotification,
replyParameters, protectContent = protectContent,
replyMarkup effectId = effectId,
replyParameters = replyParameters,
replyMarkup = replyMarkup
) )
) )
@@ -158,14 +222,33 @@ suspend inline fun TelegramBot.sendVideo(
chatId: ChatIdentifier, chatId: ChatIdentifier,
video: VideoFile, video: VideoFile,
entities: TextSourcesList, entities: TextSourcesList,
showCaptionAboveMedia: Boolean = false,
spoilered: Boolean = false, spoilered: Boolean = false,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendVideo(chatId, video.fileId, video.thumbnail ?.fileId, entities, spoilered, video.duration, video.width, video.height, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendVideo(
chatId = chatId,
video = video.fileId,
thumb = video.thumbnail ?.fileId,
entities = entities,
showCaptionAboveMedia = showCaptionAboveMedia,
spoilered = spoilered,
duration = video.duration,
width = video.width,
height = video.height,
threadId = threadId,
businessConnectionId = businessConnectionId,
disableNotification = disableNotification,
protectContent = protectContent,
effectId = effectId,
replyParameters = replyParameters,
replyMarkup = replyMarkup
)
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@@ -176,6 +259,7 @@ suspend inline fun TelegramBot.sendVideo(
video: InputFile, video: InputFile,
thumb: InputFile? = null, thumb: InputFile? = null,
entities: TextSourcesList, entities: TextSourcesList,
showCaptionAboveMedia: Boolean = false,
spoilered: Boolean = false, spoilered: Boolean = false,
duration: Long? = null, duration: Long? = null,
width: Int? = null, width: Int? = null,
@@ -184,9 +268,27 @@ suspend inline fun TelegramBot.sendVideo(
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendVideo(chat.id, video, thumb, entities, spoilered, duration, width, height, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendVideo(
chatId = chat.id,
video = video,
thumb = thumb,
entities = entities,
showCaptionAboveMedia = showCaptionAboveMedia,
spoilered = spoilered,
duration = duration,
width = width,
height = height,
threadId = threadId,
businessConnectionId = businessConnectionId,
disableNotification = disableNotification,
protectContent = protectContent,
effectId = effectId,
replyParameters = replyParameters,
replyMarkup = replyMarkup
)
/** /**
@@ -197,11 +299,26 @@ suspend inline fun TelegramBot.sendVideo(
chat: Chat, chat: Chat,
video: VideoFile, video: VideoFile,
entities: TextSourcesList, entities: TextSourcesList,
showCaptionAboveMedia: Boolean = false,
spoilered: Boolean = false, spoilered: Boolean = false,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendVideo(chat.id, video, entities, spoilered, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendVideo(
chatId = chat.id,
video = video,
entities = entities,
showCaptionAboveMedia = showCaptionAboveMedia,
spoilered = spoilered,
threadId = threadId,
businessConnectionId = businessConnectionId,
disableNotification = disableNotification,
protectContent = protectContent,
effectId = effectId,
replyParameters = replyParameters,
replyMarkup = replyMarkup
)

View File

@@ -23,6 +23,7 @@ suspend fun TelegramBot.sendVideoNote(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = execute( ) = execute(
@@ -36,6 +37,7 @@ suspend fun TelegramBot.sendVideoNote(
businessConnectionId, businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
effectId,
replyParameters, replyParameters,
replyMarkup replyMarkup
) )
@@ -52,10 +54,11 @@ suspend fun TelegramBot.sendVideoNote(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendVideoNote( ) = sendVideoNote(
chatId, videoNote.fileId, videoNote.thumbnail ?.fileId, videoNote.duration, videoNote.width, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup chatId, videoNote.fileId, videoNote.thumbnail ?.fileId, videoNote.duration, videoNote.width, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup
) )
/** /**
@@ -72,9 +75,10 @@ suspend fun TelegramBot.sendVideoNote(
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendVideoNote(chat.id, videoNote, thumb, duration, size, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendVideoNote(chat.id, videoNote, thumb, duration, size, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@@ -87,6 +91,7 @@ suspend fun TelegramBot.sendVideoNote(
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendVideoNote(chat.id, videoNote, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendVideoNote(chat.id, videoNote, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)

View File

@@ -25,6 +25,7 @@ suspend fun TelegramBot.sendVoice(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = execute( ) = execute(
@@ -38,6 +39,7 @@ suspend fun TelegramBot.sendVoice(
businessConnectionId, businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
effectId,
replyParameters, replyParameters,
replyMarkup replyMarkup
) )
@@ -57,9 +59,10 @@ suspend fun TelegramBot.sendVoice(
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendVoice(chat.id, voice, text, parseMode, duration, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendVoice(chat.id, voice, text, parseMode, duration, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@@ -74,10 +77,11 @@ suspend fun TelegramBot.sendVoice(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendVoice( ) = sendVoice(
chatId, voice.fileId, text, parseMode, voice.duration, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup chatId, voice.fileId, text, parseMode, voice.duration, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup
) )
/** /**
@@ -93,9 +97,10 @@ suspend fun TelegramBot.sendVoice(
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendVoice(chat.id, voice, text, parseMode, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendVoice(chat.id, voice, text, parseMode, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
/** /**
@@ -111,6 +116,7 @@ suspend inline fun TelegramBot.sendVoice(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = execute( ) = execute(
@@ -123,6 +129,7 @@ suspend inline fun TelegramBot.sendVoice(
duration = duration, duration = duration,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
effectId = effectId,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -141,9 +148,10 @@ suspend inline fun TelegramBot.sendVoice(
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendVoice(chat.id, voice, entities, duration, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendVoice(chat.id, voice, entities, duration, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@@ -157,10 +165,11 @@ suspend inline fun TelegramBot.sendVoice(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendVoice( ) = sendVoice(
chatId, voice.fileId, entities, voice.duration, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup chatId, voice.fileId, entities, voice.duration, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup
) )
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@@ -174,6 +183,7 @@ suspend inline fun TelegramBot.sendVoice(
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendVoice(chat.id, voice, entities, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendVoice(chat.id, voice, entities, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)

View File

@@ -8,6 +8,7 @@ import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
import dev.inmo.tgbotapi.types.chat.CommonUser import dev.inmo.tgbotapi.types.chat.CommonUser
import dev.inmo.tgbotapi.types.payments.LabeledPrice import dev.inmo.tgbotapi.types.payments.LabeledPrice
import dev.inmo.tgbotapi.types.payments.abstracts.Currency import dev.inmo.tgbotapi.types.payments.abstracts.Currency
import dev.inmo.tgbotapi.types.payments.abstracts.XTR
suspend fun TelegramBot.createInvoiceLink( suspend fun TelegramBot.createInvoiceLink(
title: String, title: String,
@@ -29,3 +30,25 @@ suspend fun TelegramBot.createInvoiceLink(
) = execute( ) = execute(
CreateInvoiceLink(title, description, payload, providerToken, currency, prices, maxTipAmount, suggestedTipAmounts ?.sorted(), providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress) CreateInvoiceLink(title, description, payload, providerToken, currency, prices, maxTipAmount, suggestedTipAmounts ?.sorted(), providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress)
) )
/**
* For links witn XTR currency and using of Telegram Stars
*/
suspend fun TelegramBot.createInvoiceLink(
title: String,
description: String,
payload: String,
prices: List<LabeledPrice>,
maxTipAmount: Int? = null,
suggestedTipAmounts: List<Int>? = null,
providerData: String? = null,
requireName: Boolean = false,
requirePhoneNumber: Boolean = false,
requireEmail: Boolean = false,
requireShippingAddress: Boolean = false,
shouldSendPhoneNumberToProvider: Boolean = false,
shouldSendEmailToProvider: Boolean = false,
priceDependOnShipAddress: Boolean = false
) = execute(
CreateInvoiceLink(title, description, payload, null, Currency.XTR, prices, maxTipAmount, suggestedTipAmounts ?.sorted(), providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress)
)

View File

@@ -0,0 +1,17 @@
package dev.inmo.tgbotapi.extensions.api.send.payments
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.send.payments.RefundStarPayment
import dev.inmo.tgbotapi.types.UserId
import dev.inmo.tgbotapi.types.payments.SuccessfulPayment
import dev.inmo.tgbotapi.types.payments.abstracts.TelegramPaymentChargeId
suspend fun TelegramBot.refundStarPayment(
userId: UserId,
telegramPaymentChargeId: TelegramPaymentChargeId
) = execute(RefundStarPayment(userId, telegramPaymentChargeId))
suspend fun TelegramBot.refundStarPayment(
userId: UserId,
successfulPayment: SuccessfulPayment
) = refundStarPayment(userId, successfulPayment.telegramPaymentChargeId)

View File

@@ -7,6 +7,7 @@ import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
import dev.inmo.tgbotapi.types.chat.CommonUser import dev.inmo.tgbotapi.types.chat.CommonUser
import dev.inmo.tgbotapi.types.payments.LabeledPrice import dev.inmo.tgbotapi.types.payments.LabeledPrice
import dev.inmo.tgbotapi.types.payments.abstracts.Currency import dev.inmo.tgbotapi.types.payments.abstracts.Currency
import dev.inmo.tgbotapi.types.payments.abstracts.XTR
/** /**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
@@ -34,10 +35,11 @@ suspend fun TelegramBot.sendInvoice(
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: InlineKeyboardMarkup? = null replyMarkup: InlineKeyboardMarkup? = null
) = execute( ) = execute(
SendInvoice(chatId, title, description, payload, providerToken, currency, prices, maxTipAmount, suggestedTipAmounts ?.sorted(), startParameter, providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress, threadId, disableNotification, protectContent, replyParameters, replyMarkup) SendInvoice(chatId, title, description, payload, providerToken, currency, prices, maxTipAmount, suggestedTipAmounts ?.sorted(), startParameter, providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress, threadId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
) )
/** /**
@@ -65,6 +67,63 @@ suspend fun TelegramBot.sendInvoice(
priceDependOnShipAddress: Boolean = false, priceDependOnShipAddress: Boolean = false,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: InlineKeyboardMarkup? = null replyMarkup: InlineKeyboardMarkup? = null
) = sendInvoice(user.id, title, description, payload, providerToken, currency, prices, maxTipAmount, suggestedTipAmounts, startParameter, providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress, null, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendInvoice(user.id, title, description, payload, providerToken, currency, prices, maxTipAmount, suggestedTipAmounts, startParameter, providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress, null, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
suspend fun TelegramBot.sendInvoice(
chatId: IdChatIdentifier,
title: String,
description: String,
payload: String,
price: LabeledPrice,
startParameter: StartParameter? = null,
providerData: String? = null,
threadId: MessageThreadId? = chatId.threadId,
disableNotification: Boolean = false,
protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null,
replyMarkup: InlineKeyboardMarkup? = null
) = execute(
SendInvoice(chatId, title, description, payload, price, startParameter, providerData, threadId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
)
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
suspend fun TelegramBot.sendInvoice(
user: CommonUser,
title: String,
description: String,
payload: String,
price: LabeledPrice,
startParameter: StartParameter? = null,
providerData: String? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null,
replyMarkup: InlineKeyboardMarkup? = null
) = sendInvoice(
chatId = user.id,
title = title,
description = description,
payload = payload,
price = price,
startParameter = startParameter,
providerData = providerData,
threadId = null,
disableNotification = disableNotification,
protectContent = protectContent,
effectId = effectId,
replyParameters = replyParameters,
replyMarkup = replyMarkup
)

View File

@@ -1,299 +0,0 @@
package dev.inmo.tgbotapi.extensions.api.send.polls
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.send.polls.SendQuizPoll
import dev.inmo.tgbotapi.requests.send.polls.SendRegularPoll
import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
import dev.inmo.tgbotapi.types.message.ParseMode
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
import dev.inmo.tgbotapi.types.chat.Chat
import dev.inmo.tgbotapi.types.polls.*
/**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
*/
suspend fun TelegramBot.sendRegularPoll(
chatId: ChatIdentifier,
question: String,
options: List<String>,
isAnonymous: Boolean = true,
isClosed: Boolean = false,
allowMultipleAnswers: Boolean = false,
closeInfo: ScheduledCloseInfo? = null,
threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false,
protectContent: Boolean = false,
replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null
) = execute(
SendRegularPoll(
chatId, question, options, isAnonymous, isClosed, allowMultipleAnswers, closeInfo, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup
)
)
/**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
*/
suspend fun TelegramBot.sendRegularPoll(
chatId: ChatIdentifier,
poll: RegularPoll,
isClosed: Boolean = false,
question: String = poll.question,
options: List<String> = poll.options.map { it.text },
isAnonymous: Boolean = poll.isAnonymous,
allowMultipleAnswers: Boolean = poll.allowMultipleAnswers,
closeInfo: ScheduledCloseInfo? = null,
threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false,
protectContent: Boolean = false,
replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null
) = sendRegularPoll(chatId, question, options, isAnonymous, isClosed, allowMultipleAnswers, closeInfo, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
/**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
*/
suspend fun TelegramBot.sendRegularPoll(
chat: Chat,
question: String,
options: List<String>,
isAnonymous: Boolean = true,
isClosed: Boolean = false,
allowMultipleAnswers: Boolean = false,
closeInfo: ScheduledCloseInfo? = null,
threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false,
protectContent: Boolean = false,
replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null
) = sendRegularPoll(
chat.id, question, options, isAnonymous, isClosed, allowMultipleAnswers, closeInfo, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup
)
/**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
*/
suspend fun TelegramBot.sendRegularPoll(
chat: Chat,
poll: RegularPoll,
isClosed: Boolean = false,
question: String = poll.question,
options: List<String> = poll.options.map { it.text },
isAnonymous: Boolean = poll.isAnonymous,
allowMultipleAnswers: Boolean = poll.allowMultipleAnswers,
closeInfo: ScheduledCloseInfo? = null,
threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false,
protectContent: Boolean = false,
replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null
) = sendRegularPoll(
chat.id, question, options, isAnonymous, isClosed, allowMultipleAnswers, closeInfo, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup
)
/**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
*/
suspend fun TelegramBot.sendQuizPoll(
chatId: ChatIdentifier,
question: String,
options: List<String>,
correctOptionId: Int,
isAnonymous: Boolean = true,
isClosed: Boolean = false,
explanation: String? = null,
parseMode: ParseMode? = null,
closeInfo: ScheduledCloseInfo? = null,
threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false,
protectContent: Boolean = false,
replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null
) = execute(
SendQuizPoll(
chatId, question, options, correctOptionId, isAnonymous, isClosed, explanation, parseMode, closeInfo, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup
)
)
/**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
*/
suspend fun TelegramBot.sendQuizPoll(
chat: Chat,
question: String,
options: List<String>,
correctOptionId: Int,
isAnonymous: Boolean = true,
isClosed: Boolean = false,
explanation: String? = null,
parseMode: ParseMode? = null,
closeInfo: ScheduledCloseInfo? = null,
threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false,
protectContent: Boolean = false,
replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null
) = sendQuizPoll(
chat.id, question, options, correctOptionId, isAnonymous, isClosed, explanation, parseMode, closeInfo, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup
)
/**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
*/
suspend fun TelegramBot.sendQuizPoll(
chatId: ChatIdentifier,
isClosed: Boolean = false,
quizPoll: QuizPoll,
question: String = quizPoll.question,
options: List<String> = quizPoll.options.map { it.text },
correctOptionId: Int = quizPoll.correctOptionId ?: error("Correct option ID must be provided by income QuizPoll or by developer"),
isAnonymous: Boolean = quizPoll.isAnonymous,
explanation: String? = null,
parseMode: ParseMode? = null,
closeInfo: ScheduledCloseInfo? = null,
threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false,
protectContent: Boolean = false,
replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null
) = sendQuizPoll(
chatId, question, options, correctOptionId, isAnonymous, isClosed, explanation, parseMode, closeInfo, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup
)
/**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
*/
suspend fun TelegramBot.sendQuizPoll(
chat: Chat,
isClosed: Boolean = false,
quizPoll: QuizPoll,
question: String = quizPoll.question,
options: List<String> = quizPoll.options.map { it.text },
correctOptionId: Int = quizPoll.correctOptionId ?: error("Correct option ID must be provided by income QuizPoll or by developer"),
isAnonymous: Boolean = quizPoll.isAnonymous,
explanation: String? = null,
parseMode: ParseMode? = null,
closeInfo: ScheduledCloseInfo? = null,
threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false,
protectContent: Boolean = false,
replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null
) = sendQuizPoll(
chat.id, question, options, correctOptionId, isAnonymous, isClosed, explanation, parseMode, closeInfo, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup
)
/**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
*/
suspend inline fun TelegramBot.sendQuizPoll(
chatId: ChatIdentifier,
question: String,
options: List<String>,
correctOptionId: Int,
isAnonymous: Boolean = true,
isClosed: Boolean = false,
entities: TextSourcesList,
closeInfo: ScheduledCloseInfo? = null,
threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false,
protectContent: Boolean = false,
replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null
) = execute(
SendQuizPoll(
chatId, question, options, correctOptionId, isAnonymous, isClosed, entities, closeInfo, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup
)
)
/**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
*/
suspend inline fun TelegramBot.sendQuizPoll(
chat: Chat,
question: String,
options: List<String>,
correctOptionId: Int,
isAnonymous: Boolean = true,
isClosed: Boolean = false,
entities: TextSourcesList,
closeInfo: ScheduledCloseInfo? = null,
threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false,
protectContent: Boolean = false,
replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null
) = sendQuizPoll(
chat.id, question, options, correctOptionId, isAnonymous, isClosed, entities, closeInfo, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup
)
/**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
*/
suspend inline fun TelegramBot.sendQuizPoll(
chatId: ChatIdentifier,
isClosed: Boolean = false,
quizPoll: QuizPoll,
question: String = quizPoll.question,
options: List<String> = quizPoll.options.map { it.text },
correctOptionId: Int = quizPoll.correctOptionId ?: error("Correct option ID must be provided by income QuizPoll or by developer"),
isAnonymous: Boolean = quizPoll.isAnonymous,
entities: TextSourcesList,
closeInfo: ScheduledCloseInfo? = null,
threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false,
protectContent: Boolean = false,
replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null
) = sendQuizPoll(
chatId, question, options, correctOptionId, isAnonymous, isClosed, entities, closeInfo, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup
)
/**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
*/
suspend inline fun TelegramBot.sendQuizPoll(
chat: Chat,
isClosed: Boolean = false,
quizPoll: QuizPoll,
question: String = quizPoll.question,
options: List<String> = quizPoll.options.map { it.text },
correctOptionId: Int = quizPoll.correctOptionId ?: error("Correct option ID must be provided by income QuizPoll or by developer"),
isAnonymous: Boolean = quizPoll.isAnonymous,
entities: TextSourcesList,
closeInfo: ScheduledCloseInfo? = null,
threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false,
protectContent: Boolean = false,
replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null
) = sendQuizPoll(
chat.id, question, options, correctOptionId, isAnonymous, isClosed, entities, closeInfo, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup
)

View File

@@ -0,0 +1,325 @@
package dev.inmo.tgbotapi.extensions.api.send.polls
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.send.polls.SendQuizPoll
import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
import dev.inmo.tgbotapi.types.message.ParseMode
import dev.inmo.tgbotapi.types.message.textsources.TextSource
import dev.inmo.tgbotapi.types.polls.InputPollOption
import dev.inmo.tgbotapi.types.polls.ScheduledCloseInfo
suspend fun TelegramBot.sendQuizPoll(
chatId: ChatIdentifier,
question: String,
options: List<InputPollOption>,
correctOptionId: Int,
explanation: String?,
questionParseMode: ParseMode? = null,
explanationParseMode: ParseMode? = null,
isAnonymous: Boolean = true,
isClosed: Boolean = false,
openPeriod: LongSeconds? = null,
closeDate: LongSeconds? = null,
threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false,
protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null
) = execute(
SendQuizPoll(
chatId,
question,
options,
correctOptionId,
explanation,
questionParseMode,
explanationParseMode,
isAnonymous,
isClosed,
openPeriod,
closeDate,
threadId,
businessConnectionId,
disableNotification,
protectContent,
effectId,
replyParameters,
replyMarkup
)
)
suspend fun TelegramBot.sendQuizPoll(
chatId: ChatIdentifier,
questionEntities: List<TextSource>,
options: List<InputPollOption>,
correctOptionId: Int,
explanation: String?,
explanationParseMode: ParseMode? = null,
isAnonymous: Boolean = true,
isClosed: Boolean = false,
openPeriod: LongSeconds? = null,
closeDate: LongSeconds? = null,
threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false,
protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null
) = execute(
SendQuizPoll(
chatId,
questionEntities,
options,
correctOptionId,
explanation,
explanationParseMode,
isAnonymous,
isClosed,
openPeriod,
closeDate,
threadId,
businessConnectionId,
disableNotification,
protectContent,
effectId,
replyParameters,
replyMarkup
)
)
suspend fun TelegramBot.sendQuizPoll(
chatId: ChatIdentifier,
question: String,
options: List<InputPollOption>,
correctOptionId: Int,
explanationTextSources: List<TextSource>? = null,
questionParseMode: ParseMode? = null,
isAnonymous: Boolean = true,
isClosed: Boolean = false,
openPeriod: LongSeconds? = null,
closeDate: LongSeconds? = null,
threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false,
protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null
) = execute(
SendQuizPoll(
chatId,
question,
options,
correctOptionId,
questionParseMode,
explanationTextSources,
isAnonymous,
isClosed,
openPeriod,
closeDate,
threadId,
businessConnectionId,
disableNotification,
protectContent,
effectId,
replyParameters,
replyMarkup
)
)
suspend fun TelegramBot.sendQuizPoll(
chatId: ChatIdentifier,
questionEntities: List<TextSource>,
options: List<InputPollOption>,
correctOptionId: Int,
explanationTextSources: List<TextSource>? = null,
isAnonymous: Boolean = true,
isClosed: Boolean = false,
openPeriod: LongSeconds? = null,
closeDate: LongSeconds? = null,
threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false,
protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null
) = execute(
SendQuizPoll(
chatId,
questionEntities,
options,
correctOptionId,
explanationTextSources,
isAnonymous,
isClosed,
openPeriod,
closeDate,
threadId,
businessConnectionId,
disableNotification,
protectContent,
effectId,
replyParameters,
replyMarkup
)
)
suspend fun TelegramBot.sendQuizPoll(
chatId: ChatIdentifier,
question: String,
options: List<InputPollOption>,
correctOptionId: Int,
closeInfo: ScheduledCloseInfo?,
questionParseMode: ParseMode? = null,
explanation: String?,
explanationParseMode: ParseMode? = null,
isAnonymous: Boolean = true,
isClosed: Boolean = false,
threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false,
protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null
) = execute(
SendQuizPoll(
chatId,
question,
options,
correctOptionId,
closeInfo,
explanation,
questionParseMode,
explanationParseMode,
isAnonymous,
isClosed,
threadId,
businessConnectionId,
disableNotification,
protectContent,
effectId,
replyParameters,
replyMarkup
)
)
suspend fun TelegramBot.sendQuizPoll(
chatId: ChatIdentifier,
questionEntities: List<TextSource>,
options: List<InputPollOption>,
correctOptionId: Int,
closeInfo: ScheduledCloseInfo?,
explanation: String?,
explanationParseMode: ParseMode? = null,
isAnonymous: Boolean = true,
isClosed: Boolean = false,
threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false,
protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null
) = execute(
SendQuizPoll(
chatId,
questionEntities,
options,
correctOptionId,
closeInfo,
explanation,
explanationParseMode,
isAnonymous,
isClosed,
threadId,
businessConnectionId,
disableNotification,
protectContent,
effectId,
replyParameters,
replyMarkup
)
)
suspend fun TelegramBot.sendQuizPoll(
chatId: ChatIdentifier,
question: String,
options: List<InputPollOption>,
correctOptionId: Int,
closeInfo: ScheduledCloseInfo?,
questionParseMode: ParseMode? = null,
explanationTextSources: List<TextSource>? = null,
isAnonymous: Boolean = true,
isClosed: Boolean = false,
threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false,
protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null
) = execute(
SendQuizPoll(
chatId,
question,
options,
correctOptionId,
closeInfo,
questionParseMode,
explanationTextSources,
isAnonymous,
isClosed,
threadId,
businessConnectionId,
disableNotification,
protectContent,
effectId,
replyParameters,
replyMarkup
)
)
suspend fun TelegramBot.sendQuizPoll(
chatId: ChatIdentifier,
questionEntities: List<TextSource>,
options: List<InputPollOption>,
correctOptionId: Int,
closeInfo: ScheduledCloseInfo?,
explanationTextSources: List<TextSource>? = null,
isAnonymous: Boolean = true,
isClosed: Boolean = false,
threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false,
protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null
) = execute(
SendQuizPoll(
chatId,
questionEntities,
options,
correctOptionId,
closeInfo,
explanationTextSources,
isAnonymous,
isClosed,
threadId,
businessConnectionId,
disableNotification,
protectContent,
effectId,
replyParameters,
replyMarkup
)
)

View File

@@ -0,0 +1,156 @@
package dev.inmo.tgbotapi.extensions.api.send.polls
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.send.polls.SendRegularPoll
import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
import dev.inmo.tgbotapi.types.message.ParseMode
import dev.inmo.tgbotapi.types.message.textsources.TextSource
import dev.inmo.tgbotapi.types.polls.InputPollOption
import dev.inmo.tgbotapi.types.polls.ScheduledCloseInfo
suspend fun TelegramBot.sendRegularPoll(
chatId: ChatIdentifier,
question: String,
options: List<InputPollOption>,
questionParseMode: ParseMode? = null,
isAnonymous: Boolean = true,
isClosed: Boolean = false,
allowMultipleAnswers: Boolean = false,
openPeriod: LongSeconds? = null,
closeDate: LongSeconds? = null,
threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false,
protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null
) = execute(
SendRegularPoll(
chatId,
question,
options,
questionParseMode,
isAnonymous,
isClosed,
allowMultipleAnswers,
openPeriod,
closeDate,
threadId,
businessConnectionId,
disableNotification,
protectContent,
effectId,
replyParameters,
replyMarkup
)
)
suspend fun TelegramBot.sendRegularPoll(
chatId: ChatIdentifier,
questionEntities: List<TextSource>,
options: List<InputPollOption>,
isAnonymous: Boolean = true,
isClosed: Boolean = false,
allowMultipleAnswers: Boolean = false,
openPeriod: LongSeconds? = null,
closeDate: LongSeconds? = null,
threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false,
protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null
) = execute(
SendRegularPoll(
chatId,
questionEntities,
options,
isAnonymous,
isClosed,
allowMultipleAnswers,
openPeriod,
closeDate,
threadId,
businessConnectionId,
disableNotification,
protectContent,
effectId,
replyParameters,
replyMarkup
)
)
suspend fun TelegramBot.sendRegularPoll(
chatId: ChatIdentifier,
question: String,
options: List<InputPollOption>,
closeInfo: ScheduledCloseInfo?,
questionParseMode: ParseMode? = null,
isAnonymous: Boolean = true,
isClosed: Boolean = false,
allowMultipleAnswers: Boolean = false,
threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false,
protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null
) = execute(
SendRegularPoll(
chatId,
question,
options,
closeInfo,
questionParseMode,
isAnonymous,
isClosed,
allowMultipleAnswers,
threadId,
businessConnectionId,
disableNotification,
protectContent,
effectId,
replyParameters,
replyMarkup
)
)
suspend fun TelegramBot.sendRegularPoll(
chatId: ChatIdentifier,
questionEntities: List<TextSource>,
options: List<InputPollOption>,
closeInfo: ScheduledCloseInfo?,
isAnonymous: Boolean = true,
isClosed: Boolean = false,
allowMultipleAnswers: Boolean = false,
threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false,
protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null
) = execute(
SendRegularPoll(
chatId,
questionEntities,
options,
closeInfo,
isAnonymous,
isClosed,
allowMultipleAnswers,
threadId,
businessConnectionId,
disableNotification,
protectContent,
effectId,
replyParameters,
replyMarkup
)
)

View File

@@ -36,10 +36,9 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourConte
public static final fun CustomBehaviourContextReceiver (Lkotlin/jvm/functions/Function2;)Lkotlin/jvm/functions/Function2; public static final fun CustomBehaviourContextReceiver (Lkotlin/jvm/functions/Function2;)Lkotlin/jvm/functions/Function2;
public static final fun createSubContext (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlinx/coroutines/CoroutineScope;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;Lkotlinx/coroutines/flow/Flow;)Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext; public static final fun createSubContext (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlinx/coroutines/CoroutineScope;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;Lkotlinx/coroutines/flow/Flow;)Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;
public static synthetic fun createSubContext$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlinx/coroutines/CoroutineScope;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;Lkotlinx/coroutines/flow/Flow;ILjava/lang/Object;)Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext; public static synthetic fun createSubContext$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlinx/coroutines/CoroutineScope;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;Lkotlinx/coroutines/flow/Flow;ILjava/lang/Object;)Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;
public static final fun createSubContextAndDoWithUpdatesFilter (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlinx/coroutines/CoroutineScope;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;Lkotlinx/coroutines/flow/Flow;ZLkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun createSubContextAndDoWithUpdatesFilter (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;Lkotlinx/coroutines/flow/Flow;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static synthetic fun createSubContextAndDoWithUpdatesFilter$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlinx/coroutines/CoroutineScope;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;Lkotlinx/coroutines/flow/Flow;ZLkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public static synthetic fun createSubContextAndDoWithUpdatesFilter$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;Lkotlinx/coroutines/flow/Flow;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
public static final fun doInContext (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;ZLkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun doInContext (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static synthetic fun doInContext$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;ZLkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
public static final fun stop (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;)V public static final fun stop (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;)V
} }
@@ -454,6 +453,8 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/W
public static synthetic fun waitChannelChatCreatedEvents$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public static synthetic fun waitChannelChatCreatedEvents$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
public static final fun waitChannelEvents (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun waitChannelEvents (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static synthetic fun waitChannelEvents$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public static synthetic fun waitChannelEvents$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
public static final fun waitChatBackgroundSet (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static synthetic fun waitChatBackgroundSet$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
public static final fun waitChatBoostAdded (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun waitChatBoostAdded (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static synthetic fun waitChatBoostAdded$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public static synthetic fun waitChatBoostAdded$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
public static final fun waitChatEvents (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun waitChatEvents (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
@@ -539,6 +540,8 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/W
public static synthetic fun waitChannelChatCreatedEventsMessages$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public static synthetic fun waitChannelChatCreatedEventsMessages$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
public static final fun waitChannelEventsMessages (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun waitChannelEventsMessages (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static synthetic fun waitChannelEventsMessages$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public static synthetic fun waitChannelEventsMessages$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
public static final fun waitChatBackgroundSetEventsMessages (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static synthetic fun waitChatBackgroundSetEventsMessages$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
public static final fun waitChatBoostAddedEventsMessages (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun waitChatBoostAddedEventsMessages (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static synthetic fun waitChatBoostAddedEventsMessages$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public static synthetic fun waitChatBoostAddedEventsMessages$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
public static final fun waitChatEventsMessages (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun waitChatEventsMessages (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
@@ -1011,6 +1014,8 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handl
public static synthetic fun onChannelChatCreated$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function3;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public static synthetic fun onChannelChatCreated$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function3;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
public static final fun onChannelEvent (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function3;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun onChannelEvent (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function3;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static synthetic fun onChannelEvent$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function3;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public static synthetic fun onChannelEvent$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function3;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
public static final fun onChatBackgroundSet (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function3;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static synthetic fun onChatBackgroundSet$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function3;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
public static final fun onChatBoostAdded (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function3;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun onChatBoostAdded (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function3;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static synthetic fun onChatBoostAdded$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function3;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public static synthetic fun onChatBoostAdded$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function3;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
public static final fun onChatEvent (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function3;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun onChatEvent (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function3;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;

View File

@@ -87,7 +87,7 @@ class DefaultBehaviourContext(
} else { } else {
it it
} }
}.accumulatorFlow(scope) }.accumulatorFlow(WeakScope(scope))
override val asUpdateReceiver: UpdateReceiver<Update> = additionalUpdatesSharedFlow::emit override val asUpdateReceiver: UpdateReceiver<Update> = additionalUpdatesSharedFlow::emit
override fun copy( override fun copy(
@@ -133,38 +133,32 @@ fun <BC : BehaviourContext> BC.createSubContext(
/** /**
* Launch [behaviourContextReceiver] in context of [this] as [BehaviourContext] and as [kotlin.coroutines.CoroutineContext] * Launch [behaviourContextReceiver] in context of [this] as [BehaviourContext] and as [kotlin.coroutines.CoroutineContext]
* *
* @param stopOnCompletion ___FALSE BY DEFAULT___. Will stop [this] in case if passed true * [this] [BehaviourContext] will **NOT** be closed automatically
*/ */
suspend fun <T, BC : BehaviourContext> BC.doInContext( suspend fun <T, BC : BehaviourContext> BC.doInContext(
stopOnCompletion: Boolean = false,
behaviourContextReceiver: CustomBehaviourContextReceiver<BC, T> behaviourContextReceiver: CustomBehaviourContextReceiver<BC, T>
): T { ): T {
return withContext(coroutineContext) { return withContext(coroutineContext) {
behaviourContextReceiver().also { if (stopOnCompletion) stop() } behaviourContextReceiver()
} }
} }
/** /**
* Creates new one [BehaviourContext] using [createSubContext] and launches [behaviourContextReceiver] in a new context * Creates new one [BehaviourContext] using [createSubContext] and launches [behaviourContextReceiver] in a new context
* using [doInContext] * using [doInContext]
*
* @param stopOnCompletion ___TRUE BY DEFAULT___
*/ */
suspend fun <T, BC : BehaviourContext> BC.createSubContextAndDoWithUpdatesFilter( suspend fun <T, BC : BehaviourContext> BC.createSubContextAndDoWithUpdatesFilter(
scope: CoroutineScope = LinkedSupervisorScope(),
triggersHolder: TriggersHolder = this.triggersHolder, triggersHolder: TriggersHolder = this.triggersHolder,
updatesUpstreamFlow: Flow<Update> = allUpdatesFlow, updatesUpstreamFlow: Flow<Update> = allUpdatesFlow,
stopOnCompletion: Boolean = true,
behaviourContextReceiver: CustomBehaviourContextReceiver<BC, T> behaviourContextReceiver: CustomBehaviourContextReceiver<BC, T>
): T { ): T {
return createSubContext( return supervisorScope {
scope, createSubContext(
triggersHolder, scope = this@supervisorScope,
updatesUpstreamFlow triggersHolder = triggersHolder,
).doInContext( updatesUpstreamFlow = updatesUpstreamFlow
stopOnCompletion, ).behaviourContextReceiver()
behaviourContextReceiver }
)
} }
/** /**

View File

@@ -38,7 +38,9 @@ suspend fun <T> FlowsUpdatesFilter.expectFlow(
filter: suspend (Update) -> List<T> filter: suspend (Update) -> List<T>
): Flow<T> { ): Flow<T> {
val flow = allUpdatesFlow.map { val flow = allUpdatesFlow.map {
val result = safelyWithResult { filter(it) } val result = runCatching {
filter(it)
}
if (result.isFailure || result.getOrThrow().isEmpty()) { if (result.isFailure || result.getOrThrow().isEmpty()) {
if (cancelTrigger(it)) { if (cancelTrigger(it)) {
cancelRequestFactory(it) ?.also { cancelRequestFactory(it) ?.also {
@@ -47,14 +49,20 @@ suspend fun <T> FlowsUpdatesFilter.expectFlow(
} }
} }
errorFactory(it) ?.also { errorRequest -> errorFactory(it) ?.also { errorRequest ->
safelyWithoutExceptions { bot.execute(errorRequest) } runCatching {
bot.execute(errorRequest)
}
} }
emptyList() emptyList()
} else { } else {
result.getOrThrow() result.getOrThrow()
} }
}.flatten() }.flatten()
initRequest ?.also { safelyWithoutExceptions { bot.execute(initRequest) } } initRequest ?.also {
runCatching {
bot.execute(initRequest)
}
}
return flow return flow
} }

View File

@@ -5,6 +5,7 @@ package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
import dev.inmo.tgbotapi.extensions.utils.* import dev.inmo.tgbotapi.extensions.utils.*
import dev.inmo.tgbotapi.requests.abstracts.Request import dev.inmo.tgbotapi.requests.abstracts.Request
import dev.inmo.tgbotapi.types.chat.ChatBackground
import dev.inmo.tgbotapi.types.message.ChatEvents.* import dev.inmo.tgbotapi.types.message.ChatEvents.*
import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.* import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.*
import dev.inmo.tgbotapi.types.message.ChatEvents.forum.ForumTopicClosed import dev.inmo.tgbotapi.types.message.ChatEvents.forum.ForumTopicClosed
@@ -219,3 +220,8 @@ suspend fun BehaviourContext.waitChatBoostAdded(
initRequest: Request<*>? = null, initRequest: Request<*>? = null,
errorFactory: NullableRequestBuilder<*> = { null } errorFactory: NullableRequestBuilder<*> = { null }
) = waitEvents<ChatBoostAdded>(initRequest, errorFactory) ) = waitEvents<ChatBoostAdded>(initRequest, errorFactory)
suspend fun BehaviourContext.waitChatBackgroundSet(
initRequest: Request<*>? = null,
errorFactory: NullableRequestBuilder<*> = { null }
) = waitEvents<ChatBackground>(initRequest, errorFactory)

View File

@@ -5,6 +5,7 @@ package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
import dev.inmo.tgbotapi.extensions.utils.* import dev.inmo.tgbotapi.extensions.utils.*
import dev.inmo.tgbotapi.requests.abstracts.Request import dev.inmo.tgbotapi.requests.abstracts.Request
import dev.inmo.tgbotapi.types.chat.ChatBackground
import dev.inmo.tgbotapi.types.message.ChatEvents.* import dev.inmo.tgbotapi.types.message.ChatEvents.*
import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.* import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.*
import dev.inmo.tgbotapi.types.message.ChatEvents.forum.ForumTopicClosed import dev.inmo.tgbotapi.types.message.ChatEvents.forum.ForumTopicClosed
@@ -213,3 +214,8 @@ suspend fun BehaviourContext.waitChatBoostAddedEventsMessages(
initRequest: Request<*>? = null, initRequest: Request<*>? = null,
errorFactory: NullableRequestBuilder<*> = { null } errorFactory: NullableRequestBuilder<*> = { null }
) = waitEventsMessages<ChatBoostAdded>(initRequest, errorFactory) ) = waitEventsMessages<ChatBoostAdded>(initRequest, errorFactory)
suspend fun BehaviourContext.waitChatBackgroundSetEventsMessages(
initRequest: Request<*>? = null,
errorFactory: NullableRequestBuilder<*> = { null }
) = waitEventsMessages<ChatBackground>(initRequest, errorFactory)

View File

@@ -19,15 +19,16 @@ import dev.inmo.tgbotapi.types.update.abstracts.Update
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onBusinessConnection( suspend fun <BC : BehaviourContext> BC.onBusinessConnection(
initialFilter: SimpleFilter<BusinessConnection>? = null, initialFilter: SimpleFilter<BusinessConnection>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, BusinessConnection, Update>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, BusinessConnection, Update>? = null,
markerFactory: MarkerFactory<in BusinessConnection, Any> = ByUserBusinessConnectionUpdatedMarkerFactory, markerFactory: MarkerFactory<in BusinessConnection, Any>? = ByUserBusinessConnectionUpdatedMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, BusinessConnection> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, BusinessConnection>
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) { ) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
(it.businessConnectionUpdateOrNull() ?.data) ?.let(::listOfNotNull) (it.businessConnectionUpdateOrNull() ?.data) ?.let(::listOfNotNull)
@@ -40,15 +41,16 @@ suspend fun <BC : BehaviourContext> BC.onBusinessConnection(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onBusinessConnectionEnabled( suspend fun <BC : BehaviourContext> BC.onBusinessConnectionEnabled(
initialFilter: SimpleFilter<BusinessConnection.Enabled>? = null, initialFilter: SimpleFilter<BusinessConnection.Enabled>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, BusinessConnection.Enabled, Update>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, BusinessConnection.Enabled, Update>? = null,
markerFactory: MarkerFactory<in BusinessConnection.Enabled, Any> = ByUserBusinessConnectionUpdatedMarkerFactory, markerFactory: MarkerFactory<in BusinessConnection.Enabled, Any>? = ByUserBusinessConnectionUpdatedMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, BusinessConnection.Enabled> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, BusinessConnection.Enabled>
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) { ) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
(it.businessConnectionUpdateOrNull() ?.data ?.enabledOrNull()) ?.let(::listOfNotNull) (it.businessConnectionUpdateOrNull() ?.data ?.enabledOrNull()) ?.let(::listOfNotNull)
@@ -60,15 +62,16 @@ suspend fun <BC : BehaviourContext> BC.onBusinessConnectionEnabled(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onBusinessConnectionDisabled( suspend fun <BC : BehaviourContext> BC.onBusinessConnectionDisabled(
initialFilter: SimpleFilter<BusinessConnection.Disabled>? = null, initialFilter: SimpleFilter<BusinessConnection.Disabled>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, BusinessConnection.Disabled, Update>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, BusinessConnection.Disabled, Update>? = null,
markerFactory: MarkerFactory<in BusinessConnection.Disabled, Any> = ByUserBusinessConnectionUpdatedMarkerFactory, markerFactory: MarkerFactory<in BusinessConnection.Disabled, Any>? = ByUserBusinessConnectionUpdatedMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, BusinessConnection.Disabled> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, BusinessConnection.Disabled>
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) { ) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
(it.businessConnectionUpdateOrNull() ?.data ?.disabledOrNull()) ?.let(::listOfNotNull) (it.businessConnectionUpdateOrNull() ?.data ?.disabledOrNull()) ?.let(::listOfNotNull)

View File

@@ -18,7 +18,7 @@ import kotlinx.coroutines.Job
internal suspend inline fun <BC : BehaviourContext, reified T : CallbackQuery> BC.onCallbackQuery( internal suspend inline fun <BC : BehaviourContext, reified T : CallbackQuery> BC.onCallbackQuery(
initialFilter: SimpleFilter<T>? = null, initialFilter: SimpleFilter<T>? = null,
noinline subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, T, Update>? = CallbackQueryFilterByUser, noinline subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, T, Update>? = CallbackQueryFilterByUser,
markerFactory: MarkerFactory<in T, Any> = ByUserCallbackQueryMarkerFactory, markerFactory: MarkerFactory<in T, Any>? = ByUserCallbackQueryMarkerFactory,
noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, T> noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, T>
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) { ) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
(it.callbackQueryUpdateOrNull() ?.data as? T) ?.let(::listOfNotNull) (it.callbackQueryUpdateOrNull() ?.data as? T) ?.let(::listOfNotNull)
@@ -31,15 +31,16 @@ internal suspend inline fun <BC : BehaviourContext, reified T : CallbackQuery> B
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
internal suspend inline fun <BC : BehaviourContext, reified T : DataCallbackQuery> BC.onDataCallbackQueryCounted( internal suspend inline fun <BC : BehaviourContext, reified T : DataCallbackQuery> BC.onDataCallbackQueryCounted(
initialFilter: SimpleFilter<T>? = null, initialFilter: SimpleFilter<T>? = null,
noinline subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, T, Update>? = CallbackQueryFilterByUser, noinline subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, T, Update>? = CallbackQueryFilterByUser,
markerFactory: MarkerFactory<in T, Any> = ByUserCallbackQueryMarkerFactory, markerFactory: MarkerFactory<in T, Any>? = ByUserCallbackQueryMarkerFactory,
noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, T> noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, T>
): Job { ): Job {
val newInitialFilter = SimpleFilter<DataCallbackQuery> { val newInitialFilter = SimpleFilter<DataCallbackQuery> {
@@ -73,15 +74,16 @@ internal suspend inline fun <BC : BehaviourContext, reified T : DataCallbackQuer
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onDataCallbackQuery( suspend fun <BC : BehaviourContext> BC.onDataCallbackQuery(
initialFilter: SimpleFilter<DataCallbackQuery>? = null, initialFilter: SimpleFilter<DataCallbackQuery>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, DataCallbackQuery, Update>? = CallbackQueryFilterByUser, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, DataCallbackQuery, Update>? = CallbackQueryFilterByUser,
markerFactory: MarkerFactory<in DataCallbackQuery, Any> = ByUserCallbackQueryMarkerFactory, markerFactory: MarkerFactory<in DataCallbackQuery, Any>? = ByUserCallbackQueryMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, DataCallbackQuery> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, DataCallbackQuery>
) = onDataCallbackQueryCounted( ) = onDataCallbackQueryCounted(
initialFilter, initialFilter,
@@ -99,8 +101,9 @@ suspend fun <BC : BehaviourContext> BC.onDataCallbackQuery(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
@@ -108,7 +111,7 @@ suspend fun <BC : BehaviourContext> BC.onDataCallbackQuery(
dataRegex: Regex, dataRegex: Regex,
initialFilter: SimpleFilter<DataCallbackQuery>? = null, initialFilter: SimpleFilter<DataCallbackQuery>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, DataCallbackQuery, Update>? = CallbackQueryFilterByUser, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, DataCallbackQuery, Update>? = CallbackQueryFilterByUser,
markerFactory: MarkerFactory<in DataCallbackQuery, Any> = ByUserCallbackQueryMarkerFactory, markerFactory: MarkerFactory<in DataCallbackQuery, Any>? = ByUserCallbackQueryMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, DataCallbackQuery> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, DataCallbackQuery>
) = onDataCallbackQuery( ) = onDataCallbackQuery(
initialFilter = initialFilter * { initialFilter = initialFilter * {
@@ -127,8 +130,9 @@ suspend fun <BC : BehaviourContext> BC.onDataCallbackQuery(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
@@ -136,7 +140,7 @@ suspend fun <BC : BehaviourContext> BC.onDataCallbackQuery(
data: String, data: String,
initialFilter: SimpleFilter<DataCallbackQuery>? = null, initialFilter: SimpleFilter<DataCallbackQuery>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, DataCallbackQuery, Update>? = CallbackQueryFilterByUser, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, DataCallbackQuery, Update>? = CallbackQueryFilterByUser,
markerFactory: MarkerFactory<in DataCallbackQuery, Any> = ByUserCallbackQueryMarkerFactory, markerFactory: MarkerFactory<in DataCallbackQuery, Any>? = ByUserCallbackQueryMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, DataCallbackQuery> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, DataCallbackQuery>
) = onDataCallbackQuery( ) = onDataCallbackQuery(
Regex(data), Regex(data),
@@ -153,15 +157,16 @@ suspend fun <BC : BehaviourContext> BC.onDataCallbackQuery(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onGameShortNameCallbackQuery( suspend fun <BC : BehaviourContext> BC.onGameShortNameCallbackQuery(
initialFilter: SimpleFilter<GameShortNameCallbackQuery>? = null, initialFilter: SimpleFilter<GameShortNameCallbackQuery>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, GameShortNameCallbackQuery, Update>? = CallbackQueryFilterByUser, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, GameShortNameCallbackQuery, Update>? = CallbackQueryFilterByUser,
markerFactory: MarkerFactory<in GameShortNameCallbackQuery, Any> = ByUserCallbackQueryMarkerFactory, markerFactory: MarkerFactory<in GameShortNameCallbackQuery, Any>? = ByUserCallbackQueryMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, GameShortNameCallbackQuery> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, GameShortNameCallbackQuery>
) = onCallbackQuery( ) = onCallbackQuery(
initialFilter, initialFilter,
@@ -177,15 +182,16 @@ suspend fun <BC : BehaviourContext> BC.onGameShortNameCallbackQuery(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onInlineMessageIdCallbackQuery( suspend fun <BC : BehaviourContext> BC.onInlineMessageIdCallbackQuery(
initialFilter: SimpleFilter<InlineMessageIdCallbackQuery>? = null, initialFilter: SimpleFilter<InlineMessageIdCallbackQuery>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, InlineMessageIdCallbackQuery, Update>? = CallbackQueryFilterByUser, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, InlineMessageIdCallbackQuery, Update>? = CallbackQueryFilterByUser,
markerFactory: MarkerFactory<in InlineMessageIdCallbackQuery, Any> = ByUserCallbackQueryMarkerFactory, markerFactory: MarkerFactory<in InlineMessageIdCallbackQuery, Any>? = ByUserCallbackQueryMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, InlineMessageIdCallbackQuery> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, InlineMessageIdCallbackQuery>
) = onCallbackQuery( ) = onCallbackQuery(
initialFilter, initialFilter,
@@ -201,15 +207,16 @@ suspend fun <BC : BehaviourContext> BC.onInlineMessageIdCallbackQuery(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onInlineMessageIdDataCallbackQuery( suspend fun <BC : BehaviourContext> BC.onInlineMessageIdDataCallbackQuery(
initialFilter: SimpleFilter<InlineMessageIdDataCallbackQuery>? = null, initialFilter: SimpleFilter<InlineMessageIdDataCallbackQuery>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, InlineMessageIdDataCallbackQuery, Update>? = CallbackQueryFilterByUser, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, InlineMessageIdDataCallbackQuery, Update>? = CallbackQueryFilterByUser,
markerFactory: MarkerFactory<in InlineMessageIdDataCallbackQuery, Any> = ByUserCallbackQueryMarkerFactory, markerFactory: MarkerFactory<in InlineMessageIdDataCallbackQuery, Any>? = ByUserCallbackQueryMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, InlineMessageIdDataCallbackQuery> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, InlineMessageIdDataCallbackQuery>
) = onDataCallbackQueryCounted( ) = onDataCallbackQueryCounted(
initialFilter, initialFilter,
@@ -227,8 +234,9 @@ suspend fun <BC : BehaviourContext> BC.onInlineMessageIdDataCallbackQuery(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
@@ -236,7 +244,7 @@ suspend fun <BC : BehaviourContext> BC.onInlineMessageIdDataCallbackQuery(
dataRegex: Regex, dataRegex: Regex,
initialFilter: SimpleFilter<InlineMessageIdDataCallbackQuery>? = null, initialFilter: SimpleFilter<InlineMessageIdDataCallbackQuery>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, InlineMessageIdDataCallbackQuery, Update>? = CallbackQueryFilterByUser, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, InlineMessageIdDataCallbackQuery, Update>? = CallbackQueryFilterByUser,
markerFactory: MarkerFactory<in InlineMessageIdDataCallbackQuery, Any> = ByUserCallbackQueryMarkerFactory, markerFactory: MarkerFactory<in InlineMessageIdDataCallbackQuery, Any>? = ByUserCallbackQueryMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, InlineMessageIdDataCallbackQuery> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, InlineMessageIdDataCallbackQuery>
) = onInlineMessageIdDataCallbackQuery( ) = onInlineMessageIdDataCallbackQuery(
initialFilter = initialFilter * { initialFilter = initialFilter * {
@@ -255,8 +263,9 @@ suspend fun <BC : BehaviourContext> BC.onInlineMessageIdDataCallbackQuery(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
@@ -264,7 +273,7 @@ suspend fun <BC : BehaviourContext> BC.onInlineMessageIdDataCallbackQuery(
data: String, data: String,
initialFilter: SimpleFilter<InlineMessageIdDataCallbackQuery>? = null, initialFilter: SimpleFilter<InlineMessageIdDataCallbackQuery>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, InlineMessageIdDataCallbackQuery, Update>? = CallbackQueryFilterByUser, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, InlineMessageIdDataCallbackQuery, Update>? = CallbackQueryFilterByUser,
markerFactory: MarkerFactory<in InlineMessageIdDataCallbackQuery, Any> = ByUserCallbackQueryMarkerFactory, markerFactory: MarkerFactory<in InlineMessageIdDataCallbackQuery, Any>? = ByUserCallbackQueryMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, InlineMessageIdDataCallbackQuery> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, InlineMessageIdDataCallbackQuery>
) = onInlineMessageIdDataCallbackQuery( ) = onInlineMessageIdDataCallbackQuery(
Regex(data), Regex(data),
@@ -281,15 +290,16 @@ suspend fun <BC : BehaviourContext> BC.onInlineMessageIdDataCallbackQuery(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onInlineMessageIdGameShortNameCallbackQuery( suspend fun <BC : BehaviourContext> BC.onInlineMessageIdGameShortNameCallbackQuery(
initialFilter: SimpleFilter<InlineMessageIdGameShortNameCallbackQuery>? = null, initialFilter: SimpleFilter<InlineMessageIdGameShortNameCallbackQuery>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, InlineMessageIdGameShortNameCallbackQuery, Update>? = CallbackQueryFilterByUser, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, InlineMessageIdGameShortNameCallbackQuery, Update>? = CallbackQueryFilterByUser,
markerFactory: MarkerFactory<in InlineMessageIdGameShortNameCallbackQuery, Any> = ByUserCallbackQueryMarkerFactory, markerFactory: MarkerFactory<in InlineMessageIdGameShortNameCallbackQuery, Any>? = ByUserCallbackQueryMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, InlineMessageIdGameShortNameCallbackQuery> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, InlineMessageIdGameShortNameCallbackQuery>
) = onCallbackQuery( ) = onCallbackQuery(
initialFilter, initialFilter,
@@ -305,15 +315,16 @@ suspend fun <BC : BehaviourContext> BC.onInlineMessageIdGameShortNameCallbackQue
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onMessageCallbackQuery( suspend fun <BC : BehaviourContext> BC.onMessageCallbackQuery(
initialFilter: SimpleFilter<MessageCallbackQuery>? = null, initialFilter: SimpleFilter<MessageCallbackQuery>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MessageCallbackQuery, Update>? = CallbackQueryFilterByUser, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MessageCallbackQuery, Update>? = CallbackQueryFilterByUser,
markerFactory: MarkerFactory<in MessageCallbackQuery, Any> = ByUserCallbackQueryMarkerFactory, markerFactory: MarkerFactory<in MessageCallbackQuery, Any>? = ByUserCallbackQueryMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MessageCallbackQuery> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MessageCallbackQuery>
) = onCallbackQuery( ) = onCallbackQuery(
initialFilter, initialFilter,
@@ -329,15 +340,16 @@ suspend fun <BC : BehaviourContext> BC.onMessageCallbackQuery(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onMessageDataCallbackQuery( suspend fun <BC : BehaviourContext> BC.onMessageDataCallbackQuery(
initialFilter: SimpleFilter<MessageDataCallbackQuery>? = null, initialFilter: SimpleFilter<MessageDataCallbackQuery>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MessageDataCallbackQuery, Update>? = CallbackQueryFilterByUser, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MessageDataCallbackQuery, Update>? = CallbackQueryFilterByUser,
markerFactory: MarkerFactory<in MessageDataCallbackQuery, Any> = ByUserCallbackQueryMarkerFactory, markerFactory: MarkerFactory<in MessageDataCallbackQuery, Any>? = ByUserCallbackQueryMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MessageDataCallbackQuery> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MessageDataCallbackQuery>
) = onDataCallbackQueryCounted( ) = onDataCallbackQueryCounted(
initialFilter, initialFilter,
@@ -355,8 +367,9 @@ suspend fun <BC : BehaviourContext> BC.onMessageDataCallbackQuery(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
@@ -364,7 +377,7 @@ suspend fun <BC : BehaviourContext> BC.onMessageDataCallbackQuery(
dataRegex: Regex, dataRegex: Regex,
initialFilter: SimpleFilter<MessageDataCallbackQuery>? = null, initialFilter: SimpleFilter<MessageDataCallbackQuery>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MessageDataCallbackQuery, Update>? = CallbackQueryFilterByUser, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MessageDataCallbackQuery, Update>? = CallbackQueryFilterByUser,
markerFactory: MarkerFactory<in MessageDataCallbackQuery, Any> = ByUserCallbackQueryMarkerFactory, markerFactory: MarkerFactory<in MessageDataCallbackQuery, Any>? = ByUserCallbackQueryMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MessageDataCallbackQuery> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MessageDataCallbackQuery>
) = onMessageDataCallbackQuery( ) = onMessageDataCallbackQuery(
initialFilter = initialFilter * { initialFilter = initialFilter * {
@@ -383,8 +396,9 @@ suspend fun <BC : BehaviourContext> BC.onMessageDataCallbackQuery(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
@@ -392,7 +406,7 @@ suspend fun <BC : BehaviourContext> BC.onMessageDataCallbackQuery(
data: String, data: String,
initialFilter: SimpleFilter<MessageDataCallbackQuery>? = null, initialFilter: SimpleFilter<MessageDataCallbackQuery>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MessageDataCallbackQuery, Update>? = CallbackQueryFilterByUser, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MessageDataCallbackQuery, Update>? = CallbackQueryFilterByUser,
markerFactory: MarkerFactory<in MessageDataCallbackQuery, Any> = ByUserCallbackQueryMarkerFactory, markerFactory: MarkerFactory<in MessageDataCallbackQuery, Any>? = ByUserCallbackQueryMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MessageDataCallbackQuery> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MessageDataCallbackQuery>
) = onMessageDataCallbackQuery( ) = onMessageDataCallbackQuery(
Regex(data), Regex(data),
@@ -409,15 +423,16 @@ suspend fun <BC : BehaviourContext> BC.onMessageDataCallbackQuery(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onMessageGameShortNameCallbackQuery( suspend fun <BC : BehaviourContext> BC.onMessageGameShortNameCallbackQuery(
initialFilter: SimpleFilter<MessageGameShortNameCallbackQuery>? = null, initialFilter: SimpleFilter<MessageGameShortNameCallbackQuery>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MessageGameShortNameCallbackQuery, Update>? = CallbackQueryFilterByUser, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MessageGameShortNameCallbackQuery, Update>? = CallbackQueryFilterByUser,
markerFactory: MarkerFactory<in MessageGameShortNameCallbackQuery, Any> = ByUserCallbackQueryMarkerFactory, markerFactory: MarkerFactory<in MessageGameShortNameCallbackQuery, Any>? = ByUserCallbackQueryMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MessageGameShortNameCallbackQuery> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MessageGameShortNameCallbackQuery>
) = onCallbackQuery( ) = onCallbackQuery(
initialFilter, initialFilter,
@@ -433,15 +448,16 @@ suspend fun <BC : BehaviourContext> BC.onMessageGameShortNameCallbackQuery(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onUnknownCallbackQueryType( suspend fun <BC : BehaviourContext> BC.onUnknownCallbackQueryType(
initialFilter: SimpleFilter<UnknownCallbackQueryType>? = null, initialFilter: SimpleFilter<UnknownCallbackQueryType>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, UnknownCallbackQueryType, Update>? = CallbackQueryFilterByUser, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, UnknownCallbackQueryType, Update>? = CallbackQueryFilterByUser,
markerFactory: MarkerFactory<in UnknownCallbackQueryType, Any> = ByUserCallbackQueryMarkerFactory, markerFactory: MarkerFactory<in UnknownCallbackQueryType, Any>? = ByUserCallbackQueryMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, UnknownCallbackQueryType> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, UnknownCallbackQueryType>
) = onCallbackQuery( ) = onCallbackQuery(
initialFilter, initialFilter,

View File

@@ -18,8 +18,9 @@ import dev.inmo.tgbotapi.utils.PreviewFeature
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
@@ -27,7 +28,7 @@ import dev.inmo.tgbotapi.utils.PreviewFeature
suspend fun <BC : BehaviourContext> BC.onUnhandledDataCallbackQuery( suspend fun <BC : BehaviourContext> BC.onUnhandledDataCallbackQuery(
initialFilter: SimpleFilter<DataCallbackQuery>? = null, initialFilter: SimpleFilter<DataCallbackQuery>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, DataCallbackQuery, Update>? = CallbackQueryFilterByUser, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, DataCallbackQuery, Update>? = CallbackQueryFilterByUser,
markerFactory: MarkerFactory<in DataCallbackQuery, Any> = ByUserCallbackQueryMarkerFactory, markerFactory: MarkerFactory<in DataCallbackQuery, Any>? = ByUserCallbackQueryMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, DataCallbackQuery> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, DataCallbackQuery>
) = onCallbackQuery ( ) = onCallbackQuery (
initialFilter * !SimpleFilter<MessageDataCallbackQuery> { triggersHolder.handleableCallbackQueriesDataHolder.isHandled(it) }, initialFilter * !SimpleFilter<MessageDataCallbackQuery> { triggersHolder.handleableCallbackQueriesDataHolder.isHandled(it) },
@@ -43,8 +44,9 @@ suspend fun <BC : BehaviourContext> BC.onUnhandledDataCallbackQuery(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
@@ -52,7 +54,7 @@ suspend fun <BC : BehaviourContext> BC.onUnhandledDataCallbackQuery(
suspend fun <BC : BehaviourContext> BC.onUnhandledInlineMessageIdDataCallbackQuery( suspend fun <BC : BehaviourContext> BC.onUnhandledInlineMessageIdDataCallbackQuery(
initialFilter: SimpleFilter<InlineMessageIdDataCallbackQuery>? = null, initialFilter: SimpleFilter<InlineMessageIdDataCallbackQuery>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, InlineMessageIdDataCallbackQuery, Update>? = CallbackQueryFilterByUser, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, InlineMessageIdDataCallbackQuery, Update>? = CallbackQueryFilterByUser,
markerFactory: MarkerFactory<in InlineMessageIdDataCallbackQuery, Any> = ByUserCallbackQueryMarkerFactory, markerFactory: MarkerFactory<in InlineMessageIdDataCallbackQuery, Any>? = ByUserCallbackQueryMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, InlineMessageIdDataCallbackQuery> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, InlineMessageIdDataCallbackQuery>
) = onCallbackQuery ( ) = onCallbackQuery (
initialFilter * !SimpleFilter<InlineMessageIdDataCallbackQuery> { triggersHolder.handleableCallbackQueriesDataHolder.isHandled(it) }, initialFilter * !SimpleFilter<InlineMessageIdDataCallbackQuery> { triggersHolder.handleableCallbackQueriesDataHolder.isHandled(it) },
@@ -68,8 +70,9 @@ suspend fun <BC : BehaviourContext> BC.onUnhandledInlineMessageIdDataCallbackQue
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
@@ -77,7 +80,7 @@ suspend fun <BC : BehaviourContext> BC.onUnhandledInlineMessageIdDataCallbackQue
suspend fun <BC : BehaviourContext> BC.onUnhandledMessageDataCallbackQuery( suspend fun <BC : BehaviourContext> BC.onUnhandledMessageDataCallbackQuery(
initialFilter: SimpleFilter<MessageDataCallbackQuery>? = null, initialFilter: SimpleFilter<MessageDataCallbackQuery>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MessageDataCallbackQuery, Update>? = CallbackQueryFilterByUser, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MessageDataCallbackQuery, Update>? = CallbackQueryFilterByUser,
markerFactory: MarkerFactory<in MessageDataCallbackQuery, Any> = ByUserCallbackQueryMarkerFactory, markerFactory: MarkerFactory<in MessageDataCallbackQuery, Any>? = ByUserCallbackQueryMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MessageDataCallbackQuery> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MessageDataCallbackQuery>
) = onCallbackQuery( ) = onCallbackQuery(
initialFilter * !SimpleFilter<MessageDataCallbackQuery> { triggersHolder.handleableCallbackQueriesDataHolder.isHandled(it) }, initialFilter * !SimpleFilter<MessageDataCallbackQuery> { triggersHolder.handleableCallbackQueriesDataHolder.isHandled(it) },

View File

@@ -19,15 +19,16 @@ import dev.inmo.tgbotapi.types.update.abstracts.Update
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onChatBoostRemoved( suspend fun <BC : BehaviourContext> BC.onChatBoostRemoved(
initialFilter: SimpleFilter<ChatBoostRemoved>? = null, initialFilter: SimpleFilter<ChatBoostRemoved>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatBoostRemoved, Update>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatBoostRemoved, Update>? = null,
markerFactory: MarkerFactory<ChatBoostRemoved, Any> = ByIdChatBoostRemovedMarkerFactory, markerFactory: MarkerFactory<ChatBoostRemoved, Any>? = ByIdChatBoostRemovedMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatBoostRemoved> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatBoostRemoved>
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) { ) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
(it.chatBoostRemovedUpdateOrNull() ?.data) ?.let(::listOfNotNull) (it.chatBoostRemovedUpdateOrNull() ?.data) ?.let(::listOfNotNull)

View File

@@ -19,15 +19,16 @@ import dev.inmo.tgbotapi.types.update.abstracts.Update
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onChatBoostUpdated( suspend fun <BC : BehaviourContext> BC.onChatBoostUpdated(
initialFilter: SimpleFilter<ChatBoostUpdated>? = null, initialFilter: SimpleFilter<ChatBoostUpdated>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatBoostUpdated, Update>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatBoostUpdated, Update>? = null,
markerFactory: MarkerFactory<ChatBoostUpdated, Any> = ByIdChatBoostUpdatedMarkerFactory, markerFactory: MarkerFactory<ChatBoostUpdated, Any>? = ByIdChatBoostUpdatedMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatBoostUpdated> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatBoostUpdated>
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) { ) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
(it.chatBoostUpdatedUpdateOrNull() ?.data) ?.let(::listOfNotNull) (it.chatBoostUpdatedUpdateOrNull() ?.data) ?.let(::listOfNotNull)

View File

@@ -17,15 +17,16 @@ import dev.inmo.tgbotapi.types.update.abstracts.Update
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onChatJoinRequest( suspend fun <BC : BehaviourContext> BC.onChatJoinRequest(
initialFilter: SimpleFilter<ChatJoinRequest>? = null, initialFilter: SimpleFilter<ChatJoinRequest>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatJoinRequest, Update>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatJoinRequest, Update>? = null,
markerFactory: MarkerFactory<in ChatJoinRequest, Any> = ByChatChatJoinRequestMarkerFactory, markerFactory: MarkerFactory<in ChatJoinRequest, Any>? = ByChatChatJoinRequestMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatJoinRequest> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatJoinRequest>
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) { ) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
(it.chatJoinRequestUpdateOrNull() ?.data) ?.let(::listOfNotNull) (it.chatJoinRequestUpdateOrNull() ?.data) ?.let(::listOfNotNull)

View File

@@ -17,7 +17,7 @@ import dev.inmo.tgbotapi.types.update.abstracts.Update
internal suspend inline fun <BC : BehaviourContext, reified U : ChatMemberUpdatedUpdate> BC.onChatMemberUpdatedInternal( internal suspend inline fun <BC : BehaviourContext, reified U : ChatMemberUpdatedUpdate> BC.onChatMemberUpdatedInternal(
initialFilter: SimpleFilter<ChatMemberUpdated>? = null, initialFilter: SimpleFilter<ChatMemberUpdated>? = null,
noinline subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatMemberUpdated, Update>? = ChatMemberUpdatedFilterByChat, noinline subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatMemberUpdated, Update>? = ChatMemberUpdatedFilterByChat,
markerFactory: MarkerFactory<ChatMemberUpdated, Any> = ByChatChatMemberUpdatedMarkerFactory, markerFactory: MarkerFactory<ChatMemberUpdated, Any>? = ByChatChatMemberUpdatedMarkerFactory,
noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatMemberUpdated> noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatMemberUpdated>
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) { ) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
((it as? U) ?.data) ?.let(::listOfNotNull) ((it as? U) ?.data) ?.let(::listOfNotNull)
@@ -31,15 +31,16 @@ internal suspend inline fun <BC : BehaviourContext, reified U : ChatMemberUpdate
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onChatMemberUpdated( suspend fun <BC : BehaviourContext> BC.onChatMemberUpdated(
initialFilter: SimpleFilter<ChatMemberUpdated>? = null, initialFilter: SimpleFilter<ChatMemberUpdated>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatMemberUpdated, Update>? = ChatMemberUpdatedFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatMemberUpdated, Update>? = ChatMemberUpdatedFilterByChat,
markerFactory: MarkerFactory<ChatMemberUpdated, Any> = ByChatChatMemberUpdatedMarkerFactory, markerFactory: MarkerFactory<ChatMemberUpdated, Any>? = ByChatChatMemberUpdatedMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatMemberUpdated> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatMemberUpdated>
) = onChatMemberUpdatedInternal<BC, ChatMemberUpdatedUpdate>( ) = onChatMemberUpdatedInternal<BC, ChatMemberUpdatedUpdate>(
initialFilter, initialFilter,
@@ -55,15 +56,16 @@ suspend fun <BC : BehaviourContext> BC.onChatMemberUpdated(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onCommonChatMemberUpdated( suspend fun <BC : BehaviourContext> BC.onCommonChatMemberUpdated(
initialFilter: SimpleFilter<ChatMemberUpdated>? = null, initialFilter: SimpleFilter<ChatMemberUpdated>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatMemberUpdated, Update>? = ChatMemberUpdatedFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatMemberUpdated, Update>? = ChatMemberUpdatedFilterByChat,
markerFactory: MarkerFactory<ChatMemberUpdated, Any> = ByChatChatMemberUpdatedMarkerFactory, markerFactory: MarkerFactory<ChatMemberUpdated, Any>? = ByChatChatMemberUpdatedMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatMemberUpdated> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatMemberUpdated>
) = onChatMemberUpdatedInternal<BC, CommonChatMemberUpdatedUpdate>( ) = onChatMemberUpdatedInternal<BC, CommonChatMemberUpdatedUpdate>(
initialFilter, initialFilter,
@@ -79,15 +81,16 @@ suspend fun <BC : BehaviourContext> BC.onCommonChatMemberUpdated(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onMyChatMemberUpdated( suspend fun <BC : BehaviourContext> BC.onMyChatMemberUpdated(
initialFilter: SimpleFilter<ChatMemberUpdated>? = null, initialFilter: SimpleFilter<ChatMemberUpdated>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatMemberUpdated, Update>? = ChatMemberUpdatedFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatMemberUpdated, Update>? = ChatMemberUpdatedFilterByChat,
markerFactory: MarkerFactory<ChatMemberUpdated, Any> = ByChatChatMemberUpdatedMarkerFactory, markerFactory: MarkerFactory<ChatMemberUpdated, Any>? = ByChatChatMemberUpdatedMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatMemberUpdated> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatMemberUpdated>
) = onChatMemberUpdatedInternal<BC, MyChatMemberUpdatedUpdate>( ) = onChatMemberUpdatedInternal<BC, MyChatMemberUpdatedUpdate>(
initialFilter, initialFilter,

View File

@@ -23,15 +23,16 @@ import dev.inmo.tgbotapi.types.update.abstracts.Update
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onChatMessageReactionsCountUpdated( suspend fun <BC : BehaviourContext> BC.onChatMessageReactionsCountUpdated(
initialFilter: SimpleFilter<ChatMessageReactionsCountUpdated>? = null, initialFilter: SimpleFilter<ChatMessageReactionsCountUpdated>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatMessageReactionsCountUpdated, Update>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatMessageReactionsCountUpdated, Update>? = null,
markerFactory: MarkerFactory<ChatMessageReactionsCountUpdated, Any> = ByChatIdChatMessageReactionsCountUpdatedMarkerFactory, markerFactory: MarkerFactory<ChatMessageReactionsCountUpdated, Any>? = ByChatIdChatMessageReactionsCountUpdatedMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatMessageReactionsCountUpdated> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatMessageReactionsCountUpdated>
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) { ) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
(it.chatMessageReactionsCountUpdatedUpdateOrNull() ?.data) ?.let(::listOfNotNull) (it.chatMessageReactionsCountUpdatedUpdateOrNull() ?.data) ?.let(::listOfNotNull)

View File

@@ -15,7 +15,7 @@ import dev.inmo.tgbotapi.types.update.abstracts.Update
internal suspend inline fun <BC : BehaviourContext, reified T : ChatMessageReactionUpdated> BC.onChatMessageReactionUpdated( internal suspend inline fun <BC : BehaviourContext, reified T : ChatMessageReactionUpdated> BC.onChatMessageReactionUpdated(
initialFilter: SimpleFilter<T>? = null, initialFilter: SimpleFilter<T>? = null,
noinline subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, T, Update>? = null, noinline subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, T, Update>? = null,
markerFactory: MarkerFactory<in T, Any> = ByChatIdChatMessageReactionUpdatedMarkerFactory, markerFactory: MarkerFactory<in T, Any>? = ByChatIdChatMessageReactionUpdatedMarkerFactory,
noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, T> noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, T>
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) { ) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
(it.chatMessageReactionUpdatedUpdateOrNull() ?.data as? T) ?.let(::listOfNotNull) (it.chatMessageReactionUpdatedUpdateOrNull() ?.data as? T) ?.let(::listOfNotNull)
@@ -28,15 +28,16 @@ internal suspend inline fun <BC : BehaviourContext, reified T : ChatMessageReact
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onChatMessageReactionUpdatedByUser( suspend fun <BC : BehaviourContext> BC.onChatMessageReactionUpdatedByUser(
initialFilter: SimpleFilter<ChatMessageReactionUpdated.ByUser>? = null, initialFilter: SimpleFilter<ChatMessageReactionUpdated.ByUser>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatMessageReactionUpdated.ByUser, Update>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatMessageReactionUpdated.ByUser, Update>? = null,
markerFactory: MarkerFactory<in ChatMessageReactionUpdated.ByUser, Any> = ByChatIdChatMessageReactionUpdatedMarkerFactory, markerFactory: MarkerFactory<in ChatMessageReactionUpdated.ByUser, Any>? = ByChatIdChatMessageReactionUpdatedMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatMessageReactionUpdated.ByUser> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatMessageReactionUpdated.ByUser>
) = onChatMessageReactionUpdated( ) = onChatMessageReactionUpdated(
initialFilter, initialFilter,
@@ -52,15 +53,16 @@ suspend fun <BC : BehaviourContext> BC.onChatMessageReactionUpdatedByUser(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onChatMessageReactionUpdatedByChat( suspend fun <BC : BehaviourContext> BC.onChatMessageReactionUpdatedByChat(
initialFilter: SimpleFilter<ChatMessageReactionUpdated.ByChat>? = null, initialFilter: SimpleFilter<ChatMessageReactionUpdated.ByChat>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatMessageReactionUpdated.ByChat, Update>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatMessageReactionUpdated.ByChat, Update>? = null,
markerFactory: MarkerFactory<in ChatMessageReactionUpdated.ByChat, Any> = ByChatIdChatMessageReactionUpdatedMarkerFactory, markerFactory: MarkerFactory<in ChatMessageReactionUpdated.ByChat, Any>? = ByChatIdChatMessageReactionUpdatedMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatMessageReactionUpdated.ByChat> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatMessageReactionUpdated.ByChat>
) = onChatMessageReactionUpdated( ) = onChatMessageReactionUpdated(
initialFilter, initialFilter,
@@ -76,15 +78,16 @@ suspend fun <BC : BehaviourContext> BC.onChatMessageReactionUpdatedByChat(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onChatMessageReactionUpdatedUnknown( suspend fun <BC : BehaviourContext> BC.onChatMessageReactionUpdatedUnknown(
initialFilter: SimpleFilter<ChatMessageReactionUpdated.Unknown>? = null, initialFilter: SimpleFilter<ChatMessageReactionUpdated.Unknown>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatMessageReactionUpdated.Unknown, Update>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatMessageReactionUpdated.Unknown, Update>? = null,
markerFactory: MarkerFactory<in ChatMessageReactionUpdated.Unknown, Any> = ByChatIdChatMessageReactionUpdatedMarkerFactory, markerFactory: MarkerFactory<in ChatMessageReactionUpdated.Unknown, Any>? = ByChatIdChatMessageReactionUpdatedMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatMessageReactionUpdated.Unknown> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatMessageReactionUpdated.Unknown>
) = onChatMessageReactionUpdated( ) = onChatMessageReactionUpdated(
initialFilter, initialFilter,

View File

@@ -13,7 +13,7 @@ import dev.inmo.tgbotapi.types.update.abstracts.Update
internal suspend inline fun <BC : BehaviourContext, reified T : ChosenInlineResult> BC.onChosenInlineResultBase( internal suspend inline fun <BC : BehaviourContext, reified T : ChosenInlineResult> BC.onChosenInlineResultBase(
initialFilter: SimpleFilter<T>? = null, initialFilter: SimpleFilter<T>? = null,
noinline subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, T, Update>? = null, noinline subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, T, Update>? = null,
markerFactory: MarkerFactory<in T, Any> = ByUserIdChosenInlineResultMarkerFactory, markerFactory: MarkerFactory<in T, Any>? = ByUserIdChosenInlineResultMarkerFactory,
noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, T> noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, T>
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) { ) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
(it.chosenInlineResultUpdateOrNull() ?.data as? T) ?.let(::listOfNotNull) (it.chosenInlineResultUpdateOrNull() ?.data as? T) ?.let(::listOfNotNull)
@@ -26,15 +26,16 @@ internal suspend inline fun <BC : BehaviourContext, reified T : ChosenInlineResu
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onChosenInlineResult( suspend fun <BC : BehaviourContext> BC.onChosenInlineResult(
initialFilter: SimpleFilter<ChosenInlineResult>? = null, initialFilter: SimpleFilter<ChosenInlineResult>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChosenInlineResult, Update>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChosenInlineResult, Update>? = null,
markerFactory: MarkerFactory<in ChosenInlineResult, Any> = ByUserIdChosenInlineResultMarkerFactory, markerFactory: MarkerFactory<in ChosenInlineResult, Any>? = ByUserIdChosenInlineResultMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChosenInlineResult> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChosenInlineResult>
) = onChosenInlineResultBase( ) = onChosenInlineResultBase(
initialFilter, initialFilter,
@@ -50,15 +51,16 @@ suspend fun <BC : BehaviourContext> BC.onChosenInlineResult(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onLocationChosenInlineResult( suspend fun <BC : BehaviourContext> BC.onLocationChosenInlineResult(
initialFilter: SimpleFilter<LocationChosenInlineResult>? = null, initialFilter: SimpleFilter<LocationChosenInlineResult>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, LocationChosenInlineResult, Update>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, LocationChosenInlineResult, Update>? = null,
markerFactory: MarkerFactory<in LocationChosenInlineResult, Any> = ByUserIdChosenInlineResultMarkerFactory, markerFactory: MarkerFactory<in LocationChosenInlineResult, Any>? = ByUserIdChosenInlineResultMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, LocationChosenInlineResult> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, LocationChosenInlineResult>
) = onChosenInlineResultBase( ) = onChosenInlineResultBase(
initialFilter, initialFilter,
@@ -74,15 +76,16 @@ suspend fun <BC : BehaviourContext> BC.onLocationChosenInlineResult(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onBaseChosenInlineResult( suspend fun <BC : BehaviourContext> BC.onBaseChosenInlineResult(
initialFilter: SimpleFilter<BaseChosenInlineResult>? = null, initialFilter: SimpleFilter<BaseChosenInlineResult>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, BaseChosenInlineResult, Update>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, BaseChosenInlineResult, Update>? = null,
markerFactory: MarkerFactory<in BaseChosenInlineResult, Any> = ByUserIdChosenInlineResultMarkerFactory, markerFactory: MarkerFactory<in BaseChosenInlineResult, Any>? = ByUserIdChosenInlineResultMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, BaseChosenInlineResult> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, BaseChosenInlineResult>
) = onChosenInlineResultBase( ) = onChosenInlineResultBase(
initialFilter, initialFilter,

View File

@@ -25,7 +25,7 @@ internal suspend fun <BC : BehaviourContext> BC.commandUncounted(
requireOnlyCommandInMessage: Boolean = true, requireOnlyCommandInMessage: Boolean = true,
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups, initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in TextMessage, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage>
): Job = onText( ): Job = onText(
CommonMessageFilter<TextContent> { message -> CommonMessageFilter<TextContent> { message ->
@@ -52,7 +52,7 @@ suspend fun <BC : BehaviourContext> BC.command(
requireOnlyCommandInMessage: Boolean = true, requireOnlyCommandInMessage: Boolean = true,
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups, initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in TextMessage, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage>
): Job = runCatchingSafely { ): Job = runCatchingSafely {
commandUncounted( commandUncounted(
@@ -76,56 +76,86 @@ suspend fun <BC : BehaviourContext> BC.command(
} }
}.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( suspend fun <BC : BehaviourContext> BC.command(
command: String, command: String,
requireOnlyCommandInMessage: Boolean = true, requireOnlyCommandInMessage: Boolean = true,
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups, initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in TextMessage, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage>
) = command(command.toRegex(), requireOnlyCommandInMessage, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = command(command.toRegex(), requireOnlyCommandInMessage, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
/**
* @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( suspend fun <BC : BehaviourContext> BC.command(
botCommand: BotCommand, botCommand: BotCommand,
requireOnlyCommandInMessage: Boolean = true, requireOnlyCommandInMessage: Boolean = true,
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups, initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in TextMessage, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage>
) = command(botCommand.command, requireOnlyCommandInMessage, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = command(botCommand.command, requireOnlyCommandInMessage, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
/**
* @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.onCommand( suspend fun <BC : BehaviourContext> BC.onCommand(
commandRegex: Regex, commandRegex: Regex,
requireOnlyCommandInMessage: Boolean = true, requireOnlyCommandInMessage: Boolean = true,
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups, initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in TextMessage, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage>
): Job = command(commandRegex, requireOnlyCommandInMessage, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ): Job = command(commandRegex, requireOnlyCommandInMessage, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
/**
* @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.onCommand( suspend fun <BC : BehaviourContext> BC.onCommand(
command: String, command: String,
requireOnlyCommandInMessage: Boolean = true, requireOnlyCommandInMessage: Boolean = true,
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups, initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in TextMessage, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage>
): Job = onCommand(command.toRegex(), requireOnlyCommandInMessage, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ): Job = onCommand(command.toRegex(), requireOnlyCommandInMessage, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
/**
* @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.onCommand( suspend fun <BC : BehaviourContext> BC.onCommand(
botCommand: BotCommand, botCommand: BotCommand,
requireOnlyCommandInMessage: Boolean = true, requireOnlyCommandInMessage: Boolean = true,
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups, initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in TextMessage, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage>
): Job = onCommand(botCommand.command, requireOnlyCommandInMessage, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ): Job = onCommand(botCommand.command, requireOnlyCommandInMessage, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
/**
* @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.commandWithArgs( suspend fun <BC : BehaviourContext> BC.commandWithArgs(
commandRegex: Regex, commandRegex: Regex,
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups, initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in TextMessage, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex, argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>> scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>>
) = command( ) = command(
@@ -142,11 +172,16 @@ suspend fun <BC : BehaviourContext> BC.commandWithArgs(
scenarioReceiver(it, args) scenarioReceiver(it, args)
} }
/**
* @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.commandWithArgs( suspend fun <BC : BehaviourContext> BC.commandWithArgs(
command: String, command: String,
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups, initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in TextMessage, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex, argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>> scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>>
) = commandWithArgs( ) = commandWithArgs(
@@ -158,11 +193,16 @@ suspend fun <BC : BehaviourContext> BC.commandWithArgs(
scenarioReceiver = scenarioReceiver scenarioReceiver = scenarioReceiver
) )
/**
* @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.commandWithArgs( suspend fun <BC : BehaviourContext> BC.commandWithArgs(
botCommand: BotCommand, botCommand: BotCommand,
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups, initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in TextMessage, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex, argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>> scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>>
) = commandWithArgs( ) = commandWithArgs(
@@ -174,11 +214,16 @@ suspend fun <BC : BehaviourContext> BC.commandWithArgs(
scenarioReceiver = scenarioReceiver scenarioReceiver = scenarioReceiver
) )
/**
* @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.commandWithNamedArgs( suspend fun <BC : BehaviourContext> BC.commandWithNamedArgs(
commandRegex: Regex, commandRegex: Regex,
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups, initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in TextMessage, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex, argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex, nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex,
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, List<Pair<String, String>>> scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, List<Pair<String, String>>>
@@ -196,11 +241,16 @@ suspend fun <BC : BehaviourContext> BC.commandWithNamedArgs(
scenarioReceiver(it, args) scenarioReceiver(it, args)
} }
/**
* @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.commandWithNamedArgs( suspend fun <BC : BehaviourContext> BC.commandWithNamedArgs(
command: String, command: String,
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups, initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in TextMessage, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex, argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex, nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex,
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, List<Pair<String, String>>> scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, List<Pair<String, String>>>
@@ -214,11 +264,16 @@ suspend fun <BC : BehaviourContext> BC.commandWithNamedArgs(
scenarioReceiver = scenarioReceiver scenarioReceiver = scenarioReceiver
) )
/**
* @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.commandWithNamedArgs( suspend fun <BC : BehaviourContext> BC.commandWithNamedArgs(
botCommand: BotCommand, botCommand: BotCommand,
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups, initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in TextMessage, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex, argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex, nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex,
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, List<Pair<String, String>>> scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, List<Pair<String, String>>>
@@ -232,11 +287,16 @@ suspend fun <BC : BehaviourContext> BC.commandWithNamedArgs(
scenarioReceiver = scenarioReceiver scenarioReceiver = scenarioReceiver
) )
/**
* @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.onCommandWithArgs( suspend fun <BC : BehaviourContext> BC.onCommandWithArgs(
commandRegex: Regex, commandRegex: Regex,
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups, initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in TextMessage, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex, argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>> scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>>
): Job = commandWithArgs( ): Job = commandWithArgs(
@@ -248,11 +308,16 @@ suspend fun <BC : BehaviourContext> BC.onCommandWithArgs(
scenarioReceiver = scenarioReceiver scenarioReceiver = scenarioReceiver
) )
/**
* @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.onCommandWithArgs( suspend fun <BC : BehaviourContext> BC.onCommandWithArgs(
command: String, command: String,
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups, initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in TextMessage, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex, argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>> scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>>
): Job = onCommandWithArgs( ): Job = onCommandWithArgs(
@@ -264,11 +329,16 @@ suspend fun <BC : BehaviourContext> BC.onCommandWithArgs(
scenarioReceiver = scenarioReceiver scenarioReceiver = scenarioReceiver
) )
/**
* @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.onCommandWithArgs( suspend fun <BC : BehaviourContext> BC.onCommandWithArgs(
botCommand: BotCommand, botCommand: BotCommand,
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups, initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in TextMessage, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex, argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>> scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>>
): Job = onCommandWithArgs( ): Job = onCommandWithArgs(
@@ -280,11 +350,16 @@ suspend fun <BC : BehaviourContext> BC.onCommandWithArgs(
scenarioReceiver = scenarioReceiver scenarioReceiver = scenarioReceiver
) )
/**
* @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.onCommandWithNamedArgs( suspend fun <BC : BehaviourContext> BC.onCommandWithNamedArgs(
commandRegex: Regex, commandRegex: Regex,
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups, initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in TextMessage, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex, argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex, nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex,
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, List<Pair<String, String>>> scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, List<Pair<String, String>>>
@@ -298,11 +373,16 @@ suspend fun <BC : BehaviourContext> BC.onCommandWithNamedArgs(
scenarioReceiver = scenarioReceiver, scenarioReceiver = scenarioReceiver,
) )
/**
* @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.onCommandWithNamedArgs( suspend fun <BC : BehaviourContext> BC.onCommandWithNamedArgs(
command: String, command: String,
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups, initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in TextMessage, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex, argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex, nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex,
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, List<Pair<String, String>>> scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, List<Pair<String, String>>>
@@ -316,11 +396,16 @@ suspend fun <BC : BehaviourContext> BC.onCommandWithNamedArgs(
scenarioReceiver = scenarioReceiver scenarioReceiver = scenarioReceiver
) )
/**
* @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.onCommandWithNamedArgs( suspend fun <BC : BehaviourContext> BC.onCommandWithNamedArgs(
botCommand: BotCommand, botCommand: BotCommand,
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups, initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in TextMessage, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex, argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex, nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex,
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, List<Pair<String, String>>> scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, List<Pair<String, String>>>

View File

@@ -16,12 +16,17 @@ import dev.inmo.tgbotapi.types.update.abstracts.Update
import dev.inmo.tgbotapi.utils.PreviewFeature import dev.inmo.tgbotapi.utils.PreviewFeature
import kotlinx.coroutines.Job import kotlinx.coroutines.Job
/**
* @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"
*/
@PreviewFeature @PreviewFeature
suspend fun <BC : BehaviourContext> BC.unhandledCommand( suspend fun <BC : BehaviourContext> BC.unhandledCommand(
requireOnlyCommandInMessage: Boolean = true, requireOnlyCommandInMessage: Boolean = true,
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups, initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in TextMessage, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage>
): Job = onText( ): Job = onText(
CommonMessageFilter<TextContent> { message -> CommonMessageFilter<TextContent> { message ->
@@ -44,20 +49,30 @@ suspend fun <BC : BehaviourContext> BC.unhandledCommand(
scenarioReceiver scenarioReceiver
) )
/**
* @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"
*/
@PreviewFeature @PreviewFeature
suspend fun <BC : BehaviourContext> BC.onUnhandledCommand( suspend fun <BC : BehaviourContext> BC.onUnhandledCommand(
requireOnlyCommandInMessage: Boolean = true, requireOnlyCommandInMessage: Boolean = true,
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups, initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in TextMessage, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage>
): Job = unhandledCommand(requireOnlyCommandInMessage, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ): Job = unhandledCommand(requireOnlyCommandInMessage, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
/**
* @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"
*/
@PreviewFeature @PreviewFeature
suspend fun <BC : BehaviourContext> BC.unhandledCommandWithArgs( suspend fun <BC : BehaviourContext> BC.unhandledCommandWithArgs(
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups, initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in TextMessage, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Map<String, Array<String>>> scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Map<String, Array<String>>>
) = onUnhandledCommand( ) = onUnhandledCommand(
requireOnlyCommandInMessage = false, requireOnlyCommandInMessage = false,
@@ -71,10 +86,15 @@ suspend fun <BC : BehaviourContext> BC.unhandledCommandWithArgs(
scenarioReceiver(it, args) scenarioReceiver(it, args)
} }
/**
* @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"
*/
@PreviewFeature @PreviewFeature
suspend fun <BC : BehaviourContext> BC.onUnhandledCommandWithArgs( suspend fun <BC : BehaviourContext> BC.onUnhandledCommandWithArgs(
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups, initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in TextMessage, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Map<String, Array<String>>> scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Map<String, Array<String>>>
): Job = unhandledCommandWithArgs(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ): Job = unhandledCommandWithArgs(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)

View File

@@ -9,6 +9,7 @@ import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.ByChatMessageMarkerFactory import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.ByChatMessageMarkerFactory
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory
import dev.inmo.tgbotapi.extensions.utils.whenCommonMessage import dev.inmo.tgbotapi.extensions.utils.whenCommonMessage
import dev.inmo.tgbotapi.extensions.utils.withContentOrNull
import dev.inmo.tgbotapi.types.files.TelegramMediaFile import dev.inmo.tgbotapi.types.files.TelegramMediaFile
import dev.inmo.tgbotapi.types.message.abstracts.CommonMessage import dev.inmo.tgbotapi.types.message.abstracts.CommonMessage
import dev.inmo.tgbotapi.types.message.content.* import dev.inmo.tgbotapi.types.message.content.*
@@ -20,14 +21,14 @@ typealias CommonMessageFilter<T> = SimpleFilter<CommonMessage<T>>
internal suspend inline fun <BC : BehaviourContext, reified T : MessageContent> BC.onContentMessageWithType( internal suspend inline fun <BC : BehaviourContext, reified T : MessageContent> BC.onContentMessageWithType(
initialFilter: CommonMessageFilter<T>? = null, initialFilter: CommonMessageFilter<T>? = null,
noinline subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<T>, Update>? = MessageFilterByChat, noinline subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<T>, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in CommonMessage<T>, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in CommonMessage<T>, Any>? = ByChatMessageMarkerFactory,
noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<T>> noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<T>>
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) { ) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
when (it) { when (it) {
is BaseSentMessageUpdate -> it.data.whenCommonMessage(::listOfNotNull) is BaseSentMessageUpdate -> it.data.whenCommonMessage(::listOfNotNull)
else -> null else -> null
} ?.mapNotNull { message -> } ?.mapNotNull { message ->
if (message.content is T) message as CommonMessage<T> else null message.withContentOrNull<T>()
} }
} }
@@ -39,15 +40,16 @@ internal suspend inline fun <BC : BehaviourContext, reified T : MessageContent>
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onContentMessage( suspend fun <BC : BehaviourContext> BC.onContentMessage(
initialFilter: CommonMessageFilter<MessageContent>? = null, initialFilter: CommonMessageFilter<MessageContent>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<MessageContent>, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<MessageContent>, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in CommonMessage<MessageContent>, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in CommonMessage<MessageContent>, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<MessageContent>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<MessageContent>>
) = onContentMessageWithType( ) = onContentMessageWithType(
initialFilter, initialFilter,
@@ -63,15 +65,16 @@ suspend fun <BC : BehaviourContext> BC.onContentMessage(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onContact( suspend fun <BC : BehaviourContext> BC.onContact(
initialFilter: CommonMessageFilter<ContactContent>? = CommonMessageFilterExcludeMediaGroups, initialFilter: CommonMessageFilter<ContactContent>? = CommonMessageFilterExcludeMediaGroups,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ContactMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ContactMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in ContactMessage, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in ContactMessage, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ContactMessage> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ContactMessage>
) = onContentMessageWithType( ) = onContentMessageWithType(
initialFilter, initialFilter,
@@ -87,15 +90,16 @@ suspend fun <BC : BehaviourContext> BC.onContact(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onDice( suspend fun <BC : BehaviourContext> BC.onDice(
initialFilter: CommonMessageFilter<DiceContent>? = CommonMessageFilterExcludeMediaGroups, initialFilter: CommonMessageFilter<DiceContent>? = CommonMessageFilterExcludeMediaGroups,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, DiceMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, DiceMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in DiceMessage, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in DiceMessage, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, DiceMessage> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, DiceMessage>
) = onContentMessageWithType( ) = onContentMessageWithType(
initialFilter, initialFilter,
@@ -111,15 +115,16 @@ suspend fun <BC : BehaviourContext> BC.onDice(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onGame( suspend fun <BC : BehaviourContext> BC.onGame(
initialFilter: CommonMessageFilter<GameContent>? = CommonMessageFilterExcludeMediaGroups, initialFilter: CommonMessageFilter<GameContent>? = CommonMessageFilterExcludeMediaGroups,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, GameMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, GameMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in GameMessage, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in GameMessage, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, GameMessage> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, GameMessage>
) = onContentMessageWithType( ) = onContentMessageWithType(
initialFilter, initialFilter,
@@ -135,15 +140,16 @@ suspend fun <BC : BehaviourContext> BC.onGame(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onLocation( suspend fun <BC : BehaviourContext> BC.onLocation(
initialFilter: CommonMessageFilter<LocationContent>? = CommonMessageFilterExcludeMediaGroups, initialFilter: CommonMessageFilter<LocationContent>? = CommonMessageFilterExcludeMediaGroups,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, LocationMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, LocationMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in LocationMessage, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in LocationMessage, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, LocationMessage> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, LocationMessage>
) = onContentMessageWithType( ) = onContentMessageWithType(
initialFilter, initialFilter,
@@ -159,15 +165,16 @@ suspend fun <BC : BehaviourContext> BC.onLocation(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onLiveLocation( suspend fun <BC : BehaviourContext> BC.onLiveLocation(
initialFilter: CommonMessageFilter<LiveLocationContent>? = CommonMessageFilterExcludeMediaGroups, initialFilter: CommonMessageFilter<LiveLocationContent>? = CommonMessageFilterExcludeMediaGroups,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, LiveLocationMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, LiveLocationMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in LiveLocationMessage, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in LiveLocationMessage, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, LiveLocationMessage> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, LiveLocationMessage>
) = onContentMessageWithType( ) = onContentMessageWithType(
initialFilter, initialFilter,
@@ -183,15 +190,16 @@ suspend fun <BC : BehaviourContext> BC.onLiveLocation(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onStaticLocation( suspend fun <BC : BehaviourContext> BC.onStaticLocation(
initialFilter: CommonMessageFilter<StaticLocationContent>? = CommonMessageFilterExcludeMediaGroups, initialFilter: CommonMessageFilter<StaticLocationContent>? = CommonMessageFilterExcludeMediaGroups,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, StaticLocationMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, StaticLocationMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in StaticLocationMessage, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in StaticLocationMessage, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, StaticLocationMessage> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, StaticLocationMessage>
) = onContentMessageWithType( ) = onContentMessageWithType(
initialFilter, initialFilter,
@@ -207,15 +215,16 @@ suspend fun <BC : BehaviourContext> BC.onStaticLocation(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onPoll( suspend fun <BC : BehaviourContext> BC.onPoll(
initialFilter: CommonMessageFilter<PollContent>? = CommonMessageFilterExcludeMediaGroups, initialFilter: CommonMessageFilter<PollContent>? = CommonMessageFilterExcludeMediaGroups,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, PollMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, PollMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in PollMessage, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in PollMessage, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, PollMessage> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, PollMessage>
) = onContentMessageWithType( ) = onContentMessageWithType(
initialFilter, initialFilter,
@@ -231,15 +240,16 @@ suspend fun <BC : BehaviourContext> BC.onPoll(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onText( suspend fun <BC : BehaviourContext> BC.onText(
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups, initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in TextMessage, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage>
) = onContentMessageWithType( ) = onContentMessageWithType(
initialFilter, initialFilter,
@@ -255,15 +265,16 @@ suspend fun <BC : BehaviourContext> BC.onText(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onStory( suspend fun <BC : BehaviourContext> BC.onStory(
initialFilter: CommonMessageFilter<StoryContent>? = CommonMessageFilterExcludeMediaGroups, initialFilter: CommonMessageFilter<StoryContent>? = CommonMessageFilterExcludeMediaGroups,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, StoryMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, StoryMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in StoryMessage, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in StoryMessage, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, StoryMessage> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, StoryMessage>
) = onContentMessageWithType( ) = onContentMessageWithType(
initialFilter, initialFilter,
@@ -279,15 +290,16 @@ suspend fun <BC : BehaviourContext> BC.onStory(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onTextedContent( suspend fun <BC : BehaviourContext> BC.onTextedContent(
initialFilter: CommonMessageFilter<TextedContent>? = null, initialFilter: CommonMessageFilter<TextedContent>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextedMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextedMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in TextedMessage, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in TextedMessage, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextedMessage> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextedMessage>
) = onContentMessageWithType( ) = onContentMessageWithType(
initialFilter, initialFilter,
@@ -303,15 +315,16 @@ suspend fun <BC : BehaviourContext> BC.onTextedContent(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onVenue( suspend fun <BC : BehaviourContext> BC.onVenue(
initialFilter: CommonMessageFilter<VenueContent>? = CommonMessageFilterExcludeMediaGroups, initialFilter: CommonMessageFilter<VenueContent>? = CommonMessageFilterExcludeMediaGroups,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, VenueMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, VenueMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in VenueMessage, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in VenueMessage, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, VenueMessage> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, VenueMessage>
) = onContentMessageWithType( ) = onContentMessageWithType(
initialFilter, initialFilter,
@@ -327,15 +340,16 @@ suspend fun <BC : BehaviourContext> BC.onVenue(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onAudioMediaGroup( suspend fun <BC : BehaviourContext> BC.onAudioMediaGroup(
initialFilter: CommonMessageFilter<AudioMediaGroupPartContent>? = null, initialFilter: CommonMessageFilter<AudioMediaGroupPartContent>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, AudioMediaGroupMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, AudioMediaGroupMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in AudioMediaGroupMessage, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in AudioMediaGroupMessage, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, AudioMediaGroupMessage> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, AudioMediaGroupMessage>
) = onContentMessageWithType( ) = onContentMessageWithType(
initialFilter, initialFilter,
@@ -351,15 +365,16 @@ suspend fun <BC : BehaviourContext> BC.onAudioMediaGroup(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onDocumentMediaGroupContent( suspend fun <BC : BehaviourContext> BC.onDocumentMediaGroupContent(
initialFilter: CommonMessageFilter<DocumentMediaGroupPartContent>? = null, initialFilter: CommonMessageFilter<DocumentMediaGroupPartContent>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, DocumentMediaGroupMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, DocumentMediaGroupMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in DocumentMediaGroupMessage, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in DocumentMediaGroupMessage, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, DocumentMediaGroupMessage> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, DocumentMediaGroupMessage>
) = onContentMessageWithType( ) = onContentMessageWithType(
initialFilter, initialFilter,
@@ -375,15 +390,16 @@ suspend fun <BC : BehaviourContext> BC.onDocumentMediaGroupContent(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onTextedMediaContent( suspend fun <BC : BehaviourContext> BC.onTextedMediaContent(
initialFilter: CommonMessageFilter<TextedMediaContent>? = null, initialFilter: CommonMessageFilter<TextedMediaContent>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextedMediaMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextedMediaMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in TextedMediaMessage, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in TextedMediaMessage, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextedMediaMessage> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextedMediaMessage>
) = onContentMessageWithType( ) = onContentMessageWithType(
initialFilter, initialFilter,
@@ -399,15 +415,16 @@ suspend fun <BC : BehaviourContext> BC.onTextedMediaContent(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onMediaCollection( suspend fun <BC : BehaviourContext> BC.onMediaCollection(
initialFilter: CommonMessageFilter<MediaCollectionContent<TelegramMediaFile>>? = null, initialFilter: CommonMessageFilter<MediaCollectionContent<TelegramMediaFile>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MediaCollectionMessage<TelegramMediaFile>, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MediaCollectionMessage<TelegramMediaFile>, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in MediaCollectionMessage<TelegramMediaFile>, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in MediaCollectionMessage<TelegramMediaFile>, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MediaCollectionMessage<TelegramMediaFile>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MediaCollectionMessage<TelegramMediaFile>>
) = onContentMessageWithType( ) = onContentMessageWithType(
initialFilter, initialFilter,
@@ -423,15 +440,16 @@ suspend fun <BC : BehaviourContext> BC.onMediaCollection(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onMedia( suspend fun <BC : BehaviourContext> BC.onMedia(
initialFilter: CommonMessageFilter<MediaContent>? = null, initialFilter: CommonMessageFilter<MediaContent>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MediaMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MediaMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in MediaMessage, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in MediaMessage, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MediaMessage> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MediaMessage>
) = onContentMessageWithType( ) = onContentMessageWithType(
initialFilter, initialFilter,
@@ -447,15 +465,16 @@ suspend fun <BC : BehaviourContext> BC.onMedia(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onAnimation( suspend fun <BC : BehaviourContext> BC.onAnimation(
initialFilter: CommonMessageFilter<AnimationContent>? = CommonMessageFilterExcludeMediaGroups, initialFilter: CommonMessageFilter<AnimationContent>? = CommonMessageFilterExcludeMediaGroups,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, AnimationMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, AnimationMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in AnimationMessage, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in AnimationMessage, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, AnimationMessage> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, AnimationMessage>
) = onContentMessageWithType( ) = onContentMessageWithType(
initialFilter, initialFilter,
@@ -471,15 +490,16 @@ suspend fun <BC : BehaviourContext> BC.onAnimation(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onAudio( suspend fun <BC : BehaviourContext> BC.onAudio(
initialFilter: CommonMessageFilter<AudioContent>? = null, initialFilter: CommonMessageFilter<AudioContent>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, AudioMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, AudioMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in AudioMessage, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in AudioMessage, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, AudioMessage> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, AudioMessage>
) = onContentMessageWithType( ) = onContentMessageWithType(
initialFilter, initialFilter,
@@ -495,15 +515,16 @@ suspend fun <BC : BehaviourContext> BC.onAudio(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onDocument( suspend fun <BC : BehaviourContext> BC.onDocument(
initialFilter: CommonMessageFilter<DocumentContent>? = null, initialFilter: CommonMessageFilter<DocumentContent>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, DocumentMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, DocumentMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in DocumentMessage, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in DocumentMessage, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, DocumentMessage> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, DocumentMessage>
) = onContentMessageWithType( ) = onContentMessageWithType(
initialFilter, initialFilter,
@@ -519,15 +540,16 @@ suspend fun <BC : BehaviourContext> BC.onDocument(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onPhoto( suspend fun <BC : BehaviourContext> BC.onPhoto(
initialFilter: CommonMessageFilter<PhotoContent>? = null, initialFilter: CommonMessageFilter<PhotoContent>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, PhotoMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, PhotoMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in PhotoMessage, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in PhotoMessage, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, PhotoMessage> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, PhotoMessage>
) = onContentMessageWithType( ) = onContentMessageWithType(
initialFilter, initialFilter,
@@ -543,15 +565,16 @@ suspend fun <BC : BehaviourContext> BC.onPhoto(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onSticker( suspend fun <BC : BehaviourContext> BC.onSticker(
initialFilter: CommonMessageFilter<StickerContent>? = CommonMessageFilterExcludeMediaGroups, initialFilter: CommonMessageFilter<StickerContent>? = CommonMessageFilterExcludeMediaGroups,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, StickerMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, StickerMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in StickerMessage, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in StickerMessage, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, StickerMessage> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, StickerMessage>
) = onContentMessageWithType( ) = onContentMessageWithType(
initialFilter, initialFilter,
@@ -567,15 +590,16 @@ suspend fun <BC : BehaviourContext> BC.onSticker(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onVideo( suspend fun <BC : BehaviourContext> BC.onVideo(
initialFilter: CommonMessageFilter<VideoContent>? = null, initialFilter: CommonMessageFilter<VideoContent>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, VideoMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, VideoMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in VideoMessage, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in VideoMessage, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, VideoMessage> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, VideoMessage>
) = onContentMessageWithType( ) = onContentMessageWithType(
initialFilter, initialFilter,
@@ -591,15 +615,16 @@ suspend fun <BC : BehaviourContext> BC.onVideo(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onVideoNote( suspend fun <BC : BehaviourContext> BC.onVideoNote(
initialFilter: CommonMessageFilter<VideoNoteContent>? = CommonMessageFilterExcludeMediaGroups, initialFilter: CommonMessageFilter<VideoNoteContent>? = CommonMessageFilterExcludeMediaGroups,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, VideoNoteMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, VideoNoteMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in VideoNoteMessage, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in VideoNoteMessage, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, VideoNoteMessage> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, VideoNoteMessage>
) = onContentMessageWithType( ) = onContentMessageWithType(
initialFilter, initialFilter,
@@ -615,15 +640,16 @@ suspend fun <BC : BehaviourContext> BC.onVideoNote(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onVoice( suspend fun <BC : BehaviourContext> BC.onVoice(
initialFilter: CommonMessageFilter<VoiceContent>? = CommonMessageFilterExcludeMediaGroups, initialFilter: CommonMessageFilter<VoiceContent>? = CommonMessageFilterExcludeMediaGroups,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, VoiceMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, VoiceMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in VoiceMessage, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in VoiceMessage, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, VoiceMessage> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, VoiceMessage>
) = onContentMessageWithType( ) = onContentMessageWithType(
initialFilter, initialFilter,
@@ -639,15 +665,16 @@ suspend fun <BC : BehaviourContext> BC.onVoice(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onInvoice( suspend fun <BC : BehaviourContext> BC.onInvoice(
initialFilter: CommonMessageFilter<InvoiceContent>? = CommonMessageFilterExcludeMediaGroups, initialFilter: CommonMessageFilter<InvoiceContent>? = CommonMessageFilterExcludeMediaGroups,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, InvoiceMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, InvoiceMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in InvoiceMessage, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in InvoiceMessage, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, InvoiceMessage> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, InvoiceMessage>
) = onContentMessageWithType( ) = onContentMessageWithType(
initialFilter, initialFilter,
@@ -663,15 +690,16 @@ suspend fun <BC : BehaviourContext> BC.onInvoice(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onVisualContent( suspend fun <BC : BehaviourContext> BC.onVisualContent(
initialFilter: CommonMessageFilter<VisualMediaGroupPartContent>? = null, initialFilter: CommonMessageFilter<VisualMediaGroupPartContent>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, VisualMediaGroupMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, VisualMediaGroupMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in VisualMediaGroupMessage, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in VisualMediaGroupMessage, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, VisualMediaGroupMessage> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, VisualMediaGroupMessage>
) = onContentMessageWithType( ) = onContentMessageWithType(
initialFilter, initialFilter,
@@ -687,15 +715,16 @@ suspend fun <BC : BehaviourContext> BC.onVisualContent(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onMediaContent( suspend fun <BC : BehaviourContext> BC.onMediaContent(
initialFilter: CommonMessageFilter<MediaContent>? = null, initialFilter: CommonMessageFilter<MediaContent>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MediaMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MediaMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in MediaMessage, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in MediaMessage, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MediaMessage> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MediaMessage>
) = onContentMessageWithType( ) = onContentMessageWithType(
initialFilter, initialFilter,
@@ -711,15 +740,16 @@ suspend fun <BC : BehaviourContext> BC.onMediaContent(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onGiveawayContent( suspend fun <BC : BehaviourContext> BC.onGiveawayContent(
initialFilter: CommonMessageFilter<GiveawayContent>? = null, initialFilter: CommonMessageFilter<GiveawayContent>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ScheduledGiveawayContentMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ScheduledGiveawayContentMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in ScheduledGiveawayContentMessage, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in ScheduledGiveawayContentMessage, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ScheduledGiveawayContentMessage> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ScheduledGiveawayContentMessage>
) = onContentMessageWithType( ) = onContentMessageWithType(
initialFilter, initialFilter,
@@ -736,15 +766,16 @@ suspend fun <BC : BehaviourContext> BC.onGiveawayContent(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onGiveawayPublicResultsContent( suspend fun <BC : BehaviourContext> BC.onGiveawayPublicResultsContent(
initialFilter: CommonMessageFilter<GiveawayPublicResultsContent>? = null, initialFilter: CommonMessageFilter<GiveawayPublicResultsContent>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, GiveawayPublicResultsContentMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, GiveawayPublicResultsContentMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in GiveawayPublicResultsContentMessage, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in GiveawayPublicResultsContentMessage, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, GiveawayPublicResultsContentMessage> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, GiveawayPublicResultsContentMessage>
) = onContentMessageWithType( ) = onContentMessageWithType(
initialFilter, initialFilter,

View File

@@ -21,7 +21,7 @@ private val startRegex = Regex("start")
suspend fun <BC : BehaviourContext> BC.onDeepLink( suspend fun <BC : BehaviourContext> BC.onDeepLink(
initialFilter: SimpleFilter<Pair<TextMessage, String>>? = null, initialFilter: SimpleFilter<Pair<TextMessage, String>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, Pair<TextMessage, String>, Update>? = { (message, _), update -> MessageFilterByChat(this, message, update) }, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, Pair<TextMessage, String>, Update>? = { (message, _), update -> MessageFilterByChat(this, message, update) },
markerFactory: MarkerFactory<Pair<TextMessage, String>, Any> = MarkerFactory { (message, _) -> ByChatMessageMarkerFactory(message) }, markerFactory: MarkerFactory<Pair<TextMessage, String>, Any>? = MarkerFactory { (message, _) -> ByChatMessageMarkerFactory(message) },
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, Pair<TextMessage, String>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, Pair<TextMessage, String>>
): Job = on( ): Job = on(
markerFactory, markerFactory,
@@ -43,11 +43,16 @@ suspend fun <BC : BehaviourContext> BC.onDeepLink(
} }
} }
/**
* @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.onDeepLink( suspend fun <BC : BehaviourContext> BC.onDeepLink(
regex: Regex, regex: Regex,
initialFilter: SimpleFilter<Pair<TextMessage, String>>? = null, initialFilter: SimpleFilter<Pair<TextMessage, String>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, Pair<TextMessage, String>, Update>? = { (message, _), update -> MessageFilterByChat(this, message, update) }, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, Pair<TextMessage, String>, Update>? = { (message, _), update -> MessageFilterByChat(this, message, update) },
markerFactory: MarkerFactory<Pair<TextMessage, String>, Any> = MarkerFactory { (message, _) -> ByChatMessageMarkerFactory(message) }, markerFactory: MarkerFactory<Pair<TextMessage, String>, Any>? = MarkerFactory { (message, _) -> ByChatMessageMarkerFactory(message) },
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, Pair<TextMessage, String>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, Pair<TextMessage, String>>
): Job { ): Job {
val internalFilter = SimpleFilter<Pair<TextMessage, String>> { val internalFilter = SimpleFilter<Pair<TextMessage, String>> {
@@ -56,10 +61,15 @@ suspend fun <BC : BehaviourContext> BC.onDeepLink(
return onDeepLink(initialFilter ?.let { internalFilter * it } ?: internalFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) return onDeepLink(initialFilter ?.let { internalFilter * it } ?: internalFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
} }
/**
* @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.onDeepLink( suspend fun <BC : BehaviourContext> BC.onDeepLink(
deepLink: String, deepLink: String,
initialFilter: SimpleFilter<Pair<TextMessage, String>>? = null, initialFilter: SimpleFilter<Pair<TextMessage, String>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, Pair<TextMessage, String>, Update>? = { (message, _), update -> MessageFilterByChat(this, message, update) }, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, Pair<TextMessage, String>, Update>? = { (message, _), update -> MessageFilterByChat(this, message, update) },
markerFactory: MarkerFactory<Pair<TextMessage, String>, Any> = MarkerFactory { (message, _) -> ByChatMessageMarkerFactory(message) }, markerFactory: MarkerFactory<Pair<TextMessage, String>, Any>? = MarkerFactory { (message, _) -> ByChatMessageMarkerFactory(message) },
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, Pair<TextMessage, String>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, Pair<TextMessage, String>>
): Job = onDeepLink(Regex("^$deepLink$"), initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ): Job = onDeepLink(Regex("^$deepLink$"), initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)

View File

@@ -22,15 +22,16 @@ import dev.inmo.tgbotapi.types.update.abstracts.Update
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onBusinessMessagesDeleted( suspend fun <BC : BehaviourContext> BC.onBusinessMessagesDeleted(
initialFilter: SimpleFilter<BusinessMessagesDeleted>? = null, initialFilter: SimpleFilter<BusinessMessagesDeleted>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, BusinessMessagesDeleted, Update>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, BusinessMessagesDeleted, Update>? = null,
markerFactory: MarkerFactory<in BusinessMessagesDeleted, Any> = ByBusinessConnectionIdBusinessMessagesDeletedMarkerFactory, markerFactory: MarkerFactory<in BusinessMessagesDeleted, Any>? = ByBusinessConnectionIdBusinessMessagesDeletedMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, BusinessMessagesDeleted> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, BusinessMessagesDeleted>
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) { ) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
(it.deletedBusinessMessageUpdateOrNull() ?.data) ?.let(::listOfNotNull) (it.deletedBusinessMessageUpdateOrNull() ?.data) ?.let(::listOfNotNull)

View File

@@ -17,7 +17,7 @@ import dev.inmo.tgbotapi.types.update.abstracts.Update
internal suspend inline fun <BC : BehaviourContext, reified T : MessageContent> BC.onEditedContent( internal suspend inline fun <BC : BehaviourContext, reified T : MessageContent> BC.onEditedContent(
initialFilter: CommonMessageFilter<T>? = null, initialFilter: CommonMessageFilter<T>? = null,
noinline subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<T>, Update>? = MessageFilterByChat, noinline subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<T>, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in CommonMessage<T>, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in CommonMessage<T>, Any>? = ByChatMessageMarkerFactory,
noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<T>> noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<T>>
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) { ) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
it.baseEditMessageUpdateOrNull() ?.data ?.withContent<T>() ?.let(::listOfNotNull) it.baseEditMessageUpdateOrNull() ?.data ?.withContent<T>() ?.let(::listOfNotNull)
@@ -31,15 +31,16 @@ internal suspend inline fun <BC : BehaviourContext, reified T : MessageContent>
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onEditedContentMessage( suspend fun <BC : BehaviourContext> BC.onEditedContentMessage(
initialFilter: CommonMessageFilter<MessageContent>? = null, initialFilter: CommonMessageFilter<MessageContent>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<MessageContent>, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<MessageContent>, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in CommonMessage<MessageContent>, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in CommonMessage<MessageContent>, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<MessageContent>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<MessageContent>>
)= onEditedContent( )= onEditedContent(
initialFilter, initialFilter,
@@ -55,15 +56,16 @@ suspend fun <BC : BehaviourContext> BC.onEditedContentMessage(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onEditedContact( suspend fun <BC : BehaviourContext> BC.onEditedContact(
initialFilter: CommonMessageFilter<ContactContent>? = CommonMessageFilterExcludeMediaGroups, initialFilter: CommonMessageFilter<ContactContent>? = CommonMessageFilterExcludeMediaGroups,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ContactMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ContactMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in ContactMessage, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in ContactMessage, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ContactMessage> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ContactMessage>
)= onEditedContent( )= onEditedContent(
initialFilter, initialFilter,
@@ -79,15 +81,16 @@ suspend fun <BC : BehaviourContext> BC.onEditedContact(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onEditedDice( suspend fun <BC : BehaviourContext> BC.onEditedDice(
initialFilter: CommonMessageFilter<DiceContent>? = CommonMessageFilterExcludeMediaGroups, initialFilter: CommonMessageFilter<DiceContent>? = CommonMessageFilterExcludeMediaGroups,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, DiceMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, DiceMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in DiceMessage, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in DiceMessage, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, DiceMessage> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, DiceMessage>
)= onEditedContent( )= onEditedContent(
initialFilter, initialFilter,
@@ -103,15 +106,16 @@ suspend fun <BC : BehaviourContext> BC.onEditedDice(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onEditedGame( suspend fun <BC : BehaviourContext> BC.onEditedGame(
initialFilter: CommonMessageFilter<GameContent>? = CommonMessageFilterExcludeMediaGroups, initialFilter: CommonMessageFilter<GameContent>? = CommonMessageFilterExcludeMediaGroups,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, GameMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, GameMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in GameMessage, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in GameMessage, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, GameMessage> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, GameMessage>
)= onEditedContent( )= onEditedContent(
initialFilter, initialFilter,
@@ -127,15 +131,16 @@ suspend fun <BC : BehaviourContext> BC.onEditedGame(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onEditedLocation( suspend fun <BC : BehaviourContext> BC.onEditedLocation(
initialFilter: CommonMessageFilter<LocationContent>? = CommonMessageFilterExcludeMediaGroups, initialFilter: CommonMessageFilter<LocationContent>? = CommonMessageFilterExcludeMediaGroups,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, LocationMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, LocationMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in LocationMessage, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in LocationMessage, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, LocationMessage> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, LocationMessage>
)= onEditedContent( )= onEditedContent(
initialFilter, initialFilter,
@@ -151,15 +156,16 @@ suspend fun <BC : BehaviourContext> BC.onEditedLocation(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onEditedText( suspend fun <BC : BehaviourContext> BC.onEditedText(
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups, initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in TextMessage, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage>
)= onEditedContent( )= onEditedContent(
initialFilter, initialFilter,
@@ -175,15 +181,16 @@ suspend fun <BC : BehaviourContext> BC.onEditedText(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onEditedVenue( suspend fun <BC : BehaviourContext> BC.onEditedVenue(
initialFilter: CommonMessageFilter<VenueContent>? = CommonMessageFilterExcludeMediaGroups, initialFilter: CommonMessageFilter<VenueContent>? = CommonMessageFilterExcludeMediaGroups,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, VenueMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, VenueMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in VenueMessage, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in VenueMessage, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, VenueMessage> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, VenueMessage>
)= onEditedContent( )= onEditedContent(
initialFilter, initialFilter,
@@ -199,15 +206,16 @@ suspend fun <BC : BehaviourContext> BC.onEditedVenue(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onEditedAudioMediaGroup( suspend fun <BC : BehaviourContext> BC.onEditedAudioMediaGroup(
initialFilter: CommonMessageFilter<AudioMediaGroupPartContent>? = null, initialFilter: CommonMessageFilter<AudioMediaGroupPartContent>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, AudioMediaGroupMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, AudioMediaGroupMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in AudioMediaGroupMessage, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in AudioMediaGroupMessage, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, AudioMediaGroupMessage> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, AudioMediaGroupMessage>
)= onEditedContent( )= onEditedContent(
initialFilter, initialFilter,
@@ -223,15 +231,16 @@ suspend fun <BC : BehaviourContext> BC.onEditedAudioMediaGroup(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onEditedDocumentMediaGroupContent( suspend fun <BC : BehaviourContext> BC.onEditedDocumentMediaGroupContent(
initialFilter: CommonMessageFilter<DocumentMediaGroupPartContent>? = null, initialFilter: CommonMessageFilter<DocumentMediaGroupPartContent>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, DocumentMediaGroupMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, DocumentMediaGroupMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in DocumentMediaGroupMessage, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in DocumentMediaGroupMessage, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, DocumentMediaGroupMessage> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, DocumentMediaGroupMessage>
)= onEditedContent( )= onEditedContent(
initialFilter, initialFilter,
@@ -247,15 +256,16 @@ suspend fun <BC : BehaviourContext> BC.onEditedDocumentMediaGroupContent(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onEditedTextedMediaContent( suspend fun <BC : BehaviourContext> BC.onEditedTextedMediaContent(
initialFilter: CommonMessageFilter<TextedMediaContent>? = null, initialFilter: CommonMessageFilter<TextedMediaContent>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextedMediaMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextedMediaMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in TextedMediaMessage, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in TextedMediaMessage, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextedMediaMessage> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextedMediaMessage>
)= onEditedContent( )= onEditedContent(
initialFilter, initialFilter,
@@ -271,15 +281,16 @@ suspend fun <BC : BehaviourContext> BC.onEditedTextedMediaContent(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onEditedMediaCollection( suspend fun <BC : BehaviourContext> BC.onEditedMediaCollection(
initialFilter: CommonMessageFilter<MediaCollectionContent<TelegramMediaFile>>? = null, initialFilter: CommonMessageFilter<MediaCollectionContent<TelegramMediaFile>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MediaCollectionMessage<TelegramMediaFile>, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MediaCollectionMessage<TelegramMediaFile>, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in MediaCollectionMessage<TelegramMediaFile>, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in MediaCollectionMessage<TelegramMediaFile>, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MediaCollectionMessage<TelegramMediaFile>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MediaCollectionMessage<TelegramMediaFile>>
)= onEditedContent( )= onEditedContent(
initialFilter, initialFilter,
@@ -295,15 +306,16 @@ suspend fun <BC : BehaviourContext> BC.onEditedMediaCollection(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onEditedMedia( suspend fun <BC : BehaviourContext> BC.onEditedMedia(
initialFilter: CommonMessageFilter<MediaContent>? = null, initialFilter: CommonMessageFilter<MediaContent>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MediaMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MediaMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in MediaMessage, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in MediaMessage, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MediaMessage> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MediaMessage>
)= onEditedContent( )= onEditedContent(
initialFilter, initialFilter,
@@ -319,15 +331,16 @@ suspend fun <BC : BehaviourContext> BC.onEditedMedia(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onEditedAnimation( suspend fun <BC : BehaviourContext> BC.onEditedAnimation(
initialFilter: CommonMessageFilter<AnimationContent>? = CommonMessageFilterExcludeMediaGroups, initialFilter: CommonMessageFilter<AnimationContent>? = CommonMessageFilterExcludeMediaGroups,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, AnimationMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, AnimationMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in AnimationMessage, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in AnimationMessage, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, AnimationMessage> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, AnimationMessage>
)= onEditedContent( )= onEditedContent(
initialFilter, initialFilter,
@@ -343,15 +356,16 @@ suspend fun <BC : BehaviourContext> BC.onEditedAnimation(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onEditedAudio( suspend fun <BC : BehaviourContext> BC.onEditedAudio(
initialFilter: CommonMessageFilter<AudioContent>? = null, initialFilter: CommonMessageFilter<AudioContent>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, AudioMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, AudioMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in AudioMessage, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in AudioMessage, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, AudioMessage> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, AudioMessage>
)= onEditedContent( )= onEditedContent(
initialFilter, initialFilter,
@@ -367,15 +381,16 @@ suspend fun <BC : BehaviourContext> BC.onEditedAudio(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onEditedDocument( suspend fun <BC : BehaviourContext> BC.onEditedDocument(
initialFilter: CommonMessageFilter<DocumentContent>? = null, initialFilter: CommonMessageFilter<DocumentContent>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, DocumentMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, DocumentMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in DocumentMessage, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in DocumentMessage, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, DocumentMessage> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, DocumentMessage>
)= onEditedContent( )= onEditedContent(
initialFilter, initialFilter,
@@ -391,15 +406,16 @@ suspend fun <BC : BehaviourContext> BC.onEditedDocument(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onEditedPhoto( suspend fun <BC : BehaviourContext> BC.onEditedPhoto(
initialFilter: CommonMessageFilter<PhotoContent>? = null, initialFilter: CommonMessageFilter<PhotoContent>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, PhotoMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, PhotoMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in PhotoMessage, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in PhotoMessage, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, PhotoMessage> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, PhotoMessage>
)= onEditedContent( )= onEditedContent(
initialFilter, initialFilter,
@@ -415,15 +431,16 @@ suspend fun <BC : BehaviourContext> BC.onEditedPhoto(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onEditedSticker( suspend fun <BC : BehaviourContext> BC.onEditedSticker(
initialFilter: CommonMessageFilter<StickerContent>? = CommonMessageFilterExcludeMediaGroups, initialFilter: CommonMessageFilter<StickerContent>? = CommonMessageFilterExcludeMediaGroups,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, StickerMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, StickerMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in StickerMessage, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in StickerMessage, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, StickerMessage> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, StickerMessage>
)= onEditedContent( )= onEditedContent(
initialFilter, initialFilter,
@@ -439,15 +456,16 @@ suspend fun <BC : BehaviourContext> BC.onEditedSticker(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onEditedVideo( suspend fun <BC : BehaviourContext> BC.onEditedVideo(
initialFilter: CommonMessageFilter<VideoContent>? = null, initialFilter: CommonMessageFilter<VideoContent>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, VideoMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, VideoMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in VideoMessage, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in VideoMessage, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, VideoMessage> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, VideoMessage>
)= onEditedContent( )= onEditedContent(
initialFilter, initialFilter,
@@ -463,15 +481,16 @@ suspend fun <BC : BehaviourContext> BC.onEditedVideo(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onEditedVideoNote( suspend fun <BC : BehaviourContext> BC.onEditedVideoNote(
initialFilter: CommonMessageFilter<VideoNoteContent>? = CommonMessageFilterExcludeMediaGroups, initialFilter: CommonMessageFilter<VideoNoteContent>? = CommonMessageFilterExcludeMediaGroups,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, VideoNoteMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, VideoNoteMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in VideoNoteMessage, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in VideoNoteMessage, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, VideoNoteMessage> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, VideoNoteMessage>
)= onEditedContent( )= onEditedContent(
initialFilter, initialFilter,
@@ -487,15 +506,16 @@ suspend fun <BC : BehaviourContext> BC.onEditedVideoNote(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onEditedVoice( suspend fun <BC : BehaviourContext> BC.onEditedVoice(
initialFilter: CommonMessageFilter<VoiceContent>? = CommonMessageFilterExcludeMediaGroups, initialFilter: CommonMessageFilter<VoiceContent>? = CommonMessageFilterExcludeMediaGroups,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, VoiceMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, VoiceMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in VoiceMessage, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in VoiceMessage, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, VoiceMessage> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, VoiceMessage>
)= onEditedContent( )= onEditedContent(
initialFilter, initialFilter,
@@ -511,15 +531,16 @@ suspend fun <BC : BehaviourContext> BC.onEditedVoice(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onEditedInvoice( suspend fun <BC : BehaviourContext> BC.onEditedInvoice(
initialFilter: CommonMessageFilter<InvoiceContent>? = CommonMessageFilterExcludeMediaGroups, initialFilter: CommonMessageFilter<InvoiceContent>? = CommonMessageFilterExcludeMediaGroups,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, InvoiceMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, InvoiceMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in InvoiceMessage, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in InvoiceMessage, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, InvoiceMessage> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, InvoiceMessage>
)= onEditedContent( )= onEditedContent(
initialFilter, initialFilter,

View File

@@ -10,6 +10,7 @@ import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.Mar
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times
import dev.inmo.tgbotapi.extensions.utils.baseSentMessageUpdateOrNull import dev.inmo.tgbotapi.extensions.utils.baseSentMessageUpdateOrNull
import dev.inmo.tgbotapi.extensions.utils.chatEventMessageOrNull import dev.inmo.tgbotapi.extensions.utils.chatEventMessageOrNull
import dev.inmo.tgbotapi.types.chat.ChatBackground
import dev.inmo.tgbotapi.types.message.ChatEvents.* import dev.inmo.tgbotapi.types.message.ChatEvents.*
import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.* import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.*
import dev.inmo.tgbotapi.types.message.ChatEvents.forum.ForumTopicClosed import dev.inmo.tgbotapi.types.message.ChatEvents.forum.ForumTopicClosed
@@ -32,7 +33,7 @@ import dev.inmo.tgbotapi.types.update.abstracts.Update
internal suspend inline fun <BC : BehaviourContext, reified T : ChatEvent> BC.onEvent( internal suspend inline fun <BC : BehaviourContext, reified T : ChatEvent> BC.onEvent(
initialFilter: SimpleFilter<ChatEventMessage<T>>? = null, initialFilter: SimpleFilter<ChatEventMessage<T>>? = null,
noinline subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<T>, Update>? = MessageFilterByChat, noinline subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<T>, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in ChatEventMessage<T>, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in ChatEventMessage<T>, Any>? = ByChatMessageMarkerFactory,
noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<T>> noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<T>>
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) { ) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
@Suppress("UNCHECKED_CAST") @Suppress("UNCHECKED_CAST")
@@ -42,7 +43,7 @@ internal suspend inline fun <BC : BehaviourContext, reified T : ChatEvent> BC.on
internal suspend inline fun <BC : BehaviourContext, reified T : ChatEvent, reified CEM : ChatEventMessage<T>> BC.onEventWithCustomChatEventMessage( internal suspend inline fun <BC : BehaviourContext, reified T : ChatEvent, reified CEM : ChatEventMessage<T>> BC.onEventWithCustomChatEventMessage(
initialFilter: SimpleFilter<CEM>? = null, initialFilter: SimpleFilter<CEM>? = null,
noinline subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CEM, Update>? = MessageFilterByChat, noinline subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CEM, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in CEM, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in CEM, Any>? = ByChatMessageMarkerFactory,
noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CEM> noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CEM>
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) { ) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
@Suppress("UNCHECKED_CAST") @Suppress("UNCHECKED_CAST")
@@ -56,15 +57,16 @@ internal suspend inline fun <BC : BehaviourContext, reified T : ChatEvent, reifi
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onChannelEvent( suspend fun <BC : BehaviourContext> BC.onChannelEvent(
initialFilter: SimpleFilter<ChatEventMessage<ChannelEvent>>? = null, initialFilter: SimpleFilter<ChatEventMessage<ChannelEvent>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<ChannelEvent>, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<ChannelEvent>, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in ChatEventMessage<ChannelEvent>, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in ChatEventMessage<ChannelEvent>, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<ChannelEvent>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<ChannelEvent>>
) = onEvent(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = onEvent(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
@@ -75,15 +77,16 @@ suspend fun <BC : BehaviourContext> BC.onChannelEvent(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onPrivateEvent( suspend fun <BC : BehaviourContext> BC.onPrivateEvent(
initialFilter: SimpleFilter<ChatEventMessage<PrivateEvent>>? = null, initialFilter: SimpleFilter<ChatEventMessage<PrivateEvent>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<PrivateEvent>, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<PrivateEvent>, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in ChatEventMessage<PrivateEvent>, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in ChatEventMessage<PrivateEvent>, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<PrivateEvent>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<PrivateEvent>>
) = onEvent(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = onEvent(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
@@ -94,15 +97,16 @@ suspend fun <BC : BehaviourContext> BC.onPrivateEvent(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onChatEvent( suspend fun <BC : BehaviourContext> BC.onChatEvent(
initialFilter: SimpleFilter<ChatEventMessage<ChatEvent>>? = null, initialFilter: SimpleFilter<ChatEventMessage<ChatEvent>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<ChatEvent>, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<ChatEvent>, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in ChatEventMessage<ChatEvent>, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in ChatEventMessage<ChatEvent>, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<ChatEvent>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<ChatEvent>>
) = onEvent(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = onEvent(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
@@ -113,15 +117,16 @@ suspend fun <BC : BehaviourContext> BC.onChatEvent(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onVideoChatEvent( suspend fun <BC : BehaviourContext> BC.onVideoChatEvent(
initialFilter: SimpleFilter<ChatEventMessage<VideoChatEvent>>? = null, initialFilter: SimpleFilter<ChatEventMessage<VideoChatEvent>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<VideoChatEvent>, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<VideoChatEvent>, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in ChatEventMessage<VideoChatEvent>, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in ChatEventMessage<VideoChatEvent>, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<VideoChatEvent>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<VideoChatEvent>>
) = onEvent(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = onEvent(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
@@ -132,15 +137,16 @@ suspend fun <BC : BehaviourContext> BC.onVideoChatEvent(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onVideoChatStartedEvent( suspend fun <BC : BehaviourContext> BC.onVideoChatStartedEvent(
initialFilter: SimpleFilter<ChatEventMessage<VideoChatStarted>>? = null, initialFilter: SimpleFilter<ChatEventMessage<VideoChatStarted>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<VideoChatStarted>, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<VideoChatStarted>, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in ChatEventMessage<VideoChatStarted>, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in ChatEventMessage<VideoChatStarted>, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<VideoChatStarted>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<VideoChatStarted>>
) = onEvent(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = onEvent(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
@@ -151,15 +157,16 @@ suspend fun <BC : BehaviourContext> BC.onVideoChatStartedEvent(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onVideoChatEndedEvent( suspend fun <BC : BehaviourContext> BC.onVideoChatEndedEvent(
initialFilter: SimpleFilter<ChatEventMessage<VideoChatEnded>>? = null, initialFilter: SimpleFilter<ChatEventMessage<VideoChatEnded>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<VideoChatEnded>, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<VideoChatEnded>, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in ChatEventMessage<VideoChatEnded>, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in ChatEventMessage<VideoChatEnded>, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<VideoChatEnded>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<VideoChatEnded>>
) = onEvent(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = onEvent(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
@@ -170,15 +177,16 @@ suspend fun <BC : BehaviourContext> BC.onVideoChatEndedEvent(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onVideoChatParticipantsInvitedEvent( suspend fun <BC : BehaviourContext> BC.onVideoChatParticipantsInvitedEvent(
initialFilter: SimpleFilter<ChatEventMessage<VideoChatParticipantsInvited>>? = null, initialFilter: SimpleFilter<ChatEventMessage<VideoChatParticipantsInvited>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<VideoChatParticipantsInvited>, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<VideoChatParticipantsInvited>, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in ChatEventMessage<VideoChatParticipantsInvited>, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in ChatEventMessage<VideoChatParticipantsInvited>, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<VideoChatParticipantsInvited>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<VideoChatParticipantsInvited>>
) = onEvent(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = onEvent(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
@@ -189,15 +197,16 @@ suspend fun <BC : BehaviourContext> BC.onVideoChatParticipantsInvitedEvent(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onMessageAutoDeleteTimerChangedEvent( suspend fun <BC : BehaviourContext> BC.onMessageAutoDeleteTimerChangedEvent(
initialFilter: SimpleFilter<ChatEventMessage<MessageAutoDeleteTimerChanged>>? = null, initialFilter: SimpleFilter<ChatEventMessage<MessageAutoDeleteTimerChanged>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<MessageAutoDeleteTimerChanged>, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<MessageAutoDeleteTimerChanged>, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in ChatEventMessage<MessageAutoDeleteTimerChanged>, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in ChatEventMessage<MessageAutoDeleteTimerChanged>, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<MessageAutoDeleteTimerChanged>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<MessageAutoDeleteTimerChanged>>
) = onEvent(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = onEvent(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
@@ -208,15 +217,16 @@ suspend fun <BC : BehaviourContext> BC.onMessageAutoDeleteTimerChangedEvent(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onPublicChatEvent( suspend fun <BC : BehaviourContext> BC.onPublicChatEvent(
initialFilter: SimpleFilter<ChatEventMessage<PublicChatEvent>>? = null, initialFilter: SimpleFilter<ChatEventMessage<PublicChatEvent>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<PublicChatEvent>, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<PublicChatEvent>, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in ChatEventMessage<PublicChatEvent>, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in ChatEventMessage<PublicChatEvent>, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<PublicChatEvent>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<PublicChatEvent>>
) = onEvent(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = onEvent(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
@@ -227,15 +237,16 @@ suspend fun <BC : BehaviourContext> BC.onPublicChatEvent(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onCommonEvent( suspend fun <BC : BehaviourContext> BC.onCommonEvent(
initialFilter: SimpleFilter<ChatEventMessage<CommonEvent>>? = null, initialFilter: SimpleFilter<ChatEventMessage<CommonEvent>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<CommonEvent>, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<CommonEvent>, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in ChatEventMessage<CommonEvent>, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in ChatEventMessage<CommonEvent>, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<CommonEvent>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<CommonEvent>>
) = onEvent(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = onEvent(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
@@ -246,15 +257,16 @@ suspend fun <BC : BehaviourContext> BC.onCommonEvent(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onGroupEvent( suspend fun <BC : BehaviourContext> BC.onGroupEvent(
initialFilter: SimpleFilter<ChatEventMessage<GroupEvent>>? = null, initialFilter: SimpleFilter<ChatEventMessage<GroupEvent>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<GroupEvent>, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<GroupEvent>, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in ChatEventMessage<GroupEvent>, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in ChatEventMessage<GroupEvent>, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<GroupEvent>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<GroupEvent>>
) = onEvent(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = onEvent(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
@@ -265,15 +277,16 @@ suspend fun <BC : BehaviourContext> BC.onGroupEvent(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onSupergroupEvent( suspend fun <BC : BehaviourContext> BC.onSupergroupEvent(
initialFilter: SimpleFilter<ChatEventMessage<SupergroupEvent>>? = null, initialFilter: SimpleFilter<ChatEventMessage<SupergroupEvent>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<SupergroupEvent>, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<SupergroupEvent>, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in ChatEventMessage<SupergroupEvent>, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in ChatEventMessage<SupergroupEvent>, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<SupergroupEvent>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<SupergroupEvent>>
) = onEvent(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = onEvent(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
@@ -284,15 +297,16 @@ suspend fun <BC : BehaviourContext> BC.onSupergroupEvent(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onChannelChatCreated( suspend fun <BC : BehaviourContext> BC.onChannelChatCreated(
initialFilter: SimpleFilter<ChatEventMessage<ChannelChatCreated>>? = null, initialFilter: SimpleFilter<ChatEventMessage<ChannelChatCreated>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<ChannelChatCreated>, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<ChannelChatCreated>, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in ChatEventMessage<ChannelChatCreated>, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in ChatEventMessage<ChannelChatCreated>, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<ChannelChatCreated>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<ChannelChatCreated>>
) = onEvent(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = onEvent(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
@@ -303,15 +317,16 @@ suspend fun <BC : BehaviourContext> BC.onChannelChatCreated(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onDeleteChatPhoto( suspend fun <BC : BehaviourContext> BC.onDeleteChatPhoto(
initialFilter: SimpleFilter<ChatEventMessage<DeleteChatPhoto>>? = null, initialFilter: SimpleFilter<ChatEventMessage<DeleteChatPhoto>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<DeleteChatPhoto>, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<DeleteChatPhoto>, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in ChatEventMessage<DeleteChatPhoto>, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in ChatEventMessage<DeleteChatPhoto>, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<DeleteChatPhoto>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<DeleteChatPhoto>>
) = onEvent(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = onEvent(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
@@ -322,15 +337,16 @@ suspend fun <BC : BehaviourContext> BC.onDeleteChatPhoto(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onGroupChatCreated( suspend fun <BC : BehaviourContext> BC.onGroupChatCreated(
initialFilter: SimpleFilter<ChatEventMessage<GroupChatCreated>>? = null, initialFilter: SimpleFilter<ChatEventMessage<GroupChatCreated>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<GroupChatCreated>, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<GroupChatCreated>, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in ChatEventMessage<GroupChatCreated>, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in ChatEventMessage<GroupChatCreated>, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<GroupChatCreated>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<GroupChatCreated>>
) = onEvent(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = onEvent(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
@@ -341,15 +357,16 @@ suspend fun <BC : BehaviourContext> BC.onGroupChatCreated(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onLeftChatMember( suspend fun <BC : BehaviourContext> BC.onLeftChatMember(
initialFilter: SimpleFilter<ChatEventMessage<LeftChatMemberEvent>>? = null, initialFilter: SimpleFilter<ChatEventMessage<LeftChatMemberEvent>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<LeftChatMemberEvent>, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<LeftChatMemberEvent>, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in ChatEventMessage<LeftChatMemberEvent>, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in ChatEventMessage<LeftChatMemberEvent>, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<LeftChatMemberEvent>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<LeftChatMemberEvent>>
) = onEvent(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = onEvent(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
@@ -360,15 +377,16 @@ suspend fun <BC : BehaviourContext> BC.onLeftChatMember(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onNewChatMembers( suspend fun <BC : BehaviourContext> BC.onNewChatMembers(
initialFilter: SimpleFilter<ChatEventMessage<NewChatMembers>>? = null, initialFilter: SimpleFilter<ChatEventMessage<NewChatMembers>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<NewChatMembers>, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<NewChatMembers>, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in ChatEventMessage<NewChatMembers>, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in ChatEventMessage<NewChatMembers>, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<NewChatMembers>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<NewChatMembers>>
) = onEvent(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = onEvent(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
@@ -379,15 +397,16 @@ suspend fun <BC : BehaviourContext> BC.onNewChatMembers(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onNewChatPhoto( suspend fun <BC : BehaviourContext> BC.onNewChatPhoto(
initialFilter: SimpleFilter<ChatEventMessage<NewChatPhoto>>? = null, initialFilter: SimpleFilter<ChatEventMessage<NewChatPhoto>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<NewChatPhoto>, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<NewChatPhoto>, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in ChatEventMessage<NewChatPhoto>, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in ChatEventMessage<NewChatPhoto>, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<NewChatPhoto>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<NewChatPhoto>>
) = onEvent(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = onEvent(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
@@ -398,15 +417,16 @@ suspend fun <BC : BehaviourContext> BC.onNewChatPhoto(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onNewChatTitle( suspend fun <BC : BehaviourContext> BC.onNewChatTitle(
initialFilter: SimpleFilter<ChatEventMessage<NewChatTitle>>? = null, initialFilter: SimpleFilter<ChatEventMessage<NewChatTitle>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<NewChatTitle>, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<NewChatTitle>, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in ChatEventMessage<NewChatTitle>, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in ChatEventMessage<NewChatTitle>, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<NewChatTitle>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<NewChatTitle>>
) = onEvent(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = onEvent(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
@@ -417,15 +437,16 @@ suspend fun <BC : BehaviourContext> BC.onNewChatTitle(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onPinnedMessage( suspend fun <BC : BehaviourContext> BC.onPinnedMessage(
initialFilter: SimpleFilter<ChatEventMessage<PinnedMessage>>? = null, initialFilter: SimpleFilter<ChatEventMessage<PinnedMessage>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<PinnedMessage>, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<PinnedMessage>, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in ChatEventMessage<PinnedMessage>, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in ChatEventMessage<PinnedMessage>, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<PinnedMessage>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<PinnedMessage>>
) = onEvent(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = onEvent(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
@@ -436,15 +457,16 @@ suspend fun <BC : BehaviourContext> BC.onPinnedMessage(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onProximityAlertTriggered( suspend fun <BC : BehaviourContext> BC.onProximityAlertTriggered(
initialFilter: SimpleFilter<ChatEventMessage<ProximityAlertTriggered>>? = null, initialFilter: SimpleFilter<ChatEventMessage<ProximityAlertTriggered>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<ProximityAlertTriggered>, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<ProximityAlertTriggered>, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in ChatEventMessage<ProximityAlertTriggered>, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in ChatEventMessage<ProximityAlertTriggered>, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<ProximityAlertTriggered>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<ProximityAlertTriggered>>
) = onEvent(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = onEvent(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
@@ -455,15 +477,16 @@ suspend fun <BC : BehaviourContext> BC.onProximityAlertTriggered(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onSupergroupChatCreated( suspend fun <BC : BehaviourContext> BC.onSupergroupChatCreated(
initialFilter: SimpleFilter<ChatEventMessage<SupergroupChatCreated>>? = null, initialFilter: SimpleFilter<ChatEventMessage<SupergroupChatCreated>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<SupergroupChatCreated>, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<SupergroupChatCreated>, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in ChatEventMessage<SupergroupChatCreated>, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in ChatEventMessage<SupergroupChatCreated>, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<SupergroupChatCreated>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<SupergroupChatCreated>>
) = onEvent(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = onEvent(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
@@ -477,15 +500,16 @@ suspend fun <BC : BehaviourContext> BC.onSupergroupChatCreated(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param markerFactory Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onSuccessfulPayment( suspend fun <BC : BehaviourContext> BC.onSuccessfulPayment(
initialFilter: SimpleFilter<ChatEventMessage<SuccessfulPaymentEvent>>? = null, initialFilter: SimpleFilter<ChatEventMessage<SuccessfulPaymentEvent>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<SuccessfulPaymentEvent>, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<SuccessfulPaymentEvent>, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in ChatEventMessage<SuccessfulPaymentEvent>, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in ChatEventMessage<SuccessfulPaymentEvent>, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<SuccessfulPaymentEvent>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<SuccessfulPaymentEvent>>
) = onEvent(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = onEvent(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
@@ -496,15 +520,16 @@ suspend fun <BC : BehaviourContext> BC.onSuccessfulPayment(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param markerFactory Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onUserLoggedIn( suspend fun <BC : BehaviourContext> BC.onUserLoggedIn(
initialFilter: SimpleFilter<ChatEventMessage<UserLoggedIn>>? = null, initialFilter: SimpleFilter<ChatEventMessage<UserLoggedIn>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<UserLoggedIn>, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<UserLoggedIn>, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in ChatEventMessage<UserLoggedIn>, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in ChatEventMessage<UserLoggedIn>, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<UserLoggedIn>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<UserLoggedIn>>
) = onEvent(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = onEvent(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
@@ -515,15 +540,16 @@ suspend fun <BC : BehaviourContext> BC.onUserLoggedIn(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param markerFactory Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onWebAppData( suspend fun <BC : BehaviourContext> BC.onWebAppData(
initialFilter: SimpleFilter<PrivateEventMessage<WebAppData>>? = null, initialFilter: SimpleFilter<PrivateEventMessage<WebAppData>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, PrivateEventMessage<WebAppData>, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, PrivateEventMessage<WebAppData>, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in ChatEventMessage<WebAppData>, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in ChatEventMessage<WebAppData>, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, PrivateEventMessage<WebAppData>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, PrivateEventMessage<WebAppData>>
) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
@@ -534,15 +560,16 @@ suspend fun <BC : BehaviourContext> BC.onWebAppData(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param markerFactory Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onForumTopicClosed( suspend fun <BC : BehaviourContext> BC.onForumTopicClosed(
initialFilter: SimpleFilter<SupergroupEventMessage<ForumTopicClosed>>? = null, initialFilter: SimpleFilter<SupergroupEventMessage<ForumTopicClosed>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, SupergroupEventMessage<ForumTopicClosed>, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, SupergroupEventMessage<ForumTopicClosed>, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in ChatEventMessage<ForumTopicClosed>, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in ChatEventMessage<ForumTopicClosed>, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, SupergroupEventMessage<ForumTopicClosed>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, SupergroupEventMessage<ForumTopicClosed>>
) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
@@ -553,15 +580,16 @@ suspend fun <BC : BehaviourContext> BC.onForumTopicClosed(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param markerFactory Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onForumTopicCreated( suspend fun <BC : BehaviourContext> BC.onForumTopicCreated(
initialFilter: SimpleFilter<SupergroupEventMessage<ForumTopicCreated>>? = null, initialFilter: SimpleFilter<SupergroupEventMessage<ForumTopicCreated>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, SupergroupEventMessage<ForumTopicCreated>, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, SupergroupEventMessage<ForumTopicCreated>, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in ChatEventMessage<ForumTopicCreated>, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in ChatEventMessage<ForumTopicCreated>, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, SupergroupEventMessage<ForumTopicCreated>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, SupergroupEventMessage<ForumTopicCreated>>
) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
@@ -572,15 +600,16 @@ suspend fun <BC : BehaviourContext> BC.onForumTopicCreated(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param markerFactory Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onForumTopicReopened( suspend fun <BC : BehaviourContext> BC.onForumTopicReopened(
initialFilter: SimpleFilter<SupergroupEventMessage<ForumTopicReopened>>? = null, initialFilter: SimpleFilter<SupergroupEventMessage<ForumTopicReopened>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, SupergroupEventMessage<ForumTopicReopened>, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, SupergroupEventMessage<ForumTopicReopened>, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in ChatEventMessage<ForumTopicReopened>, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in ChatEventMessage<ForumTopicReopened>, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, SupergroupEventMessage<ForumTopicReopened>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, SupergroupEventMessage<ForumTopicReopened>>
) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
@@ -592,15 +621,16 @@ suspend fun <BC : BehaviourContext> BC.onForumTopicReopened(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param markerFactory Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onForumTopicEdited( suspend fun <BC : BehaviourContext> BC.onForumTopicEdited(
initialFilter: SimpleFilter<SupergroupEventMessage<ForumTopicEdited>>? = null, initialFilter: SimpleFilter<SupergroupEventMessage<ForumTopicEdited>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, SupergroupEventMessage<ForumTopicEdited>, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, SupergroupEventMessage<ForumTopicEdited>, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in ChatEventMessage<ForumTopicEdited>, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in ChatEventMessage<ForumTopicEdited>, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, SupergroupEventMessage<ForumTopicEdited>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, SupergroupEventMessage<ForumTopicEdited>>
) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
@@ -611,15 +641,16 @@ suspend fun <BC : BehaviourContext> BC.onForumTopicEdited(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param markerFactory Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onGeneralForumTopicHidden( suspend fun <BC : BehaviourContext> BC.onGeneralForumTopicHidden(
initialFilter: SimpleFilter<SupergroupEventMessage<GeneralForumTopicHidden>>? = null, initialFilter: SimpleFilter<SupergroupEventMessage<GeneralForumTopicHidden>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, SupergroupEventMessage<GeneralForumTopicHidden>, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, SupergroupEventMessage<GeneralForumTopicHidden>, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in ChatEventMessage<GeneralForumTopicHidden>, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in ChatEventMessage<GeneralForumTopicHidden>, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, SupergroupEventMessage<GeneralForumTopicHidden>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, SupergroupEventMessage<GeneralForumTopicHidden>>
) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
@@ -630,15 +661,16 @@ suspend fun <BC : BehaviourContext> BC.onGeneralForumTopicHidden(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param markerFactory Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onGeneralForumTopicUnhidden( suspend fun <BC : BehaviourContext> BC.onGeneralForumTopicUnhidden(
initialFilter: SimpleFilter<SupergroupEventMessage<GeneralForumTopicUnhidden>>? = null, initialFilter: SimpleFilter<SupergroupEventMessage<GeneralForumTopicUnhidden>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, SupergroupEventMessage<GeneralForumTopicUnhidden>, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, SupergroupEventMessage<GeneralForumTopicUnhidden>, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in ChatEventMessage<GeneralForumTopicUnhidden>, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in ChatEventMessage<GeneralForumTopicUnhidden>, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, SupergroupEventMessage<GeneralForumTopicUnhidden>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, SupergroupEventMessage<GeneralForumTopicUnhidden>>
) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
@@ -650,15 +682,16 @@ suspend fun <BC : BehaviourContext> BC.onGeneralForumTopicUnhidden(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param markerFactory Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onWriteAccessAllowed( suspend fun <BC : BehaviourContext> BC.onWriteAccessAllowed(
initialFilter: SimpleFilter<ChatEventMessage<WriteAccessAllowed>>? = null, initialFilter: SimpleFilter<ChatEventMessage<WriteAccessAllowed>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<WriteAccessAllowed>, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<WriteAccessAllowed>, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in ChatEventMessage<WriteAccessAllowed>, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in ChatEventMessage<WriteAccessAllowed>, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<WriteAccessAllowed>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<WriteAccessAllowed>>
) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
@@ -670,15 +703,16 @@ suspend fun <BC : BehaviourContext> BC.onWriteAccessAllowed(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param markerFactory Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onWriteAccessAllowedFromRequest( suspend fun <BC : BehaviourContext> BC.onWriteAccessAllowedFromRequest(
initialFilter: SimpleFilter<ChatEventMessage<WriteAccessAllowed.FromRequest>>? = null, initialFilter: SimpleFilter<ChatEventMessage<WriteAccessAllowed.FromRequest>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<WriteAccessAllowed.FromRequest>, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<WriteAccessAllowed.FromRequest>, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in ChatEventMessage<WriteAccessAllowed.FromRequest>, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in ChatEventMessage<WriteAccessAllowed.FromRequest>, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<WriteAccessAllowed.FromRequest>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<WriteAccessAllowed.FromRequest>>
) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
@@ -690,15 +724,16 @@ suspend fun <BC : BehaviourContext> BC.onWriteAccessAllowedFromRequest(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param markerFactory Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onWriteAccessAllowedFromAttachmentMenu( suspend fun <BC : BehaviourContext> BC.onWriteAccessAllowedFromAttachmentMenu(
initialFilter: SimpleFilter<ChatEventMessage<WriteAccessAllowed.FromAttachmentMenu>>? = null, initialFilter: SimpleFilter<ChatEventMessage<WriteAccessAllowed.FromAttachmentMenu>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<WriteAccessAllowed.FromAttachmentMenu>, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<WriteAccessAllowed.FromAttachmentMenu>, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in ChatEventMessage<WriteAccessAllowed.FromAttachmentMenu>, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in ChatEventMessage<WriteAccessAllowed.FromAttachmentMenu>, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<WriteAccessAllowed.FromAttachmentMenu>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<WriteAccessAllowed.FromAttachmentMenu>>
) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
@@ -710,15 +745,16 @@ suspend fun <BC : BehaviourContext> BC.onWriteAccessAllowedFromAttachmentMenu(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param markerFactory Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onWriteAccessAllowedOther( suspend fun <BC : BehaviourContext> BC.onWriteAccessAllowedOther(
initialFilter: SimpleFilter<ChatEventMessage<WriteAccessAllowed.Other>>? = null, initialFilter: SimpleFilter<ChatEventMessage<WriteAccessAllowed.Other>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<WriteAccessAllowed.Other>, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<WriteAccessAllowed.Other>, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in ChatEventMessage<WriteAccessAllowed.Other>, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in ChatEventMessage<WriteAccessAllowed.Other>, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<WriteAccessAllowed.Other>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<WriteAccessAllowed.Other>>
) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
@@ -730,15 +766,16 @@ suspend fun <BC : BehaviourContext> BC.onWriteAccessAllowedOther(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param markerFactory Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onWriteAccessAllowedFromWebAppLink( suspend fun <BC : BehaviourContext> BC.onWriteAccessAllowedFromWebAppLink(
initialFilter: SimpleFilter<ChatEventMessage<WriteAccessAllowed.FromWebAppLink>>? = null, initialFilter: SimpleFilter<ChatEventMessage<WriteAccessAllowed.FromWebAppLink>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<WriteAccessAllowed.FromWebAppLink>, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<WriteAccessAllowed.FromWebAppLink>, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in ChatEventMessage<WriteAccessAllowed.FromWebAppLink>, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in ChatEventMessage<WriteAccessAllowed.FromWebAppLink>, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<WriteAccessAllowed.FromWebAppLink>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<WriteAccessAllowed.FromWebAppLink>>
) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
@@ -751,15 +788,16 @@ suspend fun <BC : BehaviourContext> BC.onWriteAccessAllowedFromWebAppLink(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param markerFactory Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onChatSharedRequest( suspend fun <BC : BehaviourContext> BC.onChatSharedRequest(
initialFilter: SimpleFilter<PrivateEventMessage<ChatSharedRequest>>? = null, initialFilter: SimpleFilter<PrivateEventMessage<ChatSharedRequest>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, PrivateEventMessage<ChatSharedRequest>, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, PrivateEventMessage<ChatSharedRequest>, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in ChatEventMessage<ChatSharedRequest>, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in ChatEventMessage<ChatSharedRequest>, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, PrivateEventMessage<ChatSharedRequest>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, PrivateEventMessage<ChatSharedRequest>>
) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
@@ -771,15 +809,16 @@ suspend fun <BC : BehaviourContext> BC.onChatSharedRequest(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param markerFactory Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onUsersShared( suspend fun <BC : BehaviourContext> BC.onUsersShared(
initialFilter: SimpleFilter<PrivateEventMessage<UsersShared>>? = null, initialFilter: SimpleFilter<PrivateEventMessage<UsersShared>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, PrivateEventMessage<UsersShared>, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, PrivateEventMessage<UsersShared>, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in ChatEventMessage<UsersShared>, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in ChatEventMessage<UsersShared>, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, PrivateEventMessage<UsersShared>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, PrivateEventMessage<UsersShared>>
) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
@@ -791,15 +830,16 @@ suspend fun <BC : BehaviourContext> BC.onUsersShared(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param markerFactory Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onUserShared( suspend fun <BC : BehaviourContext> BC.onUserShared(
initialFilter: SimpleFilter<PrivateEventMessage<UsersShared>>? = null, initialFilter: SimpleFilter<PrivateEventMessage<UsersShared>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, PrivateEventMessage<UsersShared>, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, PrivateEventMessage<UsersShared>, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in ChatEventMessage<UsersShared>, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in ChatEventMessage<UsersShared>, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, PrivateEventMessage<UsersShared>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, PrivateEventMessage<UsersShared>>
) = onUsersShared(initialFilter * { it.chatEvent.userIds.size == 1 }, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = onUsersShared(initialFilter * { it.chatEvent.userIds.size == 1 }, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
@@ -812,15 +852,16 @@ suspend fun <BC : BehaviourContext> BC.onUserShared(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param markerFactory Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onChatShared( suspend fun <BC : BehaviourContext> BC.onChatShared(
initialFilter: SimpleFilter<PrivateEventMessage<ChatShared>>? = null, initialFilter: SimpleFilter<PrivateEventMessage<ChatShared>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, PrivateEventMessage<ChatShared>, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, PrivateEventMessage<ChatShared>, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in ChatEventMessage<ChatShared>, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in ChatEventMessage<ChatShared>, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, PrivateEventMessage<ChatShared>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, PrivateEventMessage<ChatShared>>
) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
@@ -833,14 +874,36 @@ suspend fun <BC : BehaviourContext> BC.onChatShared(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param markerFactory Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onChatBoostAdded( suspend fun <BC : BehaviourContext> BC.onChatBoostAdded(
initialFilter: SimpleFilter<ChatEventMessage<ChatBoostAdded>>? = null, initialFilter: SimpleFilter<ChatEventMessage<ChatBoostAdded>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<ChatBoostAdded>, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<ChatBoostAdded>, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in ChatEventMessage<ChatBoostAdded>, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in ChatEventMessage<ChatBoostAdded>, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<ChatBoostAdded>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<ChatBoostAdded>>
) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
/**
* @param initialFilter This filter will be called to remove unnecessary data BEFORE [scenarioReceiver] call
* @param subcontextUpdatesFilter This filter will be applied to each update inside of [scenarioReceiver]. For example,
* this filter will be used if you will call [dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.waitContentMessage].
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters
* @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"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data
*/
suspend 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,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<ChatBackground>>
) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)

View File

@@ -12,7 +12,7 @@ import dev.inmo.tgbotapi.types.update.abstracts.Update
internal suspend inline fun <BC : BehaviourContext, reified T : InlineQuery> BC.onInlineQuery( internal suspend inline fun <BC : BehaviourContext, reified T : InlineQuery> BC.onInlineQuery(
initialFilter: SimpleFilter<T>? = null, initialFilter: SimpleFilter<T>? = null,
noinline subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, T, Update>? = InlineQueryFilterByUser, noinline subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, T, Update>? = InlineQueryFilterByUser,
markerFactory: MarkerFactory<in T, Any> = ByUserInlineQueryMarkerFactory, markerFactory: MarkerFactory<in T, Any>? = ByUserInlineQueryMarkerFactory,
noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, T> noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, T>
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) { ) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
(it.inlineQueryUpdateOrNull() ?.data as? T) ?.let(::listOfNotNull) (it.inlineQueryUpdateOrNull() ?.data as? T) ?.let(::listOfNotNull)
@@ -25,15 +25,16 @@ internal suspend inline fun <BC : BehaviourContext, reified T : InlineQuery> BC.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onAnyInlineQuery( suspend fun <BC : BehaviourContext> BC.onAnyInlineQuery(
initialFilter: SimpleFilter<InlineQuery>? = null, initialFilter: SimpleFilter<InlineQuery>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, InlineQuery, Update>? = InlineQueryFilterByUser, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, InlineQuery, Update>? = InlineQueryFilterByUser,
markerFactory: MarkerFactory<in InlineQuery, Any> = ByUserInlineQueryMarkerFactory, markerFactory: MarkerFactory<in InlineQuery, Any>? = ByUserInlineQueryMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, InlineQuery> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, InlineQuery>
) = onInlineQuery(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = onInlineQuery(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
@@ -45,15 +46,16 @@ suspend fun <BC : BehaviourContext> BC.onAnyInlineQuery(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onBaseInlineQuery( suspend fun <BC : BehaviourContext> BC.onBaseInlineQuery(
initialFilter: SimpleFilter<BaseInlineQuery>? = null, initialFilter: SimpleFilter<BaseInlineQuery>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, BaseInlineQuery, Update>? = InlineQueryFilterByUser, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, BaseInlineQuery, Update>? = InlineQueryFilterByUser,
markerFactory: MarkerFactory<in BaseInlineQuery, Any> = ByUserInlineQueryMarkerFactory, markerFactory: MarkerFactory<in BaseInlineQuery, Any>? = ByUserInlineQueryMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, BaseInlineQuery> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, BaseInlineQuery>
) = onInlineQuery(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = onInlineQuery(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
@@ -65,14 +67,15 @@ suspend fun <BC : BehaviourContext> BC.onBaseInlineQuery(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onLocationInlineQuery( suspend fun <BC : BehaviourContext> BC.onLocationInlineQuery(
initialFilter: SimpleFilter<LocationInlineQuery>? = null, initialFilter: SimpleFilter<LocationInlineQuery>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, LocationInlineQuery, Update>? = InlineQueryFilterByUser, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, LocationInlineQuery, Update>? = InlineQueryFilterByUser,
markerFactory: MarkerFactory<in LocationInlineQuery, Any> = ByUserInlineQueryMarkerFactory, markerFactory: MarkerFactory<in LocationInlineQuery, Any>? = ByUserInlineQueryMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, LocationInlineQuery> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, LocationInlineQuery>
) = onInlineQuery(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = onInlineQuery(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)

View File

@@ -1,5 +1,7 @@
package dev.inmo.tgbotapi.extensions.behaviour_builder.triggers_handling package dev.inmo.tgbotapi.extensions.behaviour_builder.triggers_handling
import dev.inmo.micro_utils.coroutines.launchSafelyWithoutExceptions
import dev.inmo.micro_utils.coroutines.subscribeSafelyWithoutExceptions
import dev.inmo.micro_utils.coroutines.subscribeSafelyWithoutExceptionsAsync import dev.inmo.micro_utils.coroutines.subscribeSafelyWithoutExceptionsAsync
import dev.inmo.tgbotapi.extensions.behaviour_builder.* import dev.inmo.tgbotapi.extensions.behaviour_builder.*
import dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.expectFlow import dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.expectFlow
@@ -7,12 +9,12 @@ import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory
import dev.inmo.tgbotapi.types.update.abstracts.Update import dev.inmo.tgbotapi.types.update.abstracts.Update
internal suspend inline fun <BC : BehaviourContext, reified T> BC.on( internal suspend fun <BC : BehaviourContext, T> BC.on(
markerFactory: MarkerFactory<in T, Any>, markerFactory: MarkerFactory<in T, Any>?,
initialFilter: SimpleFilter<T>? = null, initialFilter: SimpleFilter<T>? = null,
noinline subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, T, Update>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, T, Update>? = null,
noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, T>, scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, T>,
noinline updateToData: (Update) -> List<T>? updateToData: (Update) -> List<T>?
) = flowsUpdatesFilter.expectFlow( ) = flowsUpdatesFilter.expectFlow(
bot, bot,
filter = initialFilter ?.let { filter = initialFilter ?.let {
@@ -22,19 +24,31 @@ internal suspend inline fun <BC : BehaviourContext, reified T> BC.on(
} ?: emptyList() } ?: emptyList()
} }
} ?: { } ?: {
updateToData(it) ?.mapNotNull { data -> updateToData(it) ?.map { data ->
it to data it to data
} ?: emptyList() } ?: emptyList()
} }
).subscribeSafelyWithoutExceptionsAsync( ).run {
scope, val handler: suspend (Pair<Update, T>) -> Unit = subcontextUpdatesFilter ?.let {
{ markerFactory(it.second) } { (update, triggerData) ->
) { (update, triggerData) -> createSubContextAndDoWithUpdatesFilter {
createSubContextAndDoWithUpdatesFilter( if (subcontextUpdatesFilter(this, triggerData, update)) {
stopOnCompletion = false scenarioReceiver(triggerData)
) { }
if (subcontextUpdatesFilter ?.invoke(this, triggerData, update) != false) { }
scenarioReceiver(triggerData) }
} ?: { (_, triggerData) ->
createSubContextAndDoWithUpdatesFilter(behaviourContextReceiver = { scenarioReceiver(triggerData) })
}
markerFactory ?.let {
subscribeSafelyWithoutExceptionsAsync(
scope,
{ markerFactory(it.second) },
block = handler
)
} ?: subscribeSafelyWithoutExceptions(scope) {
scope.launchSafelyWithoutExceptions {
handler(it)
} }
} }
} }

View File

@@ -18,7 +18,7 @@ import dev.inmo.tgbotapi.utils.PreviewFeature
internal suspend inline fun <BC : BehaviourContext, reified T : MediaGroupPartContent> BC.buildMediaGroupMessagesTrigger( internal suspend inline fun <BC : BehaviourContext, reified T : MediaGroupPartContent> BC.buildMediaGroupMessagesTrigger(
initialFilter: SimpleFilter<MediaGroupMessage<T>>? = null, initialFilter: SimpleFilter<MediaGroupMessage<T>>? = null,
noinline subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MediaGroupMessage<T>, Update>? = null, noinline subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MediaGroupMessage<T>, Update>? = null,
markerFactory: MarkerFactory<in MediaGroupMessage<T>, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in MediaGroupMessage<T>, Any>? = ByChatMessageMarkerFactory,
noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MediaGroupMessage<T>> noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MediaGroupMessage<T>>
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) { ) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
it.baseSentMessageUpdateOrNull() ?.data ?.commonMessageOrNull() ?.withContentOrNull<MediaGroupContent<*>>() ?.let { it.baseSentMessageUpdateOrNull() ?.data ?.commonMessageOrNull() ?.withContentOrNull<MediaGroupContent<*>>() ?.let {
@@ -37,15 +37,16 @@ internal suspend inline fun <BC : BehaviourContext, reified T : MediaGroupPartCo
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onMediaGroupMessages( suspend fun <BC : BehaviourContext> BC.onMediaGroupMessages(
initialFilter: SimpleFilter<MediaGroupMessage<MediaGroupPartContent>>? = null, initialFilter: SimpleFilter<MediaGroupMessage<MediaGroupPartContent>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MediaGroupMessage<MediaGroupPartContent>, Update>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MediaGroupMessage<MediaGroupPartContent>, Update>? = null,
markerFactory: MarkerFactory<in MediaGroupMessage<MediaGroupPartContent>, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in MediaGroupMessage<MediaGroupPartContent>, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MediaGroupMessage<MediaGroupPartContent>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MediaGroupMessage<MediaGroupPartContent>>
) = buildMediaGroupMessagesTrigger(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = buildMediaGroupMessagesTrigger(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
@@ -56,15 +57,16 @@ suspend fun <BC : BehaviourContext> BC.onMediaGroupMessages(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onPlaylistMessages( suspend fun <BC : BehaviourContext> BC.onPlaylistMessages(
initialFilter: SimpleFilter<MediaGroupMessage<AudioMediaGroupPartContent>>? = null, initialFilter: SimpleFilter<MediaGroupMessage<AudioMediaGroupPartContent>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MediaGroupMessage<AudioMediaGroupPartContent>, Update>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MediaGroupMessage<AudioMediaGroupPartContent>, Update>? = null,
markerFactory: MarkerFactory<in MediaGroupMessage<AudioMediaGroupPartContent>, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in MediaGroupMessage<AudioMediaGroupPartContent>, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MediaGroupMessage<AudioMediaGroupPartContent>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MediaGroupMessage<AudioMediaGroupPartContent>>
) = buildMediaGroupMessagesTrigger(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = buildMediaGroupMessagesTrigger(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
@@ -75,15 +77,16 @@ suspend fun <BC : BehaviourContext> BC.onPlaylistMessages(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onDocumentsGroupMessages( suspend fun <BC : BehaviourContext> BC.onDocumentsGroupMessages(
initialFilter: SimpleFilter<MediaGroupMessage<DocumentMediaGroupPartContent>>? = null, initialFilter: SimpleFilter<MediaGroupMessage<DocumentMediaGroupPartContent>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MediaGroupMessage<DocumentMediaGroupPartContent>, Update>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MediaGroupMessage<DocumentMediaGroupPartContent>, Update>? = null,
markerFactory: MarkerFactory<in MediaGroupMessage<DocumentMediaGroupPartContent>, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in MediaGroupMessage<DocumentMediaGroupPartContent>, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MediaGroupMessage<DocumentMediaGroupPartContent>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MediaGroupMessage<DocumentMediaGroupPartContent>>
) = buildMediaGroupMessagesTrigger(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = buildMediaGroupMessagesTrigger(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
@@ -94,15 +97,16 @@ suspend fun <BC : BehaviourContext> BC.onDocumentsGroupMessages(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onVisualGalleryMessages( suspend fun <BC : BehaviourContext> BC.onVisualGalleryMessages(
initialFilter: SimpleFilter<MediaGroupMessage<VisualMediaGroupPartContent>>? = null, initialFilter: SimpleFilter<MediaGroupMessage<VisualMediaGroupPartContent>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MediaGroupMessage<VisualMediaGroupPartContent>, Update>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MediaGroupMessage<VisualMediaGroupPartContent>, Update>? = null,
markerFactory: MarkerFactory<in MediaGroupMessage<VisualMediaGroupPartContent>, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in MediaGroupMessage<VisualMediaGroupPartContent>, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MediaGroupMessage<VisualMediaGroupPartContent>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MediaGroupMessage<VisualMediaGroupPartContent>>
) = buildMediaGroupMessagesTrigger(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = buildMediaGroupMessagesTrigger(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
@@ -113,15 +117,16 @@ suspend fun <BC : BehaviourContext> BC.onVisualGalleryMessages(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onVisualMediaGroupMessages( suspend fun <BC : BehaviourContext> BC.onVisualMediaGroupMessages(
initialFilter: SimpleFilter<MediaGroupMessage<VisualMediaGroupPartContent>>? = null, initialFilter: SimpleFilter<MediaGroupMessage<VisualMediaGroupPartContent>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MediaGroupMessage<VisualMediaGroupPartContent>, Update>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MediaGroupMessage<VisualMediaGroupPartContent>, Update>? = null,
markerFactory: MarkerFactory<in MediaGroupMessage<VisualMediaGroupPartContent>, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in MediaGroupMessage<VisualMediaGroupPartContent>, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MediaGroupMessage<VisualMediaGroupPartContent>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MediaGroupMessage<VisualMediaGroupPartContent>>
) = onVisualGalleryMessages(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = onVisualGalleryMessages(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
@@ -132,15 +137,16 @@ suspend fun <BC : BehaviourContext> BC.onVisualMediaGroupMessages(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onPhotoGalleryMessages( suspend fun <BC : BehaviourContext> BC.onPhotoGalleryMessages(
initialFilter: SimpleFilter<MediaGroupMessage<PhotoContent>>? = null, initialFilter: SimpleFilter<MediaGroupMessage<PhotoContent>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MediaGroupMessage<PhotoContent>, Update>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MediaGroupMessage<PhotoContent>, Update>? = null,
markerFactory: MarkerFactory<in MediaGroupMessage<PhotoContent>, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in MediaGroupMessage<PhotoContent>, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MediaGroupMessage<PhotoContent>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MediaGroupMessage<PhotoContent>>
) = buildMediaGroupMessagesTrigger(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = buildMediaGroupMessagesTrigger(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
@@ -151,14 +157,15 @@ suspend fun <BC : BehaviourContext> BC.onPhotoGalleryMessages(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onVideoGalleryMessages( suspend fun <BC : BehaviourContext> BC.onVideoGalleryMessages(
initialFilter: SimpleFilter<MediaGroupMessage<VideoContent>>? = null, initialFilter: SimpleFilter<MediaGroupMessage<VideoContent>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MediaGroupMessage<VideoContent>, Update>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MediaGroupMessage<VideoContent>, Update>? = null,
markerFactory: MarkerFactory<in MediaGroupMessage<VideoContent>, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in MediaGroupMessage<VideoContent>, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MediaGroupMessage<VideoContent>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MediaGroupMessage<VideoContent>>
) = buildMediaGroupMessagesTrigger(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = buildMediaGroupMessagesTrigger(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)

View File

@@ -18,7 +18,7 @@ import dev.inmo.tgbotapi.utils.PreviewFeature
internal suspend inline fun <BC : BehaviourContext, reified T : MediaGroupPartContent> BC.buildMediaGroupTrigger( internal suspend inline fun <BC : BehaviourContext, reified T : MediaGroupPartContent> BC.buildMediaGroupTrigger(
initialFilter: SimpleFilter<MediaGroupContent<T>>? = null, initialFilter: SimpleFilter<MediaGroupContent<T>>? = null,
noinline subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MediaGroupContent<T>, Update>? = null, noinline subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MediaGroupContent<T>, Update>? = null,
markerFactory: MarkerFactory<in MediaGroupContent<T>, Any> = AnyMarkerFactory(), markerFactory: MarkerFactory<in MediaGroupContent<T>, Any>? = AnyMarkerFactory(),
noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MediaGroupContent<T>> noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MediaGroupContent<T>>
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) { ) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
it.baseSentMessageUpdateOrNull() ?.data ?.commonMessageOrNull() ?.withContentOrNull<MediaGroupContent<*>>() ?.let { it.baseSentMessageUpdateOrNull() ?.data ?.commonMessageOrNull() ?.withContentOrNull<MediaGroupContent<*>>() ?.let {
@@ -37,15 +37,16 @@ internal suspend inline fun <BC : BehaviourContext, reified T : MediaGroupPartCo
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onMediaGroup( suspend fun <BC : BehaviourContext> BC.onMediaGroup(
initialFilter: SimpleFilter<MediaGroupContent<MediaGroupPartContent>>? = null, initialFilter: SimpleFilter<MediaGroupContent<MediaGroupPartContent>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MediaGroupContent<MediaGroupPartContent>, Update>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MediaGroupContent<MediaGroupPartContent>, Update>? = null,
markerFactory: MarkerFactory<in MediaGroupContent<MediaGroupPartContent>, Any> = AnyMarkerFactory(), markerFactory: MarkerFactory<in MediaGroupContent<MediaGroupPartContent>, Any>? = AnyMarkerFactory(),
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MediaGroupContent<MediaGroupPartContent>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MediaGroupContent<MediaGroupPartContent>>
) = buildMediaGroupTrigger(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = buildMediaGroupTrigger(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
@@ -56,15 +57,16 @@ suspend fun <BC : BehaviourContext> BC.onMediaGroup(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onPlaylist( suspend fun <BC : BehaviourContext> BC.onPlaylist(
initialFilter: SimpleFilter<MediaGroupContent<AudioMediaGroupPartContent>>? = null, initialFilter: SimpleFilter<MediaGroupContent<AudioMediaGroupPartContent>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MediaGroupContent<AudioMediaGroupPartContent>, Update>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MediaGroupContent<AudioMediaGroupPartContent>, Update>? = null,
markerFactory: MarkerFactory<in MediaGroupContent<AudioMediaGroupPartContent>, Any> = AnyMarkerFactory(), markerFactory: MarkerFactory<in MediaGroupContent<AudioMediaGroupPartContent>, Any>? = AnyMarkerFactory(),
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MediaGroupContent<AudioMediaGroupPartContent>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MediaGroupContent<AudioMediaGroupPartContent>>
) = buildMediaGroupTrigger(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = buildMediaGroupTrigger(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
@@ -75,15 +77,16 @@ suspend fun <BC : BehaviourContext> BC.onPlaylist(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onDocumentsGroup( suspend fun <BC : BehaviourContext> BC.onDocumentsGroup(
initialFilter: SimpleFilter<MediaGroupContent<DocumentMediaGroupPartContent>>? = null, initialFilter: SimpleFilter<MediaGroupContent<DocumentMediaGroupPartContent>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MediaGroupContent<DocumentMediaGroupPartContent>, Update>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MediaGroupContent<DocumentMediaGroupPartContent>, Update>? = null,
markerFactory: MarkerFactory<in MediaGroupContent<DocumentMediaGroupPartContent>, Any> = AnyMarkerFactory(), markerFactory: MarkerFactory<in MediaGroupContent<DocumentMediaGroupPartContent>, Any>? = AnyMarkerFactory(),
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MediaGroupContent<DocumentMediaGroupPartContent>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MediaGroupContent<DocumentMediaGroupPartContent>>
) = buildMediaGroupTrigger(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = buildMediaGroupTrigger(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
@@ -94,15 +97,16 @@ suspend fun <BC : BehaviourContext> BC.onDocumentsGroup(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onVisualGallery( suspend fun <BC : BehaviourContext> BC.onVisualGallery(
initialFilter: SimpleFilter<MediaGroupContent<VisualMediaGroupPartContent>>? = null, initialFilter: SimpleFilter<MediaGroupContent<VisualMediaGroupPartContent>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MediaGroupContent<VisualMediaGroupPartContent>, Update>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MediaGroupContent<VisualMediaGroupPartContent>, Update>? = null,
markerFactory: MarkerFactory<in MediaGroupContent<VisualMediaGroupPartContent>, Any> = AnyMarkerFactory(), markerFactory: MarkerFactory<in MediaGroupContent<VisualMediaGroupPartContent>, Any>? = AnyMarkerFactory(),
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MediaGroupContent<VisualMediaGroupPartContent>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MediaGroupContent<VisualMediaGroupPartContent>>
) = buildMediaGroupTrigger(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = buildMediaGroupTrigger(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
@@ -113,15 +117,16 @@ suspend fun <BC : BehaviourContext> BC.onVisualGallery(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onVisualMediaGroup( suspend fun <BC : BehaviourContext> BC.onVisualMediaGroup(
initialFilter: SimpleFilter<MediaGroupContent<VisualMediaGroupPartContent>>? = null, initialFilter: SimpleFilter<MediaGroupContent<VisualMediaGroupPartContent>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MediaGroupContent<VisualMediaGroupPartContent>, Update>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MediaGroupContent<VisualMediaGroupPartContent>, Update>? = null,
markerFactory: MarkerFactory<in MediaGroupContent<VisualMediaGroupPartContent>, Any> = AnyMarkerFactory(), markerFactory: MarkerFactory<in MediaGroupContent<VisualMediaGroupPartContent>, Any>? = AnyMarkerFactory(),
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MediaGroupContent<VisualMediaGroupPartContent>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MediaGroupContent<VisualMediaGroupPartContent>>
) = onVisualGallery(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = onVisualGallery(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
@@ -132,15 +137,16 @@ suspend fun <BC : BehaviourContext> BC.onVisualMediaGroup(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onPhotoGallery( suspend fun <BC : BehaviourContext> BC.onPhotoGallery(
initialFilter: SimpleFilter<MediaGroupContent<PhotoContent>>? = null, initialFilter: SimpleFilter<MediaGroupContent<PhotoContent>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MediaGroupContent<PhotoContent>, Update>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MediaGroupContent<PhotoContent>, Update>? = null,
markerFactory: MarkerFactory<in MediaGroupContent<PhotoContent>, Any> = AnyMarkerFactory(), markerFactory: MarkerFactory<in MediaGroupContent<PhotoContent>, Any>? = AnyMarkerFactory(),
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MediaGroupContent<PhotoContent>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MediaGroupContent<PhotoContent>>
) = buildMediaGroupTrigger(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = buildMediaGroupTrigger(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
@@ -151,14 +157,15 @@ suspend fun <BC : BehaviourContext> BC.onPhotoGallery(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onVideoGallery( suspend fun <BC : BehaviourContext> BC.onVideoGallery(
initialFilter: SimpleFilter<MediaGroupContent<VideoContent>>? = null, initialFilter: SimpleFilter<MediaGroupContent<VideoContent>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MediaGroupContent<VideoContent>, Update>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MediaGroupContent<VideoContent>, Update>? = null,
markerFactory: MarkerFactory<in MediaGroupContent<VideoContent>, Any> = AnyMarkerFactory(), markerFactory: MarkerFactory<in MediaGroupContent<VideoContent>, Any>? = AnyMarkerFactory(),
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MediaGroupContent<VideoContent>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MediaGroupContent<VideoContent>>
) = buildMediaGroupTrigger(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = buildMediaGroupTrigger(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)

View File

@@ -29,7 +29,7 @@ internal suspend inline fun <BC : BehaviourContext, reified T : TextedContent> B
username: Username, username: Username,
initialFilter: CommonMessageFilter<T>? = null, initialFilter: CommonMessageFilter<T>? = null,
noinline subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<T>, Update>? = null, noinline subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<T>, Update>? = null,
markerFactory: MarkerFactory<in CommonMessage<T>, Any> = AnyMarkerFactory(), markerFactory: MarkerFactory<in CommonMessage<T>, Any>? = AnyMarkerFactory(),
noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<T>> noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<T>>
) = onContentMessageWithType<BC, T>( ) = onContentMessageWithType<BC, T>(
initialFilter * { initialFilter * {
@@ -44,7 +44,7 @@ internal suspend inline fun <BC : BehaviourContext, reified T : TextedContent> B
userId: UserId, userId: UserId,
initialFilter: CommonMessageFilter<T>? = null, initialFilter: CommonMessageFilter<T>? = null,
noinline subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<T>, Update>? = null, noinline subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<T>, Update>? = null,
markerFactory: MarkerFactory<in CommonMessage<T>, Any> = AnyMarkerFactory(), markerFactory: MarkerFactory<in CommonMessage<T>, Any>? = AnyMarkerFactory(),
noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<T>> noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<T>>
) = onContentMessageWithType<BC, T>( ) = onContentMessageWithType<BC, T>(
initialFilter * { initialFilter * {
@@ -59,7 +59,7 @@ internal suspend inline fun <BC : BehaviourContext, reified T : TextedContent> B
user: User, user: User,
initialFilter: CommonMessageFilter<T>? = null, initialFilter: CommonMessageFilter<T>? = null,
noinline subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<T>, Update>? = null, noinline subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<T>, Update>? = null,
markerFactory: MarkerFactory<in CommonMessage<T>, Any> = AnyMarkerFactory(), markerFactory: MarkerFactory<in CommonMessage<T>, Any>? = AnyMarkerFactory(),
noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<T>> noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<T>>
) = onContentMessageWithType<BC, T>( ) = onContentMessageWithType<BC, T>(
initialFilter * { initialFilter * {
@@ -71,287 +71,452 @@ internal suspend inline fun <BC : BehaviourContext, reified T : TextedContent> B
) )
/**
* @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.onMentionWithAnyContent( suspend fun <BC : BehaviourContext> BC.onMentionWithAnyContent(
username: Username, username: Username,
initialFilter: CommonMessageFilter<TextedContent>? = null, initialFilter: CommonMessageFilter<TextedContent>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<TextedContent>, Update>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<TextedContent>, Update>? = null,
markerFactory: MarkerFactory<in CommonMessage<TextedContent>, Any> = AnyMarkerFactory(), markerFactory: MarkerFactory<in CommonMessage<TextedContent>, Any>? = AnyMarkerFactory(),
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<TextedContent>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<TextedContent>>
) = onMention(username, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = onMention(username, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
/**
* @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.onTextMentionWithAnyContent( suspend fun <BC : BehaviourContext> BC.onTextMentionWithAnyContent(
userId: UserId, userId: UserId,
initialFilter: CommonMessageFilter<TextedContent>? = null, initialFilter: CommonMessageFilter<TextedContent>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<TextedContent>, Update>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<TextedContent>, Update>? = null,
markerFactory: MarkerFactory<in CommonMessage<TextedContent>, Any> = AnyMarkerFactory(), markerFactory: MarkerFactory<in CommonMessage<TextedContent>, Any>? = AnyMarkerFactory(),
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<TextedContent>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<TextedContent>>
) = onTextMention(userId, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = onTextMention(userId, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
/**
* @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.onMentionWithAnyContent( suspend fun <BC : BehaviourContext> BC.onMentionWithAnyContent(
user: User, user: User,
initialFilter: CommonMessageFilter<TextedContent>? = null, initialFilter: CommonMessageFilter<TextedContent>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<TextedContent>, Update>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<TextedContent>, Update>? = null,
markerFactory: MarkerFactory<in CommonMessage<TextedContent>, Any> = AnyMarkerFactory(), markerFactory: MarkerFactory<in CommonMessage<TextedContent>, Any>? = AnyMarkerFactory(),
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<TextedContent>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<TextedContent>>
) = onMention(user, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = onMention(user, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
/**
* @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.onMentionWithVoiceContent( suspend fun <BC : BehaviourContext> BC.onMentionWithVoiceContent(
username: Username, username: Username,
initialFilter: CommonMessageFilter<VoiceContent>? = null, initialFilter: CommonMessageFilter<VoiceContent>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<VoiceContent>, Update>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<VoiceContent>, Update>? = null,
markerFactory: MarkerFactory<in CommonMessage<VoiceContent>, Any> = AnyMarkerFactory(), markerFactory: MarkerFactory<in CommonMessage<VoiceContent>, Any>? = AnyMarkerFactory(),
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<VoiceContent>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<VoiceContent>>
) = onMention(username, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = onMention(username, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
/**
* @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.onTextMentionWithVoiceContent( suspend fun <BC : BehaviourContext> BC.onTextMentionWithVoiceContent(
userId: UserId, userId: UserId,
initialFilter: CommonMessageFilter<VoiceContent>? = null, initialFilter: CommonMessageFilter<VoiceContent>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<VoiceContent>, Update>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<VoiceContent>, Update>? = null,
markerFactory: MarkerFactory<in CommonMessage<VoiceContent>, Any> = AnyMarkerFactory(), markerFactory: MarkerFactory<in CommonMessage<VoiceContent>, Any>? = AnyMarkerFactory(),
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<VoiceContent>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<VoiceContent>>
) = onTextMention(userId, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = onTextMention(userId, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
/**
* @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.onMentionWithVoiceContent( suspend fun <BC : BehaviourContext> BC.onMentionWithVoiceContent(
user: User, user: User,
initialFilter: CommonMessageFilter<VoiceContent>? = null, initialFilter: CommonMessageFilter<VoiceContent>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<VoiceContent>, Update>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<VoiceContent>, Update>? = null,
markerFactory: MarkerFactory<in CommonMessage<VoiceContent>, Any> = AnyMarkerFactory(), markerFactory: MarkerFactory<in CommonMessage<VoiceContent>, Any>? = AnyMarkerFactory(),
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<VoiceContent>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<VoiceContent>>
) = onMention(user, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = onMention(user, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
/**
* @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.onMentionWithMediaGroupContent( suspend fun <BC : BehaviourContext> BC.onMentionWithMediaGroupContent(
username: Username, username: Username,
initialFilter: CommonMessageFilter<MediaGroupContent<MediaGroupPartContent>>? = null, initialFilter: CommonMessageFilter<MediaGroupContent<MediaGroupPartContent>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<MediaGroupContent<MediaGroupPartContent>>, Update>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<MediaGroupContent<MediaGroupPartContent>>, Update>? = null,
markerFactory: MarkerFactory<in CommonMessage<MediaGroupPartContent>, Any> = AnyMarkerFactory(), markerFactory: MarkerFactory<in CommonMessage<MediaGroupPartContent>, Any>? = AnyMarkerFactory(),
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<MediaGroupContent<MediaGroupPartContent>>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<MediaGroupContent<MediaGroupPartContent>>>
) = onMention(username, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = onMention(username, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
/**
* @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.onTextMentionWithMediaGroupContent( suspend fun <BC : BehaviourContext> BC.onTextMentionWithMediaGroupContent(
userId: UserId, userId: UserId,
initialFilter: CommonMessageFilter<MediaGroupContent<MediaGroupPartContent>>? = null, initialFilter: CommonMessageFilter<MediaGroupContent<MediaGroupPartContent>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<MediaGroupContent<MediaGroupPartContent>>, Update>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<MediaGroupContent<MediaGroupPartContent>>, Update>? = null,
markerFactory: MarkerFactory<in CommonMessage<MediaGroupContent<MediaGroupPartContent>>, Any> = AnyMarkerFactory(), markerFactory: MarkerFactory<in CommonMessage<MediaGroupContent<MediaGroupPartContent>>, Any>? = AnyMarkerFactory(),
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<MediaGroupContent<MediaGroupPartContent>>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<MediaGroupContent<MediaGroupPartContent>>>
) = onTextMention(userId, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = onTextMention(userId, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
/**
* @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.onMentionWithMediaGroupContent( suspend fun <BC : BehaviourContext> BC.onMentionWithMediaGroupContent(
user: User, user: User,
initialFilter: CommonMessageFilter<MediaGroupContent<MediaGroupPartContent>>? = null, initialFilter: CommonMessageFilter<MediaGroupContent<MediaGroupPartContent>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<MediaGroupContent<MediaGroupPartContent>>, Update>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<MediaGroupContent<MediaGroupPartContent>>, Update>? = null,
markerFactory: MarkerFactory<in CommonMessage<MediaGroupContent<MediaGroupPartContent>>, Any> = AnyMarkerFactory(), markerFactory: MarkerFactory<in CommonMessage<MediaGroupContent<MediaGroupPartContent>>, Any>? = AnyMarkerFactory(),
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<MediaGroupContent<MediaGroupPartContent>>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<MediaGroupContent<MediaGroupPartContent>>>
) = onMention(user, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = onMention(user, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
/**
* @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.onMentionWithMediaGroupPartContent( suspend fun <BC : BehaviourContext> BC.onMentionWithMediaGroupPartContent(
username: Username, username: Username,
initialFilter: CommonMessageFilter<MediaGroupPartContent>? = null, initialFilter: CommonMessageFilter<MediaGroupPartContent>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<MediaGroupPartContent>, Update>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<MediaGroupPartContent>, Update>? = null,
markerFactory: MarkerFactory<in CommonMessage<MediaGroupPartContent>, Any> = AnyMarkerFactory(), markerFactory: MarkerFactory<in CommonMessage<MediaGroupPartContent>, Any>? = AnyMarkerFactory(),
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<MediaGroupPartContent>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<MediaGroupPartContent>>
) = onMention(username, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = onMention(username, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
/**
* @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.onTextMentionWithMediaGroupPartContent( suspend fun <BC : BehaviourContext> BC.onTextMentionWithMediaGroupPartContent(
userId: UserId, userId: UserId,
initialFilter: CommonMessageFilter<MediaGroupPartContent>? = null, initialFilter: CommonMessageFilter<MediaGroupPartContent>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<MediaGroupPartContent>, Update>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<MediaGroupPartContent>, Update>? = null,
markerFactory: MarkerFactory<in CommonMessage<MediaGroupPartContent>, Any> = AnyMarkerFactory(), markerFactory: MarkerFactory<in CommonMessage<MediaGroupPartContent>, Any>? = AnyMarkerFactory(),
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<MediaGroupPartContent>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<MediaGroupPartContent>>
) = onTextMention(userId, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = onTextMention(userId, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
/**
* @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.onMentionWithMediaGroupPartContent( suspend fun <BC : BehaviourContext> BC.onMentionWithMediaGroupPartContent(
user: User, user: User,
initialFilter: CommonMessageFilter<MediaGroupPartContent>? = null, initialFilter: CommonMessageFilter<MediaGroupPartContent>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<MediaGroupPartContent>, Update>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<MediaGroupPartContent>, Update>? = null,
markerFactory: MarkerFactory<in CommonMessage<MediaGroupPartContent>, Any> = AnyMarkerFactory(), markerFactory: MarkerFactory<in CommonMessage<MediaGroupPartContent>, Any>? = AnyMarkerFactory(),
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<MediaGroupPartContent>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<MediaGroupPartContent>>
) = onMention(user, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = onMention(user, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
/**
* @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.onMentionWithAudioContent( suspend fun <BC : BehaviourContext> BC.onMentionWithAudioContent(
username: Username, username: Username,
initialFilter: CommonMessageFilter<AudioContent>? = null, initialFilter: CommonMessageFilter<AudioContent>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<AudioContent>, Update>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<AudioContent>, Update>? = null,
markerFactory: MarkerFactory<in CommonMessage<AudioContent>, Any> = AnyMarkerFactory(), markerFactory: MarkerFactory<in CommonMessage<AudioContent>, Any>? = AnyMarkerFactory(),
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<AudioContent>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<AudioContent>>
) = onMention(username, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = onMention(username, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
/**
* @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.onTextMentionWithAudioContent( suspend fun <BC : BehaviourContext> BC.onTextMentionWithAudioContent(
userId: UserId, userId: UserId,
initialFilter: CommonMessageFilter<AudioContent>? = null, initialFilter: CommonMessageFilter<AudioContent>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<AudioContent>, Update>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<AudioContent>, Update>? = null,
markerFactory: MarkerFactory<in CommonMessage<AudioContent>, Any> = AnyMarkerFactory(), markerFactory: MarkerFactory<in CommonMessage<AudioContent>, Any>? = AnyMarkerFactory(),
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<AudioContent>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<AudioContent>>
) = onTextMention(userId, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = onTextMention(userId, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
/**
* @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.onMentionWithAudioContent( suspend fun <BC : BehaviourContext> BC.onMentionWithAudioContent(
user: User, user: User,
initialFilter: CommonMessageFilter<AudioContent>? = null, initialFilter: CommonMessageFilter<AudioContent>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<AudioContent>, Update>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<AudioContent>, Update>? = null,
markerFactory: MarkerFactory<in CommonMessage<AudioContent>, Any> = AnyMarkerFactory(), markerFactory: MarkerFactory<in CommonMessage<AudioContent>, Any>? = AnyMarkerFactory(),
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<AudioContent>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<AudioContent>>
) = onMention(user, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = onMention(user, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
/**
* @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.onMentionWithDocumentContent( suspend fun <BC : BehaviourContext> BC.onMentionWithDocumentContent(
username: Username, username: Username,
initialFilter: CommonMessageFilter<DocumentContent>? = null, initialFilter: CommonMessageFilter<DocumentContent>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<DocumentContent>, Update>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<DocumentContent>, Update>? = null,
markerFactory: MarkerFactory<in CommonMessage<DocumentContent>, Any> = AnyMarkerFactory(), markerFactory: MarkerFactory<in CommonMessage<DocumentContent>, Any>? = AnyMarkerFactory(),
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<DocumentContent>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<DocumentContent>>
) = onMention(username, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = onMention(username, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
/**
* @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.onTextMentionWithDocumentContent( suspend fun <BC : BehaviourContext> BC.onTextMentionWithDocumentContent(
userId: UserId, userId: UserId,
initialFilter: CommonMessageFilter<DocumentContent>? = null, initialFilter: CommonMessageFilter<DocumentContent>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<DocumentContent>, Update>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<DocumentContent>, Update>? = null,
markerFactory: MarkerFactory<in CommonMessage<DocumentContent>, Any> = AnyMarkerFactory(), markerFactory: MarkerFactory<in CommonMessage<DocumentContent>, Any>? = AnyMarkerFactory(),
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<DocumentContent>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<DocumentContent>>
) = onTextMention(userId, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = onTextMention(userId, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
/**
* @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.onMentionWithDocumentContent( suspend fun <BC : BehaviourContext> BC.onMentionWithDocumentContent(
user: User, user: User,
initialFilter: CommonMessageFilter<DocumentContent>? = null, initialFilter: CommonMessageFilter<DocumentContent>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<DocumentContent>, Update>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<DocumentContent>, Update>? = null,
markerFactory: MarkerFactory<in CommonMessage<DocumentContent>, Any> = AnyMarkerFactory(), markerFactory: MarkerFactory<in CommonMessage<DocumentContent>, Any>? = AnyMarkerFactory(),
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<DocumentContent>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<DocumentContent>>
) = onMention(user, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = onMention(user, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
/**
* @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.onMentionWithVisualMediaGroupPartContent( suspend fun <BC : BehaviourContext> BC.onMentionWithVisualMediaGroupPartContent(
username: Username, username: Username,
initialFilter: CommonMessageFilter<VisualMediaGroupPartContent>? = null, initialFilter: CommonMessageFilter<VisualMediaGroupPartContent>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<VisualMediaGroupPartContent>, Update>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<VisualMediaGroupPartContent>, Update>? = null,
markerFactory: MarkerFactory<in CommonMessage<VisualMediaGroupPartContent>, Any> = AnyMarkerFactory(), markerFactory: MarkerFactory<in CommonMessage<VisualMediaGroupPartContent>, Any>? = AnyMarkerFactory(),
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<VisualMediaGroupPartContent>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<VisualMediaGroupPartContent>>
) = onMention(username, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = onMention(username, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
/**
* @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.onTextMentionWithVisualMediaGroupPartContent( suspend fun <BC : BehaviourContext> BC.onTextMentionWithVisualMediaGroupPartContent(
userId: UserId, userId: UserId,
initialFilter: CommonMessageFilter<VisualMediaGroupPartContent>? = null, initialFilter: CommonMessageFilter<VisualMediaGroupPartContent>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<VisualMediaGroupPartContent>, Update>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<VisualMediaGroupPartContent>, Update>? = null,
markerFactory: MarkerFactory<in CommonMessage<VisualMediaGroupPartContent>, Any> = AnyMarkerFactory(), markerFactory: MarkerFactory<in CommonMessage<VisualMediaGroupPartContent>, Any>? = AnyMarkerFactory(),
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<VisualMediaGroupPartContent>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<VisualMediaGroupPartContent>>
) = onTextMention(userId, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = onTextMention(userId, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
/**
* @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.onMentionWithVisualMediaGroupPartContent( suspend fun <BC : BehaviourContext> BC.onMentionWithVisualMediaGroupPartContent(
user: User, user: User,
initialFilter: CommonMessageFilter<VisualMediaGroupPartContent>? = null, initialFilter: CommonMessageFilter<VisualMediaGroupPartContent>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<VisualMediaGroupPartContent>, Update>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<VisualMediaGroupPartContent>, Update>? = null,
markerFactory: MarkerFactory<in CommonMessage<VisualMediaGroupPartContent>, Any> = AnyMarkerFactory(), markerFactory: MarkerFactory<in CommonMessage<VisualMediaGroupPartContent>, Any>? = AnyMarkerFactory(),
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<VisualMediaGroupPartContent>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<VisualMediaGroupPartContent>>
) = onMention(user, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = onMention(user, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
/**
* @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.onMentionWithVideoContent( suspend fun <BC : BehaviourContext> BC.onMentionWithVideoContent(
username: Username, username: Username,
initialFilter: CommonMessageFilter<VideoContent>? = null, initialFilter: CommonMessageFilter<VideoContent>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<VideoContent>, Update>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<VideoContent>, Update>? = null,
markerFactory: MarkerFactory<in CommonMessage<VideoContent>, Any> = AnyMarkerFactory(), markerFactory: MarkerFactory<in CommonMessage<VideoContent>, Any>? = AnyMarkerFactory(),
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<VideoContent>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<VideoContent>>
) = onMention(username, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = onMention(username, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
/**
* @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.onTextMentionWithVideoContent( suspend fun <BC : BehaviourContext> BC.onTextMentionWithVideoContent(
userId: UserId, userId: UserId,
initialFilter: CommonMessageFilter<VideoContent>? = null, initialFilter: CommonMessageFilter<VideoContent>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<VideoContent>, Update>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<VideoContent>, Update>? = null,
markerFactory: MarkerFactory<in CommonMessage<VideoContent>, Any> = AnyMarkerFactory(), markerFactory: MarkerFactory<in CommonMessage<VideoContent>, Any>? = AnyMarkerFactory(),
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<VideoContent>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<VideoContent>>
) = onTextMention(userId, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = onTextMention(userId, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
/**
* @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.onMentionWithVideoContent( suspend fun <BC : BehaviourContext> BC.onMentionWithVideoContent(
user: User, user: User,
initialFilter: CommonMessageFilter<VideoContent>? = null, initialFilter: CommonMessageFilter<VideoContent>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<VideoContent>, Update>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<VideoContent>, Update>? = null,
markerFactory: MarkerFactory<in CommonMessage<VideoContent>, Any> = AnyMarkerFactory(), markerFactory: MarkerFactory<in CommonMessage<VideoContent>, Any>? = AnyMarkerFactory(),
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<VideoContent>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<VideoContent>>
) = onMention(user, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = onMention(user, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
/**
* @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.onMentionWithPhotoContent( suspend fun <BC : BehaviourContext> BC.onMentionWithPhotoContent(
username: Username, username: Username,
initialFilter: CommonMessageFilter<PhotoContent>? = null, initialFilter: CommonMessageFilter<PhotoContent>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<PhotoContent>, Update>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<PhotoContent>, Update>? = null,
markerFactory: MarkerFactory<in CommonMessage<PhotoContent>, Any> = AnyMarkerFactory(), markerFactory: MarkerFactory<in CommonMessage<PhotoContent>, Any>? = AnyMarkerFactory(),
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<PhotoContent>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<PhotoContent>>
) = onMention(username, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = onMention(username, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
/**
* @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.onTextMentionWithPhotoContent( suspend fun <BC : BehaviourContext> BC.onTextMentionWithPhotoContent(
userId: UserId, userId: UserId,
initialFilter: CommonMessageFilter<PhotoContent>? = null, initialFilter: CommonMessageFilter<PhotoContent>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<PhotoContent>, Update>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<PhotoContent>, Update>? = null,
markerFactory: MarkerFactory<in CommonMessage<PhotoContent>, Any> = AnyMarkerFactory(), markerFactory: MarkerFactory<in CommonMessage<PhotoContent>, Any>? = AnyMarkerFactory(),
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<PhotoContent>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<PhotoContent>>
) = onTextMention(userId, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = onTextMention(userId, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
/**
* @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.onMentionWithPhotoContent( suspend fun <BC : BehaviourContext> BC.onMentionWithPhotoContent(
user: User, user: User,
initialFilter: CommonMessageFilter<PhotoContent>? = null, initialFilter: CommonMessageFilter<PhotoContent>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<PhotoContent>, Update>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<PhotoContent>, Update>? = null,
markerFactory: MarkerFactory<in CommonMessage<PhotoContent>, Any> = AnyMarkerFactory(), markerFactory: MarkerFactory<in CommonMessage<PhotoContent>, Any>? = AnyMarkerFactory(),
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<PhotoContent>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<PhotoContent>>
) = onMention(user, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = onMention(user, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
/**
* @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.onMentionWithAnimationContent( suspend fun <BC : BehaviourContext> BC.onMentionWithAnimationContent(
username: Username, username: Username,
initialFilter: CommonMessageFilter<AnimationContent>? = null, initialFilter: CommonMessageFilter<AnimationContent>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<AnimationContent>, Update>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<AnimationContent>, Update>? = null,
markerFactory: MarkerFactory<in CommonMessage<AnimationContent>, Any> = AnyMarkerFactory(), markerFactory: MarkerFactory<in CommonMessage<AnimationContent>, Any>? = AnyMarkerFactory(),
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<AnimationContent>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<AnimationContent>>
) = onMention(username, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = onMention(username, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
/**
* @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.onTextMentionWithAnimationContent( suspend fun <BC : BehaviourContext> BC.onTextMentionWithAnimationContent(
userId: UserId, userId: UserId,
initialFilter: CommonMessageFilter<AnimationContent>? = null, initialFilter: CommonMessageFilter<AnimationContent>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<AnimationContent>, Update>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<AnimationContent>, Update>? = null,
markerFactory: MarkerFactory<in CommonMessage<AnimationContent>, Any> = AnyMarkerFactory(), markerFactory: MarkerFactory<in CommonMessage<AnimationContent>, Any>? = AnyMarkerFactory(),
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<AnimationContent>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<AnimationContent>>
) = onTextMention(userId, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = onTextMention(userId, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
/**
* @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.onMentionWithAnimationContent( suspend fun <BC : BehaviourContext> BC.onMentionWithAnimationContent(
user: User, user: User,
initialFilter: CommonMessageFilter<AnimationContent>? = null, initialFilter: CommonMessageFilter<AnimationContent>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<AnimationContent>, Update>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<AnimationContent>, Update>? = null,
markerFactory: MarkerFactory<in CommonMessage<AnimationContent>, Any> = AnyMarkerFactory(), markerFactory: MarkerFactory<in CommonMessage<AnimationContent>, Any>? = AnyMarkerFactory(),
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<AnimationContent>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<AnimationContent>>
) = onMention(user, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = onMention(user, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
/**
* @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.onMentionWithTextContent( suspend fun <BC : BehaviourContext> BC.onMentionWithTextContent(
username: Username, username: Username,
initialFilter: CommonMessageFilter<TextContent>? = null, initialFilter: CommonMessageFilter<TextContent>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<TextContent>, Update>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<TextContent>, Update>? = null,
markerFactory: MarkerFactory<in CommonMessage<TextContent>, Any> = AnyMarkerFactory(), markerFactory: MarkerFactory<in CommonMessage<TextContent>, Any>? = AnyMarkerFactory(),
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<TextContent>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<TextContent>>
) = onMention(username, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = onMention(username, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
/**
* @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.onTextMentionWithTextContent( suspend fun <BC : BehaviourContext> BC.onTextMentionWithTextContent(
userId: UserId, userId: UserId,
initialFilter: CommonMessageFilter<TextContent>? = null, initialFilter: CommonMessageFilter<TextContent>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<TextContent>, Update>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<TextContent>, Update>? = null,
markerFactory: MarkerFactory<in CommonMessage<TextContent>, Any> = AnyMarkerFactory(), markerFactory: MarkerFactory<in CommonMessage<TextContent>, Any>? = AnyMarkerFactory(),
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<TextContent>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<TextContent>>
) = onTextMention(userId, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = onTextMention(userId, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
/**
* @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.onMentionWithTextContent( suspend fun <BC : BehaviourContext> BC.onMentionWithTextContent(
user: User, user: User,
initialFilter: CommonMessageFilter<TextContent>? = null, initialFilter: CommonMessageFilter<TextContent>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<TextContent>, Update>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<TextContent>, Update>? = null,
markerFactory: MarkerFactory<in CommonMessage<TextContent>, Any> = AnyMarkerFactory(), markerFactory: MarkerFactory<in CommonMessage<TextContent>, Any>? = AnyMarkerFactory(),
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<TextContent>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<TextContent>>
) = onMention(user, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) ) = onMention(user, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)

View File

@@ -14,7 +14,7 @@ import dev.inmo.tgbotapi.types.update.abstracts.Update
internal suspend inline fun <BC : BehaviourContext, reified T : EncryptedPassportElement> BC.onPassportMessageWith( internal suspend inline fun <BC : BehaviourContext, reified T : EncryptedPassportElement> BC.onPassportMessageWith(
initialFilter: SimpleFilter<PassportMessage>? = null, initialFilter: SimpleFilter<PassportMessage>? = null,
noinline subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, PassportMessage, Update>? = MessageFilterByChat, noinline subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, PassportMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in PassportMessage, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in PassportMessage, Any>? = ByChatMessageMarkerFactory,
noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, PassportMessage> noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, PassportMessage>
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) { ) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
(it.messageUpdateOrNull() ?.data ?.passportMessageOrNull() ?.takeIf { it.passportData.data.any { it is T } }) ?.let(::listOfNotNull) (it.messageUpdateOrNull() ?.data ?.passportMessageOrNull() ?.takeIf { it.passportData.data.any { it is T } }) ?.let(::listOfNotNull)
@@ -28,15 +28,16 @@ internal suspend inline fun <BC : BehaviourContext, reified T : EncryptedPasspor
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onPassportMessage( suspend fun <BC : BehaviourContext> BC.onPassportMessage(
initialFilter: SimpleFilter<PassportMessage>? = null, initialFilter: SimpleFilter<PassportMessage>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, PassportMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, PassportMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in PassportMessage, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in PassportMessage, Any>? = ByChatMessageMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, PassportMessage> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, PassportMessage>
) = onPassportMessageWith<BC, EncryptedPassportElement>( ) = onPassportMessageWith<BC, EncryptedPassportElement>(
initialFilter, initialFilter,

View File

@@ -13,7 +13,7 @@ import dev.inmo.tgbotapi.types.update.abstracts.Update
internal suspend inline fun <BC : BehaviourContext> BC.onPollAnswered( internal suspend inline fun <BC : BehaviourContext> BC.onPollAnswered(
initialFilter: SimpleFilter<PollAnswer>? = null, initialFilter: SimpleFilter<PollAnswer>? = null,
noinline subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, PollAnswer, Update>? = null, noinline subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, PollAnswer, Update>? = null,
markerFactory: MarkerFactory<in PollAnswer, Any> = ByIdPollAnswerMarkerFactory, markerFactory: MarkerFactory<in PollAnswer, Any>? = ByIdPollAnswerMarkerFactory,
noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, PollAnswer> noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, PollAnswer>
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) { ) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
(it.pollAnswerUpdateOrNull() ?.data) ?.let(::listOfNotNull) (it.pollAnswerUpdateOrNull() ?.data) ?.let(::listOfNotNull)
@@ -26,15 +26,16 @@ internal suspend inline fun <BC : BehaviourContext> BC.onPollAnswered(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onPollAnswer( suspend fun <BC : BehaviourContext> BC.onPollAnswer(
initialFilter: SimpleFilter<PollAnswer>? = null, initialFilter: SimpleFilter<PollAnswer>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, PollAnswer, Update>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, PollAnswer, Update>? = null,
markerFactory: MarkerFactory<in PollAnswer, Any> = ByIdPollAnswerMarkerFactory, markerFactory: MarkerFactory<in PollAnswer, Any>? = ByIdPollAnswerMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, PollAnswer> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, PollAnswer>
) = onPollAnswered( ) = onPollAnswered(
initialFilter, initialFilter,

View File

@@ -13,7 +13,7 @@ import dev.inmo.tgbotapi.types.update.abstracts.Update
internal suspend inline fun <BC : BehaviourContext, reified T : Poll> BC.onPollUpdatedBase( internal suspend inline fun <BC : BehaviourContext, reified T : Poll> BC.onPollUpdatedBase(
initialFilter: SimpleFilter<T>? = null, initialFilter: SimpleFilter<T>? = null,
noinline subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, T, Update>? = null, noinline subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, T, Update>? = null,
markerFactory: MarkerFactory<in T, Any> = ByIdPollMarkerFactory, markerFactory: MarkerFactory<in T, Any>? = ByIdPollMarkerFactory,
noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, T> noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, T>
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) { ) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
(it.pollUpdateOrNull() ?.data as? T) ?.let(::listOfNotNull) (it.pollUpdateOrNull() ?.data as? T) ?.let(::listOfNotNull)
@@ -26,15 +26,16 @@ internal suspend inline fun <BC : BehaviourContext, reified T : Poll> BC.onPollU
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onPollUpdates( suspend fun <BC : BehaviourContext> BC.onPollUpdates(
initialFilter: SimpleFilter<Poll>? = null, initialFilter: SimpleFilter<Poll>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, Poll, Update>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, Poll, Update>? = null,
markerFactory: MarkerFactory<in Poll, Any> = ByIdPollMarkerFactory, markerFactory: MarkerFactory<in Poll, Any>? = ByIdPollMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, Poll> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, Poll>
) = onPollUpdatedBase( ) = onPollUpdatedBase(
initialFilter, initialFilter,
@@ -50,15 +51,16 @@ suspend fun <BC : BehaviourContext> BC.onPollUpdates(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onRegularPollUpdates( suspend fun <BC : BehaviourContext> BC.onRegularPollUpdates(
initialFilter: SimpleFilter<RegularPoll>? = null, initialFilter: SimpleFilter<RegularPoll>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, RegularPoll, Update>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, RegularPoll, Update>? = null,
markerFactory: MarkerFactory<in RegularPoll, Any> = ByIdPollMarkerFactory, markerFactory: MarkerFactory<in RegularPoll, Any>? = ByIdPollMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, RegularPoll> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, RegularPoll>
) = onPollUpdatedBase( ) = onPollUpdatedBase(
initialFilter, initialFilter,
@@ -74,15 +76,16 @@ suspend fun <BC : BehaviourContext> BC.onRegularPollUpdates(
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onQuizPollUpdates( suspend fun <BC : BehaviourContext> BC.onQuizPollUpdates(
initialFilter: SimpleFilter<QuizPoll>? = null, initialFilter: SimpleFilter<QuizPoll>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, QuizPoll, Update>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, QuizPoll, Update>? = null,
markerFactory: MarkerFactory<in QuizPoll, Any> = ByIdPollMarkerFactory, markerFactory: MarkerFactory<in QuizPoll, Any>? = ByIdPollMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, QuizPoll> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, QuizPoll>
) = onPollUpdatedBase( ) = onPollUpdatedBase(
initialFilter, initialFilter,

View File

@@ -20,15 +20,16 @@ import dev.inmo.tgbotapi.types.update.abstracts.Update
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onPreCheckoutQuery( suspend fun <BC : BehaviourContext> BC.onPreCheckoutQuery(
initialFilter: SimpleFilter<PreCheckoutQuery>? = null, initialFilter: SimpleFilter<PreCheckoutQuery>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, PreCheckoutQuery, Update>? = PreCheckoutQueryFilterByUser, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, PreCheckoutQuery, Update>? = PreCheckoutQueryFilterByUser,
markerFactory: MarkerFactory<in PreCheckoutQuery, Any> = ByUserPreCheckoutQueryMarkerFactory, markerFactory: MarkerFactory<in PreCheckoutQuery, Any>? = ByUserPreCheckoutQueryMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, PreCheckoutQuery> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, PreCheckoutQuery>
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) { ) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
(it.preCheckoutQueryUpdateOrNull() ?.data) ?.let(::listOfNotNull) (it.preCheckoutQueryUpdateOrNull() ?.data) ?.let(::listOfNotNull)

View File

@@ -20,15 +20,16 @@ import dev.inmo.tgbotapi.types.update.abstracts.Update
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters * to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* in one "stream". Output of [markerFactory] will be used as a key for "stream" * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data * data
*/ */
suspend fun <BC : BehaviourContext> BC.onShippingQuery( suspend fun <BC : BehaviourContext> BC.onShippingQuery(
initialFilter: SimpleFilter<ShippingQuery>? = null, initialFilter: SimpleFilter<ShippingQuery>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ShippingQuery, Update>? = ShippingQueryFilterByUser, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ShippingQuery, Update>? = ShippingQueryFilterByUser,
markerFactory: MarkerFactory<in ShippingQuery, Any> = ByUserShippingQueryMarkerFactory, markerFactory: MarkerFactory<in ShippingQuery, Any>? = ByUserShippingQueryMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ShippingQuery> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ShippingQuery>
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) { ) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
(it.shippingQueryUpdateOrNull() ?.data) ?.let(::listOfNotNull) (it.shippingQueryUpdateOrNull() ?.data) ?.let(::listOfNotNull)

File diff suppressed because it is too large Load Diff

View File

@@ -8,7 +8,7 @@ import dev.inmo.tgbotapi.types.payments.abstracts.Priced
interface CommonSendInvoiceData : Titled, Currencied, Priced { interface CommonSendInvoiceData : Titled, Currencied, Priced {
val description: String val description: String
val payload: String val payload: String
val providerToken: String val providerToken: String?
val maxTipAmount: Int? val maxTipAmount: Int?
val suggestedTipAmounts: List<Int>? val suggestedTipAmounts: List<Int>?
val providerData: String? val providerData: String?

View File

@@ -0,0 +1,5 @@
package dev.inmo.tgbotapi.abstracts
interface WithCustomizableCaption : Texted {
val showCaptionAboveMedia: Boolean
}

View File

@@ -0,0 +1,7 @@
package dev.inmo.tgbotapi.abstracts.types
import dev.inmo.tgbotapi.types.EffectId
interface OptionallyWithEffectId {
val effectId: EffectId?
}

View File

@@ -1,9 +1,11 @@
package dev.inmo.tgbotapi.requests package dev.inmo.tgbotapi.requests
import dev.inmo.tgbotapi.abstracts.types.MessageAction import dev.inmo.tgbotapi.abstracts.types.MessageAction
import dev.inmo.tgbotapi.abstracts.types.OptionallyBusinessConnectionRequest
import dev.inmo.tgbotapi.abstracts.types.WithReplyMarkup import dev.inmo.tgbotapi.abstracts.types.WithReplyMarkup
import dev.inmo.tgbotapi.requests.abstracts.SimpleRequest import dev.inmo.tgbotapi.requests.abstracts.SimpleRequest
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
import dev.inmo.tgbotapi.types.polls.Poll import dev.inmo.tgbotapi.types.polls.Poll
import dev.inmo.tgbotapi.types.polls.PollSerializer import dev.inmo.tgbotapi.types.polls.PollSerializer
@@ -15,9 +17,11 @@ data class StopPoll(
override val chatId: ChatIdentifier, override val chatId: ChatIdentifier,
@SerialName(messageIdField) @SerialName(messageIdField)
override val messageId: MessageId, override val messageId: MessageId,
@SerialName(businessConnectionIdField)
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
@SerialName(replyMarkupField) @SerialName(replyMarkupField)
override val replyMarkup: InlineKeyboardMarkup? = null override val replyMarkup: InlineKeyboardMarkup? = null
) : MessageAction, SimpleRequest<Poll>, WithReplyMarkup { ) : MessageAction, SimpleRequest<Poll>, WithReplyMarkup, OptionallyBusinessConnectionRequest {
override fun method(): String = "stopPoll" override fun method(): String = "stopPoll"
override val resultDeserializer: DeserializationStrategy<Poll> override val resultDeserializer: DeserializationStrategy<Poll>
get() = PollSerializer get() = PollSerializer

View File

@@ -1,8 +1,9 @@
package dev.inmo.tgbotapi.requests.edit.abstracts package dev.inmo.tgbotapi.requests.edit.abstracts
import dev.inmo.tgbotapi.abstracts.types.MessageAction import dev.inmo.tgbotapi.abstracts.types.MessageAction
import dev.inmo.tgbotapi.abstracts.types.OptionallyBusinessConnectionRequest
import dev.inmo.tgbotapi.requests.abstracts.SimpleRequest import dev.inmo.tgbotapi.requests.abstracts.SimpleRequest
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
import dev.inmo.tgbotapi.types.message.content.MessageContent import dev.inmo.tgbotapi.types.message.content.MessageContent
interface EditChatMessage<MT: MessageContent> : SimpleRequest<ContentMessage<MT>>, MessageAction interface EditChatMessage<MT: MessageContent> : SimpleRequest<ContentMessage<MT>>, MessageAction, OptionallyBusinessConnectionRequest

View File

@@ -2,7 +2,9 @@ package dev.inmo.tgbotapi.requests.edit.caption
import dev.inmo.tgbotapi.requests.edit.abstracts.* import dev.inmo.tgbotapi.requests.edit.abstracts.*
import dev.inmo.tgbotapi.requests.edit.media.MediaContentMessageResultDeserializer import dev.inmo.tgbotapi.requests.edit.media.MediaContentMessageResultDeserializer
import dev.inmo.tgbotapi.requests.send.abstracts.WithCustomizableCaptionRequest
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
import dev.inmo.tgbotapi.types.message.ParseMode import dev.inmo.tgbotapi.types.message.ParseMode
import dev.inmo.tgbotapi.types.message.parseModeField import dev.inmo.tgbotapi.types.message.parseModeField
@@ -22,28 +24,36 @@ fun EditChatMessageCaption(
messageId: MessageId, messageId: MessageId,
text: String, text: String,
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
showCaptionAboveMedia: Boolean = false,
replyMarkup: InlineKeyboardMarkup? = null replyMarkup: InlineKeyboardMarkup? = null
) = EditChatMessageCaption( ) = EditChatMessageCaption(
chatId, chatId = chatId,
messageId, messageId = messageId,
text, text = text,
parseMode, parseMode = parseMode,
null, rawEntities = null,
replyMarkup businessConnectionId = businessConnectionId,
showCaptionAboveMedia = showCaptionAboveMedia,
replyMarkup = replyMarkup
) )
fun EditChatMessageCaption( fun EditChatMessageCaption(
chatId: ChatIdentifier, chatId: ChatIdentifier,
messageId: MessageId, messageId: MessageId,
entities: TextSourcesList, entities: TextSourcesList,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
showCaptionAboveMedia: Boolean = false,
replyMarkup: InlineKeyboardMarkup? = null replyMarkup: InlineKeyboardMarkup? = null
) = EditChatMessageCaption( ) = EditChatMessageCaption(
chatId, chatId = chatId,
messageId, messageId = messageId,
entities.makeString(), text = entities.makeString(),
null, parseMode = null,
entities.toRawMessageEntities(), rawEntities = entities.toRawMessageEntities(),
replyMarkup businessConnectionId = businessConnectionId,
showCaptionAboveMedia = showCaptionAboveMedia,
replyMarkup = replyMarkup
) )
@Serializable @Serializable
@@ -58,9 +68,13 @@ data class EditChatMessageCaption internal constructor(
override val parseMode: ParseMode? = null, override val parseMode: ParseMode? = null,
@SerialName(captionEntitiesField) @SerialName(captionEntitiesField)
private val rawEntities: List<RawMessageEntity>? = null, private val rawEntities: List<RawMessageEntity>? = null,
@SerialName(businessConnectionIdField)
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
@SerialName(showCaptionAboveMediaField)
override val showCaptionAboveMedia: Boolean = false,
@SerialName(replyMarkupField) @SerialName(replyMarkupField)
override val replyMarkup: InlineKeyboardMarkup? = null override val replyMarkup: InlineKeyboardMarkup? = null
) : EditChatMessage<MediaContent>, EditTextChatMessage, EditReplyMessage { ) : EditChatMessage<MediaContent>, WithCustomizableCaptionRequest<ContentMessage<MediaContent>>, EditTextChatMessage, EditReplyMessage {
override val textSources: TextSourcesList? by lazy { override val textSources: TextSourcesList? by lazy {
rawEntities ?.asTextSources(text) rawEntities ?.asTextSources(text)
} }

View File

@@ -2,7 +2,9 @@ package dev.inmo.tgbotapi.requests.edit.location.live
import dev.inmo.tgbotapi.requests.edit.abstracts.* import dev.inmo.tgbotapi.requests.edit.abstracts.*
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
import dev.inmo.tgbotapi.types.location.LiveLocation
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass
import dev.inmo.tgbotapi.types.message.content.LocationContent import dev.inmo.tgbotapi.types.message.content.LocationContent
@@ -22,12 +24,16 @@ data class EditChatMessageLiveLocation(
override val latitude: Double, override val latitude: Double,
@SerialName(longitudeField) @SerialName(longitudeField)
override val longitude: Double, override val longitude: Double,
@SerialName(livePeriodField)
val livePeriod: Seconds? = null,
@SerialName(horizontalAccuracyField) @SerialName(horizontalAccuracyField)
override val horizontalAccuracy: Meters? = null, override val horizontalAccuracy: Meters? = null,
@SerialName(headingField) @SerialName(headingField)
override val heading: Degrees? = null, override val heading: Degrees? = null,
@SerialName(proximityAlertRadiusField) @SerialName(proximityAlertRadiusField)
override val proximityAlertRadius: Meters? = null, override val proximityAlertRadius: Meters? = null,
@SerialName(businessConnectionIdField)
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
@SerialName(replyMarkupField) @SerialName(replyMarkupField)
override val replyMarkup: InlineKeyboardMarkup? = null override val replyMarkup: InlineKeyboardMarkup? = null
) : EditChatMessage<LocationContent>, EditReplyMessage, EditLocationMessage { ) : EditChatMessage<LocationContent>, EditReplyMessage, EditLocationMessage {

View File

@@ -3,6 +3,7 @@ package dev.inmo.tgbotapi.requests.edit.location.live
import dev.inmo.tgbotapi.requests.edit.abstracts.EditChatMessage import dev.inmo.tgbotapi.requests.edit.abstracts.EditChatMessage
import dev.inmo.tgbotapi.requests.edit.abstracts.EditReplyMessage import dev.inmo.tgbotapi.requests.edit.abstracts.EditReplyMessage
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass
@@ -18,6 +19,8 @@ data class StopChatMessageLiveLocation(
override val chatId: ChatIdentifier, override val chatId: ChatIdentifier,
@SerialName(messageIdField) @SerialName(messageIdField)
override val messageId: MessageId, override val messageId: MessageId,
@SerialName(businessConnectionIdField)
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
@SerialName(replyMarkupField) @SerialName(replyMarkupField)
override val replyMarkup: InlineKeyboardMarkup? = null override val replyMarkup: InlineKeyboardMarkup? = null
) : EditChatMessage<LocationContent>, EditReplyMessage { ) : EditChatMessage<LocationContent>, EditReplyMessage {

View File

@@ -3,6 +3,7 @@ package dev.inmo.tgbotapi.requests.edit.media
import dev.inmo.tgbotapi.requests.abstracts.MultipartFile import dev.inmo.tgbotapi.requests.abstracts.MultipartFile
import dev.inmo.tgbotapi.requests.edit.abstracts.* import dev.inmo.tgbotapi.requests.edit.abstracts.*
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.media.TelegramMedia import dev.inmo.tgbotapi.types.media.TelegramMedia
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
@@ -22,6 +23,8 @@ data class EditChatMessageMedia(
override val messageId: MessageId, override val messageId: MessageId,
@SerialName(mediaField) @SerialName(mediaField)
override val media: TelegramMedia, override val media: TelegramMedia,
@SerialName(businessConnectionIdField)
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
@SerialName(replyMarkupField) @SerialName(replyMarkupField)
override val replyMarkup: InlineKeyboardMarkup? = null override val replyMarkup: InlineKeyboardMarkup? = null
) : EditChatMessage<MediaContent>, EditReplyMessage, EditMediaMessage { ) : EditChatMessage<MediaContent>, EditReplyMessage, EditMediaMessage {

View File

@@ -3,6 +3,7 @@ package dev.inmo.tgbotapi.requests.edit.reply_markup
import dev.inmo.tgbotapi.requests.edit.abstracts.EditChatMessage import dev.inmo.tgbotapi.requests.edit.abstracts.EditChatMessage
import dev.inmo.tgbotapi.requests.edit.abstracts.EditReplyMessage import dev.inmo.tgbotapi.requests.edit.abstracts.EditReplyMessage
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass
@@ -19,6 +20,8 @@ data class EditChatMessageReplyMarkup(
override val chatId: ChatIdentifier, override val chatId: ChatIdentifier,
@SerialName(messageIdField) @SerialName(messageIdField)
override val messageId: MessageId, override val messageId: MessageId,
@SerialName(businessConnectionIdField)
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
@SerialName(replyMarkupField) @SerialName(replyMarkupField)
override val replyMarkup: InlineKeyboardMarkup? = null override val replyMarkup: InlineKeyboardMarkup? = null
) : EditChatMessage<MessageContent>, EditReplyMessage { ) : EditChatMessage<MessageContent>, EditReplyMessage {

View File

@@ -3,6 +3,7 @@ package dev.inmo.tgbotapi.requests.edit.text
import dev.inmo.tgbotapi.requests.edit.abstracts.* import dev.inmo.tgbotapi.requests.edit.abstracts.*
import dev.inmo.tgbotapi.requests.send.TextContentMessageResultDeserializer import dev.inmo.tgbotapi.requests.send.TextContentMessageResultDeserializer
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
import dev.inmo.tgbotapi.types.message.ParseMode import dev.inmo.tgbotapi.types.message.ParseMode
import dev.inmo.tgbotapi.types.message.parseModeField import dev.inmo.tgbotapi.types.message.parseModeField
@@ -22,6 +23,7 @@ fun EditChatMessageText(
messageId: MessageId, messageId: MessageId,
text: String, text: String,
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
linkPreviewOptions: LinkPreviewOptions? = null, linkPreviewOptions: LinkPreviewOptions? = null,
replyMarkup: InlineKeyboardMarkup? = null replyMarkup: InlineKeyboardMarkup? = null
) = EditChatMessageText( ) = EditChatMessageText(
@@ -30,6 +32,7 @@ fun EditChatMessageText(
text, text,
parseMode, parseMode,
null, null,
businessConnectionId,
linkPreviewOptions, linkPreviewOptions,
replyMarkup replyMarkup
) )
@@ -38,6 +41,7 @@ fun EditChatMessageText(
chatId: ChatIdentifier, chatId: ChatIdentifier,
messageId: MessageId, messageId: MessageId,
entities: TextSourcesList, entities: TextSourcesList,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
linkPreviewOptions: LinkPreviewOptions? = null, linkPreviewOptions: LinkPreviewOptions? = null,
replyMarkup: InlineKeyboardMarkup? = null replyMarkup: InlineKeyboardMarkup? = null
) = EditChatMessageText( ) = EditChatMessageText(
@@ -46,6 +50,7 @@ fun EditChatMessageText(
entities.makeString(), entities.makeString(),
null, null,
entities.toRawMessageEntities(), entities.toRawMessageEntities(),
businessConnectionId,
linkPreviewOptions, linkPreviewOptions,
replyMarkup replyMarkup
) )
@@ -62,6 +67,8 @@ data class EditChatMessageText internal constructor(
override val parseMode: ParseMode? = null, override val parseMode: ParseMode? = null,
@SerialName(entitiesField) @SerialName(entitiesField)
private val rawEntities: List<RawMessageEntity>? = null, private val rawEntities: List<RawMessageEntity>? = null,
@SerialName(businessConnectionIdField)
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
@SerialName(linkPreviewOptionsField) @SerialName(linkPreviewOptionsField)
override val linkPreviewOptions: LinkPreviewOptions? = null, override val linkPreviewOptions: LinkPreviewOptions? = null,
@SerialName(replyMarkupField) @SerialName(replyMarkupField)

View File

@@ -1,6 +1,7 @@
package dev.inmo.tgbotapi.requests.edit.text package dev.inmo.tgbotapi.requests.edit.text
import dev.inmo.tgbotapi.requests.edit.abstracts.* import dev.inmo.tgbotapi.requests.edit.abstracts.*
import dev.inmo.tgbotapi.requests.send.abstracts.WithCustomizableCaptionRequest
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
import dev.inmo.tgbotapi.types.message.ParseMode import dev.inmo.tgbotapi.types.message.ParseMode
@@ -16,29 +17,33 @@ fun EditInlineMessageText(
inlineMessageId: InlineMessageId, inlineMessageId: InlineMessageId,
text: String, text: String,
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
showCaptionAboveMedia: Boolean = false,
linkPreviewOptions: LinkPreviewOptions? = null, linkPreviewOptions: LinkPreviewOptions? = null,
replyMarkup: InlineKeyboardMarkup? = null replyMarkup: InlineKeyboardMarkup? = null
) = EditInlineMessageText( ) = EditInlineMessageText(
inlineMessageId, inlineMessageId = inlineMessageId,
text, text = text,
parseMode, parseMode = parseMode,
null, rawEntities = null,
linkPreviewOptions, showCaptionAboveMedia = showCaptionAboveMedia,
replyMarkup linkPreviewOptions = linkPreviewOptions,
replyMarkup = replyMarkup
) )
fun EditInlineMessageText( fun EditInlineMessageText(
inlineMessageId: InlineMessageId, inlineMessageId: InlineMessageId,
entities: TextSourcesList, entities: TextSourcesList,
showCaptionAboveMedia: Boolean = false,
linkPreviewOptions: LinkPreviewOptions? = null, linkPreviewOptions: LinkPreviewOptions? = null,
replyMarkup: InlineKeyboardMarkup? = null replyMarkup: InlineKeyboardMarkup? = null
) = EditInlineMessageText( ) = EditInlineMessageText(
inlineMessageId, inlineMessageId = inlineMessageId,
entities.makeString(), text = entities.makeString(),
null, parseMode = null,
entities.toRawMessageEntities(), rawEntities = entities.toRawMessageEntities(),
linkPreviewOptions, showCaptionAboveMedia = showCaptionAboveMedia,
replyMarkup linkPreviewOptions = linkPreviewOptions,
replyMarkup = replyMarkup
) )
@Serializable @Serializable
@@ -51,11 +56,13 @@ data class EditInlineMessageText internal constructor(
override val parseMode: ParseMode? = null, override val parseMode: ParseMode? = null,
@SerialName(entitiesField) @SerialName(entitiesField)
private val rawEntities: List<RawMessageEntity>? = null, private val rawEntities: List<RawMessageEntity>? = null,
@SerialName(showCaptionAboveMediaField)
override val showCaptionAboveMedia: Boolean = false,
@SerialName(linkPreviewOptionsField) @SerialName(linkPreviewOptionsField)
override val linkPreviewOptions: LinkPreviewOptions? = null, override val linkPreviewOptions: LinkPreviewOptions? = null,
@SerialName(replyMarkupField) @SerialName(replyMarkupField)
override val replyMarkup: InlineKeyboardMarkup? = null override val replyMarkup: InlineKeyboardMarkup? = null
) : EditInlineMessage, EditTextChatMessage, EditReplyMessage, EditLinkPreviewOptionsContainer { ) : EditInlineMessage, WithCustomizableCaptionRequest<Boolean>, EditTextChatMessage, EditReplyMessage, EditLinkPreviewOptionsContainer {
override val textSources: TextSourcesList? by lazy { override val textSources: TextSourcesList? by lazy {
rawEntities ?.asTextSources(text) rawEntities ?.asTextSources(text)
} }

View File

@@ -0,0 +1,23 @@
package dev.inmo.tgbotapi.requests.get
import dev.inmo.tgbotapi.requests.abstracts.SimpleRequest
import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.payments.stars.StarTransactions
import kotlinx.serialization.DeserializationStrategy
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
import kotlinx.serialization.SerializationStrategy
@Serializable
data class GetStarTransactions(
@SerialName(offsetField)
val offset: Int? = null,
@SerialName(limitField)
val limit: Int? = null,
) : SimpleRequest<StarTransactions> {
override fun method(): String = "getStarTransactions"
override val resultDeserializer: DeserializationStrategy<StarTransactions>
get() = StarTransactions.serializer()
override val requestSerializer: SerializationStrategy<*>
get() = serializer()
}

View File

@@ -1,11 +1,13 @@
package dev.inmo.tgbotapi.requests.send package dev.inmo.tgbotapi.requests.send
import dev.inmo.tgbotapi.abstracts.TextedOutput import dev.inmo.tgbotapi.abstracts.TextedOutput
import dev.inmo.tgbotapi.abstracts.WithCustomizableCaption
import dev.inmo.tgbotapi.abstracts.types.MessageAction import dev.inmo.tgbotapi.abstracts.types.MessageAction
import dev.inmo.tgbotapi.abstracts.types.ProtectContent import dev.inmo.tgbotapi.abstracts.types.ProtectContent
import dev.inmo.tgbotapi.requests.abstracts.SimpleRequest import dev.inmo.tgbotapi.requests.abstracts.SimpleRequest
import dev.inmo.tgbotapi.requests.send.abstracts.OptionallyMessageThreadRequest import dev.inmo.tgbotapi.requests.send.abstracts.OptionallyMessageThreadRequest
import dev.inmo.tgbotapi.requests.send.abstracts.ReplyingMarkupSendMessageRequest import dev.inmo.tgbotapi.requests.send.abstracts.ReplyingMarkupSendMessageRequest
import dev.inmo.tgbotapi.requests.send.abstracts.WithCustomizableCaptionRequest
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.message.textsources.TextSource import dev.inmo.tgbotapi.types.message.textsources.TextSource
@@ -28,23 +30,25 @@ fun CopyMessage(
messageId: MessageId, messageId: MessageId,
text: String? = null, text: String? = null,
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
showCaptionAboveMedia: Boolean = false,
threadId: MessageThreadId? = toChatId.threadId, threadId: MessageThreadId? = toChatId.threadId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = CopyMessage( ) = CopyMessage(
toChatId, toChatId = toChatId,
fromChatId, fromChatId = fromChatId,
messageId, messageId = messageId,
text, text = text,
parseMode, parseMode = parseMode,
null, rawEntities = null,
threadId, showCaptionAboveMedia = showCaptionAboveMedia,
disableNotification, threadId = threadId,
protectContent, disableNotification = disableNotification,
replyParameters, protectContent = protectContent,
replyMarkup replyParameters = replyParameters,
replyMarkup = replyMarkup
) )
fun CopyMessage( fun CopyMessage(
@@ -52,23 +56,25 @@ fun CopyMessage(
fromChatId: ChatIdentifier, fromChatId: ChatIdentifier,
messageId: MessageId, messageId: MessageId,
entities: List<TextSource>, entities: List<TextSource>,
showCaptionAboveMedia: Boolean = false,
threadId: MessageThreadId? = toChatId.threadId, threadId: MessageThreadId? = toChatId.threadId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = CopyMessage( ) = CopyMessage(
toChatId, toChatId = toChatId,
fromChatId, fromChatId = fromChatId,
messageId, messageId = messageId,
entities.makeString(), text = entities.makeString(),
null, parseMode = null,
entities.toRawMessageEntities(), rawEntities = entities.toRawMessageEntities(),
threadId, showCaptionAboveMedia = showCaptionAboveMedia,
disableNotification, threadId = threadId,
protectContent, disableNotification = disableNotification,
replyParameters, protectContent = protectContent,
replyMarkup replyParameters = replyParameters,
replyMarkup = replyMarkup
) )
fun CopyMessage( fun CopyMessage(
@@ -77,23 +83,25 @@ fun CopyMessage(
toChatId: ChatIdentifier, toChatId: ChatIdentifier,
text: String? = null, text: String? = null,
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
showCaptionAboveMedia: Boolean = false,
threadId: MessageThreadId? = toChatId.threadId, threadId: MessageThreadId? = toChatId.threadId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = CopyMessage( ) = CopyMessage(
toChatId, toChatId = toChatId,
fromChatId, fromChatId = fromChatId,
messageId, messageId = messageId,
text, text = text,
parseMode, parseMode = parseMode,
null, rawEntities = null,
threadId, showCaptionAboveMedia = showCaptionAboveMedia,
disableNotification, threadId = threadId,
protectContent, disableNotification = disableNotification,
replyParameters, protectContent = protectContent,
replyMarkup replyParameters = replyParameters,
replyMarkup = replyMarkup
) )
fun CopyMessage( fun CopyMessage(
@@ -101,23 +109,25 @@ fun CopyMessage(
messageId: MessageId, messageId: MessageId,
toChatId: ChatIdentifier, toChatId: ChatIdentifier,
entities: List<TextSource>, entities: List<TextSource>,
showCaptionAboveMedia: Boolean = false,
threadId: MessageThreadId? = toChatId.threadId, threadId: MessageThreadId? = toChatId.threadId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = CopyMessage( ) = CopyMessage(
toChatId, toChatId = toChatId,
fromChatId, fromChatId = fromChatId,
messageId, messageId = messageId,
entities.makeString(), text = entities.makeString(),
null, parseMode = null,
entities.toRawMessageEntities(), rawEntities = entities.toRawMessageEntities(),
threadId, showCaptionAboveMedia = showCaptionAboveMedia,
disableNotification, threadId = threadId,
protectContent, disableNotification = disableNotification,
replyParameters, protectContent = protectContent,
replyMarkup replyParameters = replyParameters,
replyMarkup = replyMarkup
) )
@Serializable @Serializable
@@ -134,6 +144,8 @@ data class CopyMessage internal constructor(
override val parseMode: ParseMode? = null, override val parseMode: ParseMode? = null,
@SerialName(captionEntitiesField) @SerialName(captionEntitiesField)
private val rawEntities: List<RawMessageEntity>? = null, private val rawEntities: List<RawMessageEntity>? = null,
@SerialName(showCaptionAboveMediaField)
override val showCaptionAboveMedia: Boolean = false,
@SerialName(messageThreadIdField) @SerialName(messageThreadIdField)
override val threadId: MessageThreadId? = toChatId.threadId, override val threadId: MessageThreadId? = toChatId.threadId,
@SerialName(disableNotificationField) @SerialName(disableNotificationField)
@@ -146,6 +158,7 @@ data class CopyMessage internal constructor(
override val replyMarkup: KeyboardMarkup? = null override val replyMarkup: KeyboardMarkup? = null
): SimpleRequest<MessageId>, ): SimpleRequest<MessageId>,
ReplyingMarkupSendMessageRequest<MessageId>, ReplyingMarkupSendMessageRequest<MessageId>,
WithCustomizableCaptionRequest<MessageId>,
MessageAction, MessageAction,
TextedOutput, TextedOutput,
ProtectContent, ProtectContent,

View File

@@ -32,6 +32,8 @@ data class SendContact(
override val disableNotification: Boolean = false, override val disableNotification: Boolean = false,
@SerialName(protectContentField) @SerialName(protectContentField)
override val protectContent: Boolean = false, override val protectContent: Boolean = false,
@SerialName(messageEffectIdField)
override val effectId: EffectId? = null,
@SerialName(replyParametersField) @SerialName(replyParametersField)
override val replyParameters: ReplyParameters? = null, override val replyParameters: ReplyParameters? = null,
@SerialName(replyMarkupField) @SerialName(replyMarkupField)
@@ -46,6 +48,7 @@ data class SendContact(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): this( ): this(
@@ -57,6 +60,7 @@ data class SendContact(
businessConnectionId, businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
effectId,
replyParameters, replyParameters,
replyMarkup replyMarkup
) )
@@ -74,15 +78,17 @@ fun Contact.toRequest(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): SendContact = SendContact( ): SendContact = SendContact(
chatId, chatId = chatId,
this, contact = this,
threadId, threadId = threadId,
businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification, disableNotification = disableNotification,
protectContent, protectContent = protectContent,
replyParameters, effectId = effectId,
replyMarkup replyParameters = replyParameters,
replyMarkup = replyMarkup
) )

View File

@@ -4,6 +4,7 @@ import dev.inmo.tgbotapi.abstracts.types.DisableNotification
import dev.inmo.tgbotapi.abstracts.types.OptionallyBusinessConnectionRequest import dev.inmo.tgbotapi.abstracts.types.OptionallyBusinessConnectionRequest
import dev.inmo.tgbotapi.abstracts.types.WithReplyParameters import dev.inmo.tgbotapi.abstracts.types.WithReplyParameters
import dev.inmo.tgbotapi.requests.send.abstracts.ReplyingMarkupSendMessageRequest import dev.inmo.tgbotapi.requests.send.abstracts.ReplyingMarkupSendMessageRequest
import dev.inmo.tgbotapi.requests.send.abstracts.SendContentMessageRequest
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
@@ -30,11 +31,13 @@ data class SendDice(
override val disableNotification: Boolean = false, override val disableNotification: Boolean = false,
@SerialName(protectContentField) @SerialName(protectContentField)
override val protectContent: Boolean = false, override val protectContent: Boolean = false,
@SerialName(messageEffectIdField)
override val effectId: EffectId? = null,
@SerialName(replyParametersField) @SerialName(replyParametersField)
override val replyParameters: ReplyParameters? = null, override val replyParameters: ReplyParameters? = null,
@SerialName(replyMarkupField) @SerialName(replyMarkupField)
override val replyMarkup: KeyboardMarkup? = null override val replyMarkup: KeyboardMarkup? = null
) : ReplyingMarkupSendMessageRequest<ContentMessage<DiceContent>>, WithReplyParameters, DisableNotification, ) : SendContentMessageRequest<ContentMessage<DiceContent>>, ReplyingMarkupSendMessageRequest<ContentMessage<DiceContent>>, WithReplyParameters, DisableNotification,
OptionallyBusinessConnectionRequest { OptionallyBusinessConnectionRequest {
override val requestSerializer: SerializationStrategy<*> override val requestSerializer: SerializationStrategy<*>
get() = serializer() get() = serializer()

View File

@@ -23,6 +23,7 @@ fun SendLocation(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = SendLocation( ) = SendLocation(
@@ -37,6 +38,7 @@ fun SendLocation(
businessConnectionId, businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
effectId,
replyParameters, replyParameters,
replyMarkup replyMarkup
) )
@@ -49,9 +51,21 @@ fun SendStaticLocation(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = SendLocation(chatId, latitude, longitude, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup) ) = SendLocation(
chatId = chatId,
latitude = latitude,
longitude = longitude,
threadId = threadId,
businessConnectionId = businessConnectionId,
disableNotification = disableNotification,
protectContent = protectContent,
effectId = effectId,
replyParameters = replyParameters,
replyMarkup = replyMarkup
)
fun SendLiveLocation( fun SendLiveLocation(
chatId: ChatIdentifier, chatId: ChatIdentifier,
@@ -65,22 +79,24 @@ fun SendLiveLocation(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = SendLocation( ) = SendLocation(
chatId, chatId = chatId,
latitude, latitude = latitude,
longitude, longitude = longitude,
livePeriod, livePeriod = livePeriod,
horizontalAccuracy, horizontalAccuracy = horizontalAccuracy,
heading, heading = heading,
proximityAlertRadius, proximityAlertRadius = proximityAlertRadius,
threadId, threadId = threadId,
businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification, disableNotification = disableNotification,
protectContent, protectContent = protectContent,
replyParameters, effectId = effectId,
replyMarkup replyParameters = replyParameters,
replyMarkup = replyMarkup
) )
@Serializable @Serializable
@@ -107,6 +123,8 @@ data class SendLocation internal constructor(
override val disableNotification: Boolean = false, override val disableNotification: Boolean = false,
@SerialName(protectContentField) @SerialName(protectContentField)
override val protectContent: Boolean = false, override val protectContent: Boolean = false,
@SerialName(messageEffectIdField)
override val effectId: EffectId? = null,
@SerialName(replyParametersField) @SerialName(replyParametersField)
override val replyParameters: ReplyParameters? = null, override val replyParameters: ReplyParameters? = null,
@SerialName(replyMarkupField) @SerialName(replyMarkupField)

View File

@@ -30,6 +30,7 @@ fun SendTextMessage(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = SendTextMessage( ) = SendTextMessage(
@@ -42,6 +43,7 @@ fun SendTextMessage(
linkPreviewOptions, linkPreviewOptions,
disableNotification, disableNotification,
protectContent, protectContent,
effectId,
replyParameters, replyParameters,
replyMarkup replyMarkup
) )
@@ -54,6 +56,7 @@ fun SendTextMessage(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = SendTextMessage( ) = SendTextMessage(
@@ -66,6 +69,7 @@ fun SendTextMessage(
linkPreviewOptions, linkPreviewOptions,
disableNotification, disableNotification,
protectContent, protectContent,
effectId,
replyParameters, replyParameters,
replyMarkup replyMarkup
) )
@@ -90,6 +94,8 @@ data class SendTextMessage internal constructor(
override val disableNotification: Boolean = false, override val disableNotification: Boolean = false,
@SerialName(protectContentField) @SerialName(protectContentField)
override val protectContent: Boolean = false, override val protectContent: Boolean = false,
@SerialName(messageEffectIdField)
override val effectId: EffectId? = null,
@SerialName(replyParametersField) @SerialName(replyParametersField)
override val replyParameters: ReplyParameters? = null, override val replyParameters: ReplyParameters? = null,
@SerialName(replyMarkupField) @SerialName(replyMarkupField)

View File

@@ -41,6 +41,8 @@ data class SendVenue(
override val disableNotification: Boolean = false, override val disableNotification: Boolean = false,
@SerialName(protectContentField) @SerialName(protectContentField)
override val protectContent: Boolean = false, override val protectContent: Boolean = false,
@SerialName(messageEffectIdField)
override val effectId: EffectId? = null,
@SerialName(replyParametersField) @SerialName(replyParametersField)
override val replyParameters: ReplyParameters? = null, override val replyParameters: ReplyParameters? = null,
@SerialName(replyMarkupField) @SerialName(replyMarkupField)
@@ -57,6 +59,7 @@ data class SendVenue(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): this( ): this(
@@ -70,8 +73,10 @@ data class SendVenue(
googlePlaceId = venue.googlePlaceId, googlePlaceId = venue.googlePlaceId,
googlePlaceType = venue.googlePlaceType, googlePlaceType = venue.googlePlaceType,
threadId = threadId, threadId = threadId,
businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
effectId = effectId,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -89,6 +94,7 @@ fun Venue.toRequest(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): SendVenue = SendVenue( ): SendVenue = SendVenue(
@@ -98,6 +104,7 @@ fun Venue.toRequest(
businessConnectionId, businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
effectId,
replyParameters, replyParameters,
replyMarkup replyMarkup
) )

View File

@@ -0,0 +1,6 @@
package dev.inmo.tgbotapi.requests.send.abstracts
import dev.inmo.tgbotapi.abstracts.types.OptionallyWithEffectId
import dev.inmo.tgbotapi.requests.abstracts.Request
interface OptionallyWithEffectRequest<T : Any> : OptionallyWithEffectId, Request<T>

Some files were not shown because too many files have changed in this diff Show More