mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2025-11-16 12:00:18 +00:00
Compare commits
86 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 02f42c3f52 | |||
| 0105e46a5f | |||
| 325a189ebb | |||
| 1d021c8450 | |||
| 6eb9379e0a | |||
| 2d97d10ee1 | |||
| 4b7d052ece | |||
| df512a917b | |||
| 67cd836466 | |||
| eb1fb16117 | |||
| ee4cf7c626 | |||
| 74d8b31437 | |||
| 3f61cfdefb | |||
| 91339fc839 | |||
| 2e23f48350 | |||
| f6211d33bb | |||
| 2ff11ad73c | |||
| 2695b03968 | |||
| 03d23a938e | |||
| 719fb1f4a9 | |||
| c3c69f3e7f | |||
| 4fb662c560 | |||
| cc967c2981 | |||
| aa7bf426f1 | |||
| 0b2735ca1e | |||
| 48bfa76b9e | |||
| 79a0e202d8 | |||
| 152bf2af02 | |||
| 0163e5ce8c | |||
| 62b4a21650 | |||
| f312e04c0d | |||
| 1c36c0a2f7 | |||
| bd73852253 | |||
| fbb2511fca | |||
| f22d571484 | |||
| 9be5ebb036 | |||
| da4cd527ec | |||
| 4117288b21 | |||
| 458bdd3ee4 | |||
| 8101c4c9fb | |||
| 255416f72a | |||
| 6eb7563c70 | |||
| b9bdf7cc72 | |||
| 4a8e1ee7b7 | |||
| 23bfe02e6f | |||
| 658c19092c | |||
| d469a88791 | |||
| 514bc699dd | |||
| bec72b8cf8 | |||
| fb0014dffa | |||
| ebc1c07404 | |||
| 989d33acb8 | |||
| 5aa6ac3320 | |||
| 048f65b8d4 | |||
| b69be31362 | |||
| b92288d7cc | |||
| 6c02d57197 | |||
| e977c865ea | |||
| 18b459fdf8 | |||
| 2bbd2e0679 | |||
| bcf7e835e6 | |||
| 4dd9740fec | |||
| 2182e44bc2 | |||
| 08c885de2f | |||
| facecf35fb | |||
| b13f24153f | |||
| 12ee862dad | |||
| 0726574852 | |||
| 9a00193e59 | |||
| 0fd8c1e2f3 | |||
| c09d089707 | |||
| ff39271afd | |||
| 35a4edd643 | |||
| ba647ee5ab | |||
| d2924ce1f2 | |||
| 72781487f0 | |||
| de435e5dbc | |||
| f975754058 | |||
| 0f7536a21c | |||
| d4c085c9b6 | |||
| 667c49f13d | |||
| e1d9ebff90 | |||
| fbc7088dad | |||
| 4ba9c8ee97 | |||
| 92611b5c26 | |||
|
|
0650fc594f |
2
.github/workflows/packages_publishing.yml
vendored
2
.github/workflows/packages_publishing.yml
vendored
@@ -28,7 +28,7 @@ jobs:
|
||||
env:
|
||||
GITHUB_USER: ${{ github.actor }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Publish to Gitea
|
||||
- name: Publish to InmoNexus
|
||||
continue-on-error: true
|
||||
run: ./gradlew publishAllPublicationsToInmoNexusRepository
|
||||
env:
|
||||
|
||||
59
CHANGELOG.md
59
CHANGELOG.md
@@ -1,5 +1,64 @@
|
||||
# TelegramBotAPI changelog
|
||||
|
||||
## 29.0.1
|
||||
|
||||
* `Core`:
|
||||
* Fix of [#917](https://github.com/InsanusMokrassar/ktgbotapi/issues/917): all `OrderInfo` fields now have defaults nulls
|
||||
|
||||
## 29.0.0
|
||||
|
||||
**THIS UPDATE CONTAINS ADDING SUPPORT OF [Telegram Bots API 9.2](https://core.telegram.org/bots/api-changelog#august-15-2025)**
|
||||
|
||||
**THIS UPDATE CONTAINS BREAKING CHANGES**
|
||||
|
||||
* `Core`:
|
||||
* Add function `firstOfOrNull(vararg suspend () -> T): T?`
|
||||
* Change logic of `firstOf` - now it works based on merged flows and __do not require__ `CoroutineScope` as receiver
|
||||
|
||||
## 28.0.3
|
||||
|
||||
* `Core`:
|
||||
* Add passing of default engines in `HttpClient` constructors
|
||||
|
||||
## 28.0.2
|
||||
|
||||
* `Core`:
|
||||
* [#1001](https://github.com/InsanusMokrassar/ktgbotapi/issues/1001) - `[Bug] Invalid detection of isCausedByCancellation()`
|
||||
* [#1002](https://github.com/InsanusMokrassar/ktgbotapi/issues/1002) - `Unable to handle UnauthorizedException with buildBehaviourWithLongPolling`
|
||||
|
||||
## 28.0.1
|
||||
|
||||
* `Version`:
|
||||
* `Kotlin`: `2.2.0` -> `2.2.10`
|
||||
* `MicroUtils`: `0.26.2` -> `0.26.3`
|
||||
* `Ktor`: `3.2.2` -> `3.2.3`
|
||||
* `Core`:
|
||||
* Let all `OptionallyMessageThreadRequest` inheritors to use `@EncodeDefault` annotation to fix default value passing
|
||||
|
||||
## 28.0.0
|
||||
|
||||
**THIS UPDATE CONTAINS BREAKING CHANGES**
|
||||
|
||||
* `Core`:
|
||||
* Add `firstOf` extension
|
||||
* `BehaviourBuilder`:
|
||||
* All builders for behaviours got boolean `useDefaultSubcontextInitialAction`
|
||||
* Add opportunity to pass `BehaviourContextData` in `DefaultBehaviourContext` constructor and `copy` method
|
||||
* By default, commands to other bots will be ignored in triggers and waiters
|
||||
|
||||
## 27.1.2
|
||||
|
||||
* `Core`:
|
||||
* Try to fix cancelling on timeout for long polling
|
||||
* Since this update phrase `Something web wrong` will not happen from this library 😭
|
||||
|
||||
## 27.1.1
|
||||
|
||||
* `Version`:
|
||||
* `MicroUtils`: `0.26.1` -> `0.26.2`
|
||||
* `Core`:
|
||||
* Make `BusinessLocation#location` optional (fix of [#990](https://github.com/InsanusMokrassar/ktgbotapi/issues/990))
|
||||
|
||||
## 27.1.0
|
||||
|
||||
* `Core`:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# TelegramBotAPI [](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi) [](https://core.telegram.org/bots/api-changelog#july-3-2025)
|
||||
# TelegramBotAPI [](https://central.sonatype.com/artifact/dev.inmo/tgbotapi) [](https://core.telegram.org/bots/api-changelog#august-15-2025)
|
||||
|
||||
| Docs | [](https://tgbotapi.inmo.dev/index.html) [](https://docs.inmo.dev/tgbotapi/index.html) |
|
||||
|:----------------------:|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|
|
||||
@@ -136,4 +136,4 @@ to proxy requests for files to the server where bot api server has been hosted
|
||||
(like `systemd-journal`) or be `101` UID user (like `systemd-resolve`)
|
||||
* **OR** Use some reverse proxy (like nginx). It will allow you to broadcast your bots files without linux rights problems
|
||||
* Set [TelegramAPIUrlsKeeper](tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/utils/TelegramAPIUrlsKeeper.kt)#fileLinkUrlMapper
|
||||
to map urls to let bot execute requests to your nginx proxy
|
||||
to map urls to let bot execute requests to your nginx proxy
|
||||
|
||||
@@ -28,7 +28,7 @@ if ((project.hasProperty('SONATYPE_USER') || System.getenv('SONATYPE_USER') != n
|
||||
username = project.hasProperty('SONATYPE_USER') ? project.property('SONATYPE_USER') : System.getenv('SONATYPE_USER')
|
||||
password = project.hasProperty('SONATYPE_PASSWORD') ? project.property('SONATYPE_PASSWORD') : System.getenv('SONATYPE_PASSWORD')
|
||||
validationTimeout = Duration.ofSeconds(0)
|
||||
publishingType = "USER_MANAGED"
|
||||
publishingType = System.getenv('PUBLISHING_TYPE') != "" ? System.getenv('PUBLISHING_TYPE') : "USER_MANAGED"
|
||||
}
|
||||
|
||||
publishAllProjectsProbablyBreakingProjectIsolation()
|
||||
|
||||
@@ -9,4 +9,4 @@ kotlin.incremental.js=true
|
||||
ksp.useKSP2=false
|
||||
|
||||
library_group=dev.inmo
|
||||
library_version=27.1.0
|
||||
library_version=29.0.1
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[versions]
|
||||
|
||||
kotlin = "2.2.0"
|
||||
kotlin = "2.2.10"
|
||||
kotlin-serialization = "1.9.0"
|
||||
kotlin-coroutines = "1.10.2"
|
||||
|
||||
@@ -8,12 +8,12 @@ javax-activation = "1.1.1"
|
||||
|
||||
korlibs = "5.4.0"
|
||||
uuid = "0.8.4"
|
||||
ktor = "3.2.2"
|
||||
ktor = "3.2.3"
|
||||
|
||||
ksp = "2.2.0-2.0.2"
|
||||
kotlin-poet = "2.0.0"
|
||||
ksp = "2.2.10-2.0.2"
|
||||
kotlin-poet = "2.2.0"
|
||||
|
||||
microutils = "0.26.1"
|
||||
microutils = "0.26.3"
|
||||
kslog = "1.5.0"
|
||||
|
||||
versions = "0.52.0"
|
||||
@@ -22,7 +22,7 @@ github-release-plugin = "2.5.2"
|
||||
dokka = "2.0.0"
|
||||
|
||||
validator = "0.18.1"
|
||||
nmcp = "1.0.2"
|
||||
nmcp = "1.1.0"
|
||||
|
||||
[libraries]
|
||||
|
||||
@@ -37,6 +37,8 @@ kotlin-test-js = { module = "org.jetbrains.kotlin:kotlin-test-js", version.ref =
|
||||
|
||||
ktor-client-core = { module = "io.ktor:ktor-client-core", version.ref = "ktor" }
|
||||
ktor-client-cio = { module = "io.ktor:ktor-client-cio", version.ref = "ktor" }
|
||||
ktor-client-java = { module = "io.ktor:ktor-client-java", version.ref = "ktor" }
|
||||
ktor-client-js = { module = "io.ktor:ktor-client-js", version.ref = "ktor" }
|
||||
ktor-client-curl = { module = "io.ktor:ktor-client-curl", version.ref = "ktor" }
|
||||
ktor-client-winhttp = { module = "io.ktor:ktor-client-winhttp", version.ref = "ktor" }
|
||||
ktor-server = { module = "io.ktor:ktor-server", version.ref = "ktor" }
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -3,6 +3,7 @@ package dev.inmo.tgbotapi.extensions.api
|
||||
import dev.inmo.tgbotapi.bot.ktor.telegramBot
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.utils.TelegramAPIUrlsKeeper
|
||||
import dev.inmo.tgbotapi.utils.defaultKtorEngine
|
||||
import dev.inmo.tgbotapi.utils.telegramBotAPIDefaultUrl
|
||||
import io.ktor.client.HttpClient
|
||||
import io.ktor.client.HttpClientConfig
|
||||
@@ -13,7 +14,7 @@ import io.ktor.client.engine.*
|
||||
*/
|
||||
public fun telegramBot(
|
||||
urlsKeeper: TelegramAPIUrlsKeeper,
|
||||
client: HttpClient = HttpClient()
|
||||
client: HttpClient = HttpClient(defaultKtorEngine)
|
||||
): TelegramBot = telegramBot(urlsKeeper) {
|
||||
this.client = client
|
||||
}
|
||||
@@ -68,7 +69,7 @@ public fun telegramBot(
|
||||
apiUrl: String = telegramBotAPIDefaultUrl,
|
||||
testServer: Boolean = false,
|
||||
fileLinkUrlMapper: TelegramAPIUrlsKeeper.(String) -> String = { "${fileBaseUrl}/$it" },
|
||||
client: HttpClient = HttpClient()
|
||||
client: HttpClient = HttpClient(defaultKtorEngine)
|
||||
): TelegramBot = telegramBot(TelegramAPIUrlsKeeper(token, testServer, apiUrl, fileLinkUrlMapper), client)
|
||||
|
||||
@Suppress("NOTHING_TO_INLINE")
|
||||
|
||||
@@ -3,12 +3,14 @@ package dev.inmo.tgbotapi.extensions.api
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.ForwardMessage
|
||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.DirectMessageThreadId
|
||||
import dev.inmo.tgbotapi.types.MessageId
|
||||
import dev.inmo.tgbotapi.types.MessageThreadId
|
||||
import dev.inmo.tgbotapi.types.Seconds
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.PossiblyForwardedMessage
|
||||
import dev.inmo.tgbotapi.types.directMessageThreadId
|
||||
import dev.inmo.tgbotapi.types.threadId
|
||||
|
||||
public suspend fun TelegramBot.forwardMessage(
|
||||
@@ -16,11 +18,12 @@ public suspend fun TelegramBot.forwardMessage(
|
||||
toChatId: ChatIdentifier,
|
||||
messageId: MessageId,
|
||||
threadId: MessageThreadId? = toChatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = toChatId.directMessageThreadId,
|
||||
startTimestamp: Seconds? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false
|
||||
): PossiblyForwardedMessage = execute(
|
||||
ForwardMessage(fromChatId, toChatId, messageId, threadId, startTimestamp, disableNotification, protectContent)
|
||||
ForwardMessage(fromChatId, toChatId, messageId, threadId, directMessageThreadId, startTimestamp, disableNotification, protectContent)
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.forwardMessage(
|
||||
@@ -28,45 +31,50 @@ public suspend fun TelegramBot.forwardMessage(
|
||||
toChatId: ChatIdentifier,
|
||||
messageId: MessageId,
|
||||
threadId: MessageThreadId? = toChatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = toChatId.directMessageThreadId,
|
||||
startTimestamp: Seconds? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false
|
||||
): PossiblyForwardedMessage = forwardMessage(fromChat.id, toChatId, messageId, threadId, startTimestamp, disableNotification, protectContent)
|
||||
): PossiblyForwardedMessage = forwardMessage(fromChat.id, toChatId, messageId, threadId, directMessageThreadId, startTimestamp, disableNotification, protectContent)
|
||||
|
||||
public suspend fun TelegramBot.forwardMessage(
|
||||
fromChatId: ChatIdentifier,
|
||||
toChat: Chat,
|
||||
messageId: MessageId,
|
||||
threadId: MessageThreadId? = toChat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = toChat.id.directMessageThreadId,
|
||||
startTimestamp: Seconds? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false
|
||||
): PossiblyForwardedMessage = forwardMessage(fromChatId, toChat.id, messageId, threadId, startTimestamp, disableNotification, protectContent)
|
||||
): PossiblyForwardedMessage = forwardMessage(fromChatId, toChat.id, messageId, threadId, directMessageThreadId, startTimestamp, disableNotification, protectContent)
|
||||
|
||||
public suspend fun TelegramBot.forwardMessage(
|
||||
fromChat: Chat,
|
||||
toChat: Chat,
|
||||
messageId: MessageId,
|
||||
threadId: MessageThreadId? = toChat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = toChat.id.directMessageThreadId,
|
||||
startTimestamp: Seconds? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false
|
||||
): PossiblyForwardedMessage = forwardMessage(fromChat.id, toChat.id, messageId, threadId, startTimestamp, disableNotification, protectContent)
|
||||
): PossiblyForwardedMessage = forwardMessage(fromChat.id, toChat.id, messageId, threadId, directMessageThreadId, startTimestamp, disableNotification, protectContent)
|
||||
|
||||
public suspend fun TelegramBot.forwardMessage(
|
||||
toChatId: ChatIdentifier,
|
||||
message: AccessibleMessage,
|
||||
threadId: MessageThreadId? = toChatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = toChatId.directMessageThreadId,
|
||||
startTimestamp: Seconds? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false
|
||||
): PossiblyForwardedMessage = forwardMessage(message.chat, toChatId, message.messageId, threadId, startTimestamp, disableNotification, protectContent)
|
||||
): PossiblyForwardedMessage = forwardMessage(message.chat, toChatId, message.messageId, threadId, directMessageThreadId, startTimestamp, disableNotification, protectContent)
|
||||
|
||||
public suspend fun TelegramBot.forwardMessage(
|
||||
toChat: Chat,
|
||||
message: AccessibleMessage,
|
||||
threadId: MessageThreadId? = toChat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = toChat.id.directMessageThreadId,
|
||||
startTimestamp: Seconds? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false
|
||||
): PossiblyForwardedMessage = forwardMessage(message.chat, toChat, message.messageId, threadId, startTimestamp, disableNotification, protectContent)
|
||||
): PossiblyForwardedMessage = forwardMessage(message.chat, toChat, message.messageId, threadId, directMessageThreadId, startTimestamp, disableNotification, protectContent)
|
||||
|
||||
@@ -13,6 +13,7 @@ public suspend fun TelegramBot.forwardMessages(
|
||||
fromChatId: ChatIdentifier,
|
||||
messageIds: List<MessageId>,
|
||||
threadId: MessageThreadId? = toChatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = toChatId.directMessageThreadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
removeCaption: Boolean = false
|
||||
@@ -23,6 +24,7 @@ public suspend fun TelegramBot.forwardMessages(
|
||||
fromChatId = fromChatId,
|
||||
messageIds = it,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
removeCaption = removeCaption
|
||||
@@ -35,6 +37,7 @@ public suspend fun TelegramBot.forwardMessages(
|
||||
fromChatId: ChatIdentifier,
|
||||
messageIds: Array<MessageId>,
|
||||
threadId: MessageThreadId? = toChatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = toChatId.directMessageThreadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
removeCaption: Boolean = false
|
||||
@@ -43,6 +46,7 @@ public suspend fun TelegramBot.forwardMessages(
|
||||
fromChatId = fromChatId,
|
||||
messageIds = messageIds.toList(),
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
removeCaption = removeCaption
|
||||
@@ -52,6 +56,7 @@ public suspend fun TelegramBot.forwardMessages(
|
||||
toChatId: ChatIdentifier,
|
||||
messagesMetas: List<Message.MetaInfo>,
|
||||
threadId: MessageThreadId? = toChatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = toChatId.directMessageThreadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
removeCaption: Boolean = false
|
||||
@@ -61,6 +66,7 @@ public suspend fun TelegramBot.forwardMessages(
|
||||
fromChatId = chatId,
|
||||
messageIds = messages.map { it.messageId },
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
removeCaption = removeCaption
|
||||
@@ -72,6 +78,7 @@ public suspend fun TelegramBot.forwardMessages(
|
||||
toChatId: ChatIdentifier,
|
||||
messages: List<AccessibleMessage>,
|
||||
threadId: MessageThreadId? = toChatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = toChatId.directMessageThreadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
removeCaption: Boolean = false
|
||||
@@ -79,6 +86,7 @@ public suspend fun TelegramBot.forwardMessages(
|
||||
toChatId = toChatId,
|
||||
messagesMetas = messages.map { it.metaInfo },
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
removeCaption = removeCaption
|
||||
@@ -89,6 +97,7 @@ public suspend fun TelegramBot.forward(
|
||||
fromChatId: ChatIdentifier,
|
||||
messageIds: List<MessageId>,
|
||||
threadId: MessageThreadId? = toChatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = toChatId.directMessageThreadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
removeCaption: Boolean = false
|
||||
@@ -97,6 +106,7 @@ public suspend fun TelegramBot.forward(
|
||||
fromChatId = fromChatId,
|
||||
messageIds = messageIds,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
removeCaption = removeCaption
|
||||
@@ -107,6 +117,7 @@ public suspend fun TelegramBot.forward(
|
||||
fromChatId: ChatIdentifier,
|
||||
messageIds: Array<MessageId>,
|
||||
threadId: MessageThreadId? = toChatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = toChatId.directMessageThreadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
removeCaption: Boolean = false
|
||||
@@ -115,6 +126,7 @@ public suspend fun TelegramBot.forward(
|
||||
fromChatId = fromChatId,
|
||||
messageIds = messageIds,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
removeCaption = removeCaption
|
||||
@@ -124,6 +136,7 @@ public suspend fun TelegramBot.forward(
|
||||
toChatId: ChatIdentifier,
|
||||
messagesMetas: List<Message.MetaInfo>,
|
||||
threadId: MessageThreadId? = toChatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = toChatId.directMessageThreadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
removeCaption: Boolean = false
|
||||
@@ -131,6 +144,7 @@ public suspend fun TelegramBot.forward(
|
||||
toChatId = toChatId,
|
||||
messagesMetas = messagesMetas,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
removeCaption = removeCaption
|
||||
@@ -141,6 +155,7 @@ public suspend fun TelegramBot.forward(
|
||||
toChatId: ChatIdentifier,
|
||||
messages: List<AccessibleMessage>,
|
||||
threadId: MessageThreadId? = toChatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = toChatId.directMessageThreadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
removeCaption: Boolean = false
|
||||
@@ -148,6 +163,7 @@ public suspend fun TelegramBot.forward(
|
||||
toChatId = toChatId,
|
||||
messages = messages,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
removeCaption = removeCaption
|
||||
|
||||
@@ -15,6 +15,7 @@ import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.location.LiveLocation
|
||||
import dev.inmo.tgbotapi.types.location.Location
|
||||
import dev.inmo.tgbotapi.types.message.SuggestedPostParameters
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||
import dev.inmo.tgbotapi.types.message.content.LiveLocationContent
|
||||
import dev.inmo.tgbotapi.types.message.content.LocationContent
|
||||
@@ -50,11 +51,13 @@ public suspend fun TelegramBot.handleLiveLocation(
|
||||
locationsFlow: Flow<EditLiveLocationInfo>,
|
||||
liveTimeMillis: Long = defaultLivePeriodDelayMillis,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
sentMessageFlow: FlowCollector<ContentMessage<LiveLocationContent>>? = null
|
||||
) {
|
||||
@@ -76,25 +79,27 @@ public suspend fun TelegramBot.handleLiveLocation(
|
||||
if (capturedLiveLocationMessage == null) {
|
||||
updateMessageJob ?.start()
|
||||
currentLiveLocationMessage = send(
|
||||
chatId,
|
||||
it.latitude,
|
||||
it.longitude,
|
||||
if (liveTimeMillis == indefiniteLivePeriodDelayMillis) {
|
||||
chatId = chatId,
|
||||
latitude = it.latitude,
|
||||
longitude = it.longitude,
|
||||
livePeriod = if (liveTimeMillis == indefiniteLivePeriodDelayMillis) {
|
||||
LiveLocation.INDEFINITE_LIVE_PERIOD
|
||||
} else {
|
||||
ceil(liveTimeMillis.toDouble() / 1000).toInt()
|
||||
},
|
||||
it.horizontalAccuracy,
|
||||
it.heading,
|
||||
it.proximityAlertRadius,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
allowPaidBroadcast,
|
||||
effectId,
|
||||
replyParameters,
|
||||
it.replyMarkup
|
||||
horizontalAccuracy = it.horizontalAccuracy,
|
||||
heading = it.heading,
|
||||
proximityAlertRadius = it.proximityAlertRadius,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = it.replyMarkup
|
||||
).also {
|
||||
sentMessageFlow ?.emit(it)
|
||||
}
|
||||
@@ -125,11 +130,13 @@ public suspend fun TelegramBot.handleLiveLocation(
|
||||
locationsFlow: Flow<Location>,
|
||||
liveTimeMillis: Long = defaultLivePeriodDelayMillis,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
sentMessageFlow: FlowCollector<ContentMessage<LiveLocationContent>>? = null
|
||||
) {
|
||||
@@ -147,11 +154,13 @@ public suspend fun TelegramBot.handleLiveLocation(
|
||||
},
|
||||
liveTimeMillis = liveTimeMillis,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
sentMessageFlow = sentMessageFlow
|
||||
)
|
||||
@@ -168,11 +177,13 @@ public suspend fun TelegramBot.handleLiveLocation(
|
||||
locationsFlow: Flow<Pair<Double, Double>>,
|
||||
liveTimeMillis: Long = defaultLivePeriodDelayMillis,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
sentMessageFlow: FlowCollector<ContentMessage<LiveLocationContent>>? = null
|
||||
) {
|
||||
@@ -186,11 +197,13 @@ public suspend fun TelegramBot.handleLiveLocation(
|
||||
},
|
||||
liveTimeMillis = liveTimeMillis,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
sentMessageFlow = sentMessageFlow
|
||||
)
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
@file:Suppress("KDocUnresolvedReference")
|
||||
|
||||
package dev.inmo.tgbotapi.extensions.api
|
||||
|
||||
import korlibs.time.DateTime
|
||||
@@ -11,11 +13,13 @@ import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.message.SuggestedPostParameters
|
||||
import dev.inmo.tgbotapi.types.location.LiveLocation
|
||||
import dev.inmo.tgbotapi.types.location.StaticLocation
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage
|
||||
import dev.inmo.tgbotapi.types.message.content.LocationContent
|
||||
import dev.inmo.tgbotapi.utils.extensions.directMessageThreadIdOrNull
|
||||
import dev.inmo.tgbotapi.utils.extensions.threadIdOrNull
|
||||
import io.ktor.utils.io.core.Closeable
|
||||
import korlibs.time.millisecondsLong
|
||||
@@ -96,11 +100,13 @@ public suspend fun TelegramBot.startLiveLocation(
|
||||
initHeading: Degrees? = null,
|
||||
initProximityAlertRadius: Meters? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): LiveLocationProvider {
|
||||
@@ -115,11 +121,13 @@ public suspend fun TelegramBot.startLiveLocation(
|
||||
heading = initHeading,
|
||||
proximityAlertRadius = initProximityAlertRadius,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -147,11 +155,13 @@ public suspend fun TelegramBot.startLiveLocation(
|
||||
initHeading: Degrees? = null,
|
||||
initProximityAlertRadius: Meters? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): LiveLocationProvider = startLiveLocation(
|
||||
@@ -164,11 +174,13 @@ public suspend fun TelegramBot.startLiveLocation(
|
||||
initHeading = initHeading,
|
||||
initProximityAlertRadius = initProximityAlertRadius,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -186,11 +198,13 @@ public suspend fun TelegramBot.startLiveLocation(
|
||||
initHeading: Degrees? = null,
|
||||
initProximityAlertRadius: Meters? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): LiveLocationProvider = startLiveLocation(
|
||||
@@ -203,11 +217,13 @@ public suspend fun TelegramBot.startLiveLocation(
|
||||
initHeading = initHeading,
|
||||
initProximityAlertRadius = initProximityAlertRadius,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -225,11 +241,13 @@ public suspend fun TelegramBot.startLiveLocation(
|
||||
initHeading: Degrees? = null,
|
||||
initProximityAlertRadius: Meters? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): LiveLocationProvider = startLiveLocation(
|
||||
@@ -242,11 +260,13 @@ public suspend fun TelegramBot.startLiveLocation(
|
||||
initHeading = initHeading,
|
||||
initProximityAlertRadius = initProximityAlertRadius,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -265,11 +285,13 @@ public suspend inline fun TelegramBot.replyWithLiveLocation(
|
||||
initHeading: Degrees? = null,
|
||||
initProximityAlertRadius: Meters? = null,
|
||||
threadId: MessageThreadId? = to.threadIdOrNull,
|
||||
directMessageThreadId: DirectMessageThreadId? = to.directMessageThreadIdOrNull,
|
||||
businessConnectionId: BusinessConnectionId? = to.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): LiveLocationProvider = startLiveLocation(
|
||||
@@ -282,11 +304,13 @@ public suspend inline fun TelegramBot.replyWithLiveLocation(
|
||||
initHeading = initHeading,
|
||||
initProximityAlertRadius = initProximityAlertRadius,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = ReplyParameters(to.metaInfo, allowSendingWithoutReply = allowSendingWithoutReply),
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -304,11 +328,13 @@ public suspend inline fun TelegramBot.replyWithLiveLocation(
|
||||
initHeading: Degrees? = null,
|
||||
initProximityAlertRadius: Meters? = null,
|
||||
threadId: MessageThreadId? = to.threadIdOrNull,
|
||||
directMessageThreadId: DirectMessageThreadId? = to.directMessageThreadIdOrNull,
|
||||
businessConnectionId: BusinessConnectionId? = to.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): LiveLocationProvider = startLiveLocation(
|
||||
@@ -320,11 +346,13 @@ public suspend inline fun TelegramBot.replyWithLiveLocation(
|
||||
initHeading = initHeading,
|
||||
initProximityAlertRadius = initProximityAlertRadius,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = ReplyParameters(to.metaInfo, allowSendingWithoutReply = allowSendingWithoutReply),
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
@@ -2,7 +2,6 @@ package dev.inmo.tgbotapi.extensions.api.chat.members
|
||||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.chat.members.PromoteChannelAdministrator
|
||||
import dev.inmo.tgbotapi.requests.chat.members.PromoteChatMember
|
||||
import dev.inmo.tgbotapi.types.IdChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.TelegramDate
|
||||
@@ -26,7 +25,8 @@ public suspend fun TelegramBot.promoteChannelAdministrator(
|
||||
canManageChat: Boolean? = null,
|
||||
canPostStories: Boolean? = null,
|
||||
canEditStories: Boolean? = null,
|
||||
canDeleteStories: Boolean? = null
|
||||
canDeleteStories: Boolean? = null,
|
||||
canManageDirectMessages: Boolean? = null,
|
||||
): Boolean = execute(
|
||||
PromoteChannelAdministrator(
|
||||
chatId = chatId,
|
||||
@@ -44,7 +44,8 @@ public suspend fun TelegramBot.promoteChannelAdministrator(
|
||||
canManageChat = canManageChat,
|
||||
canPostStories = canPostStories,
|
||||
canEditStories = canEditStories,
|
||||
canDeleteStories = canDeleteStories
|
||||
canDeleteStories = canDeleteStories,
|
||||
canManageDirectMessages = canManageDirectMessages,
|
||||
)
|
||||
)
|
||||
|
||||
@@ -64,7 +65,8 @@ public suspend fun TelegramBot.promoteChannelAdministrator(
|
||||
canManageChat: Boolean? = null,
|
||||
canPostStories: Boolean? = null,
|
||||
canEditStories: Boolean? = null,
|
||||
canDeleteStories: Boolean? = null
|
||||
canDeleteStories: Boolean? = null,
|
||||
canManageDirectMessages: Boolean? = null,
|
||||
): Boolean = promoteChannelAdministrator(
|
||||
chat.id,
|
||||
userId,
|
||||
@@ -81,7 +83,8 @@ public suspend fun TelegramBot.promoteChannelAdministrator(
|
||||
canManageChat = canManageChat,
|
||||
canPostStories = canPostStories,
|
||||
canEditStories = canEditStories,
|
||||
canDeleteStories = canDeleteStories
|
||||
canDeleteStories = canDeleteStories,
|
||||
canManageDirectMessages = canManageDirectMessages,
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.promoteChannelAdministrator(
|
||||
@@ -100,7 +103,8 @@ public suspend fun TelegramBot.promoteChannelAdministrator(
|
||||
canManageChat: Boolean? = null,
|
||||
canPostStories: Boolean? = null,
|
||||
canEditStories: Boolean? = null,
|
||||
canDeleteStories: Boolean? = null
|
||||
canDeleteStories: Boolean? = null,
|
||||
canManageDirectMessages: Boolean? = null,
|
||||
): Boolean = promoteChannelAdministrator(
|
||||
chatId,
|
||||
user.id,
|
||||
@@ -117,7 +121,8 @@ public suspend fun TelegramBot.promoteChannelAdministrator(
|
||||
canManageChat = canManageChat,
|
||||
canPostStories = canPostStories,
|
||||
canEditStories = canEditStories,
|
||||
canDeleteStories = canDeleteStories
|
||||
canDeleteStories = canDeleteStories,
|
||||
canManageDirectMessages = canManageDirectMessages,
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.promoteChannelAdministrator(
|
||||
@@ -136,7 +141,8 @@ public suspend fun TelegramBot.promoteChannelAdministrator(
|
||||
canManageChat: Boolean? = null,
|
||||
canPostStories: Boolean? = null,
|
||||
canEditStories: Boolean? = null,
|
||||
canDeleteStories: Boolean? = null
|
||||
canDeleteStories: Boolean? = null,
|
||||
canManageDirectMessages: Boolean? = null,
|
||||
): Boolean = promoteChannelAdministrator(
|
||||
chat.id,
|
||||
user.id,
|
||||
@@ -153,5 +159,6 @@ public suspend fun TelegramBot.promoteChannelAdministrator(
|
||||
canManageChat = canManageChat,
|
||||
canPostStories = canPostStories,
|
||||
canEditStories = canEditStories,
|
||||
canDeleteStories = canDeleteStories
|
||||
canDeleteStories = canDeleteStories,
|
||||
canManageDirectMessages = canManageDirectMessages,
|
||||
)
|
||||
|
||||
@@ -26,7 +26,8 @@ public suspend fun TelegramBot.promoteChatMember(
|
||||
canManageTopics: Boolean? = null,
|
||||
canPostStories: Boolean? = null,
|
||||
canEditStories: Boolean? = null,
|
||||
canDeleteStories: Boolean? = null
|
||||
canDeleteStories: Boolean? = null,
|
||||
canManageDirectMessages: Boolean? = null
|
||||
): Boolean = execute(
|
||||
PromoteChatMember(
|
||||
chatId = chatId,
|
||||
@@ -46,7 +47,8 @@ public suspend fun TelegramBot.promoteChatMember(
|
||||
canManageTopics = canManageTopics,
|
||||
canPostStories = canPostStories,
|
||||
canEditStories = canEditStories,
|
||||
canDeleteStories = canDeleteStories
|
||||
canDeleteStories = canDeleteStories,
|
||||
canManageDirectMessages = canManageDirectMessages,
|
||||
)
|
||||
)
|
||||
|
||||
@@ -69,7 +71,8 @@ public suspend fun TelegramBot.promoteChatMember(
|
||||
canManageTopics: Boolean? = null,
|
||||
canPostStories: Boolean? = null,
|
||||
canEditStories: Boolean? = null,
|
||||
canDeleteStories: Boolean? = null
|
||||
canDeleteStories: Boolean? = null,
|
||||
canManageDirectMessages: Boolean? = null
|
||||
): Boolean = promoteChatMember(
|
||||
chat.id,
|
||||
userId,
|
||||
@@ -88,7 +91,8 @@ public suspend fun TelegramBot.promoteChatMember(
|
||||
canManageTopics = canManageTopics,
|
||||
canPostStories = canPostStories,
|
||||
canEditStories = canEditStories,
|
||||
canDeleteStories = canDeleteStories
|
||||
canDeleteStories = canDeleteStories,
|
||||
canManageDirectMessages = canManageDirectMessages,
|
||||
)
|
||||
|
||||
@Warning("This method is too common. Use it with caution")
|
||||
@@ -110,7 +114,8 @@ public suspend fun TelegramBot.promoteChatMember(
|
||||
canManageTopics: Boolean? = null,
|
||||
canPostStories: Boolean? = null,
|
||||
canEditStories: Boolean? = null,
|
||||
canDeleteStories: Boolean? = null
|
||||
canDeleteStories: Boolean? = null,
|
||||
canManageDirectMessages: Boolean? = null
|
||||
): Boolean = promoteChatMember(
|
||||
chatId,
|
||||
user.id,
|
||||
@@ -129,7 +134,8 @@ public suspend fun TelegramBot.promoteChatMember(
|
||||
canManageTopics = canManageTopics,
|
||||
canPostStories = canPostStories,
|
||||
canEditStories = canEditStories,
|
||||
canDeleteStories = canDeleteStories
|
||||
canDeleteStories = canDeleteStories,
|
||||
canManageDirectMessages = canManageDirectMessages,
|
||||
)
|
||||
|
||||
@Warning("This method is too common. Use it with caution")
|
||||
@@ -151,7 +157,8 @@ public suspend fun TelegramBot.promoteChatMember(
|
||||
canManageTopics: Boolean? = null,
|
||||
canPostStories: Boolean? = null,
|
||||
canEditStories: Boolean? = null,
|
||||
canDeleteStories: Boolean? = null
|
||||
canDeleteStories: Boolean? = null,
|
||||
canManageDirectMessages: Boolean? = null
|
||||
): Boolean = promoteChatMember(
|
||||
chat.id,
|
||||
user.id,
|
||||
@@ -170,5 +177,6 @@ public suspend fun TelegramBot.promoteChatMember(
|
||||
canManageTopics = canManageTopics,
|
||||
canPostStories = canPostStories,
|
||||
canEditStories = canEditStories,
|
||||
canDeleteStories = canDeleteStories
|
||||
canDeleteStories = canDeleteStories,
|
||||
canManageDirectMessages = canManageDirectMessages,
|
||||
)
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
@file:Suppress("KDocUnresolvedReference")
|
||||
|
||||
package dev.inmo.tgbotapi.extensions.api.send
|
||||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
@@ -5,6 +7,7 @@ import dev.inmo.tgbotapi.requests.send.CopyMessage
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||
import dev.inmo.tgbotapi.types.message.SuggestedPostParameters
|
||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage
|
||||
@@ -21,10 +24,12 @@ public suspend inline fun TelegramBot.copyMessage(
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
threadId: MessageThreadId? = toChatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = toChatId.directMessageThreadId,
|
||||
startTimestamp: Seconds? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): MessageId = execute(
|
||||
@@ -36,10 +41,12 @@ public suspend inline fun TelegramBot.copyMessage(
|
||||
parseMode = parseMode,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
startTimestamp = startTimestamp,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -57,10 +64,12 @@ public suspend inline fun TelegramBot.copyMessage(
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
threadId: MessageThreadId? = toChatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = toChatId.directMessageThreadId,
|
||||
startTimestamp: Seconds? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): MessageId = copyMessage(
|
||||
@@ -71,10 +80,12 @@ public suspend inline fun TelegramBot.copyMessage(
|
||||
parseMode = parseMode,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
startTimestamp = startTimestamp,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -91,10 +102,12 @@ public suspend inline fun TelegramBot.copyMessage(
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
threadId: MessageThreadId? = toChat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = toChat.id.directMessageThreadId,
|
||||
startTimestamp: Seconds? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): MessageId = copyMessage(
|
||||
@@ -105,10 +118,12 @@ public suspend inline fun TelegramBot.copyMessage(
|
||||
parseMode = parseMode,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
startTimestamp = startTimestamp,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -125,10 +140,12 @@ public suspend inline fun TelegramBot.copyMessage(
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
threadId: MessageThreadId? = toChat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = toChat.id.directMessageThreadId,
|
||||
startTimestamp: Seconds? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): MessageId = copyMessage(
|
||||
@@ -139,10 +156,12 @@ public suspend inline fun TelegramBot.copyMessage(
|
||||
parseMode = parseMode,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
startTimestamp = startTimestamp,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -159,10 +178,12 @@ public suspend inline fun TelegramBot.copyMessage(
|
||||
entities: TextSourcesList,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
threadId: MessageThreadId? = toChatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = toChatId.directMessageThreadId,
|
||||
startTimestamp: Seconds? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): MessageId = execute(
|
||||
@@ -173,10 +194,12 @@ public suspend inline fun TelegramBot.copyMessage(
|
||||
entities = entities,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
startTimestamp = startTimestamp,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -193,10 +216,12 @@ public suspend inline fun TelegramBot.copyMessage(
|
||||
entities: TextSourcesList,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
threadId: MessageThreadId? = toChatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = toChatId.directMessageThreadId,
|
||||
startTimestamp: Seconds? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): MessageId = copyMessage(
|
||||
@@ -206,10 +231,12 @@ public suspend inline fun TelegramBot.copyMessage(
|
||||
entities = entities,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
startTimestamp = startTimestamp,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -225,10 +252,12 @@ public suspend inline fun TelegramBot.copyMessage(
|
||||
entities: TextSourcesList,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
threadId: MessageThreadId? = toChat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = toChat.id.directMessageThreadId,
|
||||
startTimestamp: Seconds? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): MessageId = copyMessage(
|
||||
@@ -238,10 +267,12 @@ public suspend inline fun TelegramBot.copyMessage(
|
||||
entities = entities,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
startTimestamp = startTimestamp,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -257,10 +288,12 @@ public suspend inline fun TelegramBot.copyMessage(
|
||||
entities: TextSourcesList,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
threadId: MessageThreadId? = toChat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = toChat.id.directMessageThreadId,
|
||||
startTimestamp: Seconds? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): MessageId = copyMessage(
|
||||
@@ -270,10 +303,12 @@ public suspend inline fun TelegramBot.copyMessage(
|
||||
entities = entities,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
startTimestamp = startTimestamp,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -289,10 +324,12 @@ public suspend inline fun TelegramBot.copyMessage(
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
threadId: MessageThreadId? = toChatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = toChatId.directMessageThreadId,
|
||||
startTimestamp: Seconds? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): MessageId = copyMessage(
|
||||
@@ -303,10 +340,12 @@ public suspend inline fun TelegramBot.copyMessage(
|
||||
parseMode = parseMode,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
startTimestamp = startTimestamp,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -322,10 +361,12 @@ public suspend inline fun TelegramBot.copyMessage(
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
threadId: MessageThreadId? = toChat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = toChat.id.directMessageThreadId,
|
||||
startTimestamp: Seconds? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): MessageId = copyMessage(
|
||||
@@ -336,10 +377,12 @@ public suspend inline fun TelegramBot.copyMessage(
|
||||
parseMode = parseMode,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
startTimestamp = startTimestamp,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -354,10 +397,12 @@ public suspend inline fun TelegramBot.copyMessage(
|
||||
entities: TextSourcesList,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
threadId: MessageThreadId? = toChatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = toChatId.directMessageThreadId,
|
||||
startTimestamp: Seconds? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): MessageId = copyMessage(
|
||||
@@ -367,10 +412,12 @@ public suspend inline fun TelegramBot.copyMessage(
|
||||
entities = entities,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
startTimestamp = startTimestamp,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -385,10 +432,12 @@ public suspend inline fun TelegramBot.copyMessage(
|
||||
entities: TextSourcesList,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
threadId: MessageThreadId? = toChat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = toChat.id.directMessageThreadId,
|
||||
startTimestamp: Seconds? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): MessageId = copyMessage(
|
||||
@@ -398,263 +447,12 @@ public suspend inline fun TelegramBot.copyMessage(
|
||||
entities = entities,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
startTimestamp = startTimestamp,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = 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
|
||||
// */
|
||||
//public suspend inline fun TelegramBot.copyMessage(
|
||||
// toChatId: ChatIdentifier,
|
||||
// fromChatId: ChatIdentifier,
|
||||
// messageId: MessageId,
|
||||
// text: String? = null,
|
||||
// parseMode: ParseMode? = null,
|
||||
// showCaptionAboveMedia: Boolean = false,
|
||||
// threadId: MessageThreadId? = toChatId.threadId,
|
||||
// disableNotification: Boolean = false,
|
||||
// protectContent: Boolean = false,
|
||||
// allowPaidBroadcast: Boolean = false,
|
||||
// replyParameters: ReplyParameters? = null,
|
||||
// replyMarkup: KeyboardMarkup? = null
|
||||
//): MessageId = execute(
|
||||
// CopyMessage(
|
||||
// fromChatId,
|
||||
// messageId,
|
||||
// toChatId,
|
||||
// text,
|
||||
// parseMode,
|
||||
// showCaptionAboveMedia,
|
||||
// threadId,
|
||||
// disableNotification,
|
||||
// protectContent,
|
||||
// allowPaidBroadcast,
|
||||
// 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
|
||||
// */
|
||||
//public suspend inline fun TelegramBot.copyMessage(
|
||||
// toChatId: ChatIdentifier,
|
||||
// fromChat: Chat,
|
||||
// messageId: MessageId,
|
||||
// text: String? = null,
|
||||
// parseMode: ParseMode? = null,
|
||||
// showCaptionAboveMedia: Boolean = false,
|
||||
// threadId: MessageThreadId? = toChatId.threadId,
|
||||
// disableNotification: Boolean = false,
|
||||
// protectContent: Boolean = false,
|
||||
// allowPaidBroadcast: Boolean = false,
|
||||
// replyParameters: ReplyParameters? = null,
|
||||
// replyMarkup: KeyboardMarkup? = null
|
||||
//): MessageId = copyMessage(
|
||||
// toChatId,
|
||||
// fromChat.id,
|
||||
// messageId,
|
||||
// text,
|
||||
// parseMode,
|
||||
// showCaptionAboveMedia,
|
||||
// threadId,
|
||||
// disableNotification,
|
||||
// protectContent,
|
||||
// allowPaidBroadcast,
|
||||
// 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
|
||||
// */
|
||||
//public suspend inline fun TelegramBot.copyMessage(
|
||||
// toChat: Chat,
|
||||
// fromChatId: ChatIdentifier,
|
||||
// messageId: MessageId,
|
||||
// text: String? = null,
|
||||
// parseMode: ParseMode? = null,
|
||||
// showCaptionAboveMedia: Boolean = false,
|
||||
// threadId: MessageThreadId? = toChat.id.threadId,
|
||||
// disableNotification: Boolean = false,
|
||||
// protectContent: Boolean = false,
|
||||
// allowPaidBroadcast: Boolean = false,
|
||||
// replyParameters: ReplyParameters? = null,
|
||||
// replyMarkup: KeyboardMarkup? = null
|
||||
//): MessageId = copyMessage(
|
||||
// toChat.id,
|
||||
// fromChatId,
|
||||
// messageId,
|
||||
// text,
|
||||
// parseMode,
|
||||
// showCaptionAboveMedia,
|
||||
// threadId,
|
||||
// disableNotification,
|
||||
// protectContent,
|
||||
// allowPaidBroadcast,
|
||||
// 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
|
||||
// */
|
||||
//public suspend inline fun TelegramBot.copyMessage(
|
||||
// toChat: Chat,
|
||||
// fromChat: Chat,
|
||||
// messageId: MessageId,
|
||||
// text: String? = null,
|
||||
// parseMode: ParseMode? = null,
|
||||
// showCaptionAboveMedia: Boolean = false,
|
||||
// threadId: MessageThreadId? = toChat.id.threadId,
|
||||
// disableNotification: Boolean = false,
|
||||
// protectContent: Boolean = false,
|
||||
// allowPaidBroadcast: Boolean = false,
|
||||
// replyParameters: ReplyParameters? = null,
|
||||
// replyMarkup: KeyboardMarkup? = null
|
||||
//): MessageId = copyMessage(
|
||||
// toChat.id,
|
||||
// fromChat.id,
|
||||
// messageId,
|
||||
// text,
|
||||
// parseMode,
|
||||
// showCaptionAboveMedia,
|
||||
// threadId,
|
||||
// disableNotification,
|
||||
// protectContent,
|
||||
// allowPaidBroadcast,
|
||||
// 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
|
||||
// */
|
||||
//public suspend inline fun TelegramBot.copyMessage(
|
||||
// toChatId: ChatIdentifier,
|
||||
// fromChatId: ChatIdentifier,
|
||||
// messageId: MessageId,
|
||||
// entities: TextSourcesList,
|
||||
// showCaptionAboveMedia: Boolean = false,
|
||||
// threadId: MessageThreadId? = toChatId.threadId,
|
||||
// disableNotification: Boolean = false,
|
||||
// protectContent: Boolean = false,
|
||||
// allowPaidBroadcast: Boolean = false,
|
||||
// replyParameters: ReplyParameters? = null,
|
||||
// replyMarkup: KeyboardMarkup? = null
|
||||
//): MessageId = execute(
|
||||
// CopyMessage(
|
||||
// fromChatId,
|
||||
// messageId,
|
||||
// toChatId,
|
||||
// entities,
|
||||
// showCaptionAboveMedia,
|
||||
// threadId,
|
||||
// disableNotification,
|
||||
// protectContent,
|
||||
// allowPaidBroadcast,
|
||||
// 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
|
||||
// */
|
||||
//public suspend inline fun TelegramBot.copyMessage(
|
||||
// toChatId: ChatIdentifier,
|
||||
// fromChat: Chat,
|
||||
// messageId: MessageId,
|
||||
// entities: TextSourcesList,
|
||||
// showCaptionAboveMedia: Boolean = false,
|
||||
// threadId: MessageThreadId? = toChatId.threadId,
|
||||
// disableNotification: Boolean = false,
|
||||
// protectContent: Boolean = false,
|
||||
// allowPaidBroadcast: Boolean = false,
|
||||
// replyParameters: ReplyParameters? = null,
|
||||
// replyMarkup: KeyboardMarkup? = null
|
||||
//): MessageId = copyMessage(
|
||||
// toChatId,
|
||||
// fromChat.id,
|
||||
// messageId,
|
||||
// entities,
|
||||
// showCaptionAboveMedia,
|
||||
// threadId,
|
||||
// disableNotification,
|
||||
// protectContent,
|
||||
// allowPaidBroadcast,
|
||||
// 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
|
||||
// */
|
||||
//public suspend inline fun TelegramBot.copyMessage(
|
||||
// toChat: Chat,
|
||||
// fromChatId: ChatIdentifier,
|
||||
// messageId: MessageId,
|
||||
// entities: TextSourcesList,
|
||||
// showCaptionAboveMedia: Boolean = false,
|
||||
// threadId: MessageThreadId? = toChat.id.threadId,
|
||||
// disableNotification: Boolean = false,
|
||||
// protectContent: Boolean = false,
|
||||
// allowPaidBroadcast: Boolean = false,
|
||||
// replyParameters: ReplyParameters? = null,
|
||||
// replyMarkup: KeyboardMarkup? = null
|
||||
//): MessageId = copyMessage(
|
||||
// toChat.id,
|
||||
// fromChatId,
|
||||
// messageId,
|
||||
// entities,
|
||||
// showCaptionAboveMedia,
|
||||
// threadId,
|
||||
// disableNotification,
|
||||
// protectContent,
|
||||
// allowPaidBroadcast,
|
||||
// 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
|
||||
// */
|
||||
//public suspend inline fun TelegramBot.copyMessage(
|
||||
// toChat: Chat,
|
||||
// fromChat: Chat,
|
||||
// messageId: MessageId,
|
||||
// entities: TextSourcesList,
|
||||
// showCaptionAboveMedia: Boolean = false,
|
||||
// threadId: MessageThreadId? = toChat.id.threadId,
|
||||
// disableNotification: Boolean = false,
|
||||
// protectContent: Boolean = false,
|
||||
// allowPaidBroadcast: Boolean = false,
|
||||
// replyParameters: ReplyParameters? = null,
|
||||
// replyMarkup: KeyboardMarkup? = null
|
||||
//): MessageId = copyMessage(
|
||||
// toChat.id,
|
||||
// fromChat.id,
|
||||
// messageId,
|
||||
// entities,
|
||||
// showCaptionAboveMedia,
|
||||
// threadId,
|
||||
// disableNotification,
|
||||
// protectContent,
|
||||
// allowPaidBroadcast,
|
||||
// replyParameters,
|
||||
// replyMarkup
|
||||
//)
|
||||
|
||||
@@ -12,6 +12,7 @@ public suspend fun TelegramBot.copyMessages(
|
||||
fromChatId: ChatIdentifier,
|
||||
messageIds: List<MessageId>,
|
||||
threadId: MessageThreadId? = toChatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = toChatId.directMessageThreadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
removeCaption: Boolean = false
|
||||
@@ -22,6 +23,7 @@ public suspend fun TelegramBot.copyMessages(
|
||||
fromChatId = fromChatId,
|
||||
messageIds = it,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
removeCaption = removeCaption
|
||||
@@ -34,6 +36,7 @@ public suspend fun TelegramBot.copyMessages(
|
||||
fromChatId: ChatIdentifier,
|
||||
messageIds: Array<MessageId>,
|
||||
threadId: MessageThreadId? = toChatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = toChatId.directMessageThreadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
removeCaption: Boolean = false
|
||||
@@ -42,6 +45,7 @@ public suspend fun TelegramBot.copyMessages(
|
||||
fromChatId = fromChatId,
|
||||
messageIds = messageIds.toList(),
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
removeCaption = removeCaption
|
||||
@@ -51,6 +55,7 @@ public suspend fun TelegramBot.copyMessages(
|
||||
toChatId: ChatIdentifier,
|
||||
messagesMetas: List<Message.MetaInfo>,
|
||||
threadId: MessageThreadId? = toChatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = toChatId.directMessageThreadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
removeCaption: Boolean = false
|
||||
@@ -60,6 +65,7 @@ public suspend fun TelegramBot.copyMessages(
|
||||
fromChatId = chatId,
|
||||
messageIds = messages.map { it.messageId },
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
removeCaption = removeCaption
|
||||
@@ -71,6 +77,7 @@ public suspend fun TelegramBot.copyMessages(
|
||||
toChatId: ChatIdentifier,
|
||||
messages: List<AccessibleMessage>,
|
||||
threadId: MessageThreadId? = toChatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = toChatId.directMessageThreadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
removeCaption: Boolean = false
|
||||
@@ -78,6 +85,7 @@ public suspend fun TelegramBot.copyMessages(
|
||||
toChatId = toChatId,
|
||||
messagesMetas = messages.map { it.metaInfo },
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
removeCaption = removeCaption
|
||||
@@ -88,6 +96,7 @@ public suspend fun TelegramBot.copy(
|
||||
fromChatId: ChatIdentifier,
|
||||
messageIds: List<MessageId>,
|
||||
threadId: MessageThreadId? = toChatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = toChatId.directMessageThreadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
removeCaption: Boolean = false
|
||||
@@ -96,6 +105,7 @@ public suspend fun TelegramBot.copy(
|
||||
fromChatId = fromChatId,
|
||||
messageIds = messageIds,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
removeCaption = removeCaption
|
||||
@@ -106,6 +116,7 @@ public suspend fun TelegramBot.copy(
|
||||
fromChatId: ChatIdentifier,
|
||||
messageIds: Array<MessageId>,
|
||||
threadId: MessageThreadId? = toChatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = toChatId.directMessageThreadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
removeCaption: Boolean = false
|
||||
@@ -114,6 +125,7 @@ public suspend fun TelegramBot.copy(
|
||||
fromChatId = fromChatId,
|
||||
messageIds = messageIds,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
removeCaption = removeCaption
|
||||
@@ -123,6 +135,7 @@ public suspend fun TelegramBot.copy(
|
||||
toChatId: ChatIdentifier,
|
||||
messagesMetas: List<Message.MetaInfo>,
|
||||
threadId: MessageThreadId? = toChatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = toChatId.directMessageThreadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
removeCaption: Boolean = false
|
||||
@@ -130,6 +143,7 @@ public suspend fun TelegramBot.copy(
|
||||
toChatId = toChatId,
|
||||
messagesMetas = messagesMetas,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
removeCaption = removeCaption
|
||||
@@ -140,6 +154,7 @@ public suspend fun TelegramBot.copy(
|
||||
toChatId: ChatIdentifier,
|
||||
messages: List<AccessibleMessage>,
|
||||
threadId: MessageThreadId? = toChatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = toChatId.directMessageThreadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
removeCaption: Boolean = false
|
||||
@@ -147,6 +162,7 @@ public suspend fun TelegramBot.copy(
|
||||
toChatId = toChatId,
|
||||
messages = messages,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
removeCaption = removeCaption
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -2,10 +2,12 @@ package dev.inmo.tgbotapi.extensions.api.send
|
||||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
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.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||
import dev.inmo.tgbotapi.types.message.content.MessageContent
|
||||
import dev.inmo.tgbotapi.types.message.SuggestedPostParameters
|
||||
|
||||
/**
|
||||
* This method will send [content] to the [chatId] as is
|
||||
@@ -15,22 +17,28 @@ public suspend inline fun <T : MessageContent> TelegramBot.resend(
|
||||
chatId: ChatIdentifier,
|
||||
content: T,
|
||||
messageThreadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
replyMarkup: KeyboardMarkup? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null
|
||||
): ContentMessage<T> = execute(
|
||||
content.createResend(
|
||||
chatId = chatId,
|
||||
messageThreadId = messageThreadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
replyMarkup = replyMarkup,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
)
|
||||
) as ContentMessage<T>
|
||||
|
||||
@@ -41,6 +49,8 @@ public suspend inline fun <T : MessageContent> TelegramBot.resend(
|
||||
chat: Chat,
|
||||
content: T,
|
||||
messageThreadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -51,6 +61,8 @@ public suspend inline fun <T : MessageContent> TelegramBot.resend(
|
||||
chatId = chat.id,
|
||||
content = content,
|
||||
messageThreadId = messageThreadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -68,6 +80,8 @@ public suspend inline fun <T : MessageContent> TelegramBot.resend(
|
||||
chatId: ChatIdentifier,
|
||||
message: ContentMessage<T>,
|
||||
messageThreadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -78,6 +92,8 @@ public suspend inline fun <T : MessageContent> TelegramBot.resend(
|
||||
chatId = chatId,
|
||||
content = message.content,
|
||||
messageThreadId = messageThreadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -95,6 +111,8 @@ public suspend inline fun <T : MessageContent> TelegramBot.resend(
|
||||
chat: Chat,
|
||||
message: ContentMessage<T>,
|
||||
messageThreadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -105,6 +123,8 @@ public suspend inline fun <T : MessageContent> TelegramBot.resend(
|
||||
chatId = chat.id,
|
||||
message = message,
|
||||
messageThreadId = messageThreadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
@file:Suppress("KDocUnresolvedReference")
|
||||
|
||||
package dev.inmo.tgbotapi.extensions.api.send
|
||||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
@@ -6,6 +8,7 @@ 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.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.message.SuggestedPostParameters
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||
import dev.inmo.tgbotapi.types.message.content.ContactContent
|
||||
|
||||
@@ -19,11 +22,13 @@ public suspend fun TelegramBot.sendContact(
|
||||
firstName: String,
|
||||
lastName: String? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<ContactContent> = execute(
|
||||
@@ -33,11 +38,13 @@ public suspend fun TelegramBot.sendContact(
|
||||
firstName = firstName,
|
||||
lastName = lastName,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -51,11 +58,13 @@ public suspend fun TelegramBot.sendContact(
|
||||
chatId: ChatIdentifier,
|
||||
contact: Contact,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<ContactContent> = execute(
|
||||
@@ -63,11 +72,13 @@ public suspend fun TelegramBot.sendContact(
|
||||
chatId = chatId,
|
||||
contact = contact,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -83,11 +94,13 @@ public suspend fun TelegramBot.sendContact(
|
||||
firstName: String,
|
||||
lastName: String? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<ContactContent> = sendContact(
|
||||
@@ -96,11 +109,13 @@ public suspend fun TelegramBot.sendContact(
|
||||
firstName = firstName,
|
||||
lastName = lastName,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -113,22 +128,26 @@ public suspend fun TelegramBot.sendContact(
|
||||
chat: Chat,
|
||||
contact: Contact,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<ContactContent> = sendContact(
|
||||
chatId = chat.id,
|
||||
contact = contact,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
@@ -6,6 +6,7 @@ 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.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.message.SuggestedPostParameters
|
||||
import dev.inmo.tgbotapi.types.dice.DiceAnimationType
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||
import dev.inmo.tgbotapi.types.message.content.DiceContent
|
||||
@@ -18,11 +19,13 @@ public suspend fun TelegramBot.sendDice(
|
||||
chatId: ChatIdentifier,
|
||||
animationType: DiceAnimationType? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<DiceContent> = execute(
|
||||
@@ -30,11 +33,13 @@ public suspend fun TelegramBot.sendDice(
|
||||
chatId = chatId,
|
||||
animationType = animationType,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -48,22 +53,26 @@ public suspend fun TelegramBot.sendDice(
|
||||
chat: Chat,
|
||||
animationType: DiceAnimationType? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<DiceContent> = sendDice(
|
||||
chatId = chat.id,
|
||||
animationType = animationType,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
@@ -6,6 +6,7 @@ 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.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.message.SuggestedPostParameters
|
||||
import dev.inmo.tgbotapi.types.location.Location
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||
import dev.inmo.tgbotapi.types.message.content.LiveLocationContent
|
||||
@@ -24,11 +25,13 @@ public suspend fun TelegramBot.sendLocation(
|
||||
heading: Degrees? = null,
|
||||
proximityAlertRadius: Meters? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<LiveLocationContent> = execute(
|
||||
@@ -41,11 +44,13 @@ public suspend fun TelegramBot.sendLocation(
|
||||
heading = heading,
|
||||
proximityAlertRadius = proximityAlertRadius,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -63,11 +68,13 @@ public suspend fun TelegramBot.sendLocation(
|
||||
heading: Degrees? = null,
|
||||
proximityAlertRadius: Meters? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<LiveLocationContent> = sendLocation(
|
||||
@@ -79,11 +86,13 @@ public suspend fun TelegramBot.sendLocation(
|
||||
heading = heading,
|
||||
proximityAlertRadius = proximityAlertRadius,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -101,11 +110,13 @@ public suspend fun TelegramBot.sendLocation(
|
||||
heading: Degrees? = null,
|
||||
proximityAlertRadius: Meters? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<LiveLocationContent> = sendLocation(
|
||||
@@ -117,11 +128,13 @@ public suspend fun TelegramBot.sendLocation(
|
||||
heading = heading,
|
||||
proximityAlertRadius = proximityAlertRadius,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -138,11 +151,13 @@ public suspend fun TelegramBot.sendLocation(
|
||||
heading: Degrees? = null,
|
||||
proximityAlertRadius: Meters? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<LiveLocationContent> = sendLocation(
|
||||
@@ -154,11 +169,13 @@ public suspend fun TelegramBot.sendLocation(
|
||||
heading = heading,
|
||||
proximityAlertRadius = proximityAlertRadius,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -176,11 +193,13 @@ public suspend fun TelegramBot.sendLiveLocation(
|
||||
heading: Degrees? = null,
|
||||
proximityAlertRadius: Meters? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<LiveLocationContent> = sendLocation(
|
||||
@@ -192,11 +211,13 @@ public suspend fun TelegramBot.sendLiveLocation(
|
||||
heading = heading,
|
||||
proximityAlertRadius = proximityAlertRadius,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -213,11 +234,13 @@ public suspend fun TelegramBot.sendLiveLocation(
|
||||
heading: Degrees? = null,
|
||||
proximityAlertRadius: Meters? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<LiveLocationContent> = sendLocation(
|
||||
@@ -229,11 +252,13 @@ public suspend fun TelegramBot.sendLiveLocation(
|
||||
heading = heading,
|
||||
proximityAlertRadius = proximityAlertRadius,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -251,11 +276,13 @@ public suspend fun TelegramBot.sendLiveLocation(
|
||||
heading: Degrees? = null,
|
||||
proximityAlertRadius: Meters? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<LiveLocationContent> = sendLocation(
|
||||
@@ -267,11 +294,13 @@ public suspend fun TelegramBot.sendLiveLocation(
|
||||
heading = heading,
|
||||
proximityAlertRadius = proximityAlertRadius,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -288,11 +317,13 @@ public suspend fun TelegramBot.sendLiveLocation(
|
||||
heading: Degrees? = null,
|
||||
proximityAlertRadius: Meters? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<LiveLocationContent> = sendLocation(
|
||||
@@ -304,11 +335,13 @@ public suspend fun TelegramBot.sendLiveLocation(
|
||||
heading = heading,
|
||||
proximityAlertRadius = proximityAlertRadius,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
@file:Suppress("KDocUnresolvedReference")
|
||||
|
||||
package dev.inmo.tgbotapi.extensions.api.send
|
||||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
@@ -6,6 +8,7 @@ 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.message.SuggestedPostParameters
|
||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||
@@ -24,11 +27,13 @@ public suspend fun TelegramBot.sendMessage(
|
||||
parseMode: ParseMode? = null,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<TextContent> = execute(
|
||||
@@ -38,11 +43,13 @@ public suspend fun TelegramBot.sendMessage(
|
||||
parseMode = parseMode,
|
||||
linkPreviewOptions = linkPreviewOptions,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -58,11 +65,13 @@ public suspend fun TelegramBot.sendTextMessage(
|
||||
parseMode: ParseMode? = null,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<TextContent> = sendMessage(
|
||||
@@ -71,11 +80,13 @@ public suspend fun TelegramBot.sendTextMessage(
|
||||
parseMode = parseMode,
|
||||
linkPreviewOptions = linkPreviewOptions,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -90,11 +101,13 @@ public suspend fun TelegramBot.sendTextMessage(
|
||||
parseMode: ParseMode? = null,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<TextContent> = sendTextMessage(
|
||||
@@ -103,11 +116,13 @@ public suspend fun TelegramBot.sendTextMessage(
|
||||
parseMode = parseMode,
|
||||
linkPreviewOptions = linkPreviewOptions,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -123,11 +138,13 @@ public suspend fun TelegramBot.sendMessage(
|
||||
parseMode: ParseMode? = null,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<TextContent> = sendMessage(
|
||||
@@ -136,11 +153,13 @@ public suspend fun TelegramBot.sendMessage(
|
||||
parseMode = parseMode,
|
||||
linkPreviewOptions = linkPreviewOptions,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -154,11 +173,13 @@ public suspend fun TelegramBot.sendMessage(
|
||||
entities: TextSourcesList,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<TextContent> = execute(
|
||||
@@ -167,11 +188,13 @@ public suspend fun TelegramBot.sendMessage(
|
||||
entities = entities,
|
||||
linkPreviewOptions = linkPreviewOptions,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -186,11 +209,13 @@ public suspend fun TelegramBot.sendMessage(
|
||||
separator: TextSource? = null,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null,
|
||||
builderBody: EntitiesBuilderBody
|
||||
@@ -199,11 +224,13 @@ public suspend fun TelegramBot.sendMessage(
|
||||
entities = buildEntities(separator, builderBody),
|
||||
linkPreviewOptions = linkPreviewOptions,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -218,11 +245,13 @@ public suspend fun TelegramBot.sendMessage(
|
||||
separator: String,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null,
|
||||
builderBody: EntitiesBuilderBody
|
||||
@@ -231,11 +260,13 @@ public suspend fun TelegramBot.sendMessage(
|
||||
entities = buildEntities(separator, builderBody),
|
||||
linkPreviewOptions = linkPreviewOptions,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -249,11 +280,13 @@ public suspend fun TelegramBot.sendTextMessage(
|
||||
entities: TextSourcesList,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<TextContent> = sendMessage(
|
||||
@@ -261,11 +294,13 @@ public suspend fun TelegramBot.sendTextMessage(
|
||||
entities = entities,
|
||||
linkPreviewOptions = linkPreviewOptions,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -279,11 +314,13 @@ public suspend fun TelegramBot.sendTextMessage(
|
||||
separator: TextSource? = null,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null,
|
||||
builderBody: EntitiesBuilderBody
|
||||
@@ -292,11 +329,13 @@ public suspend fun TelegramBot.sendTextMessage(
|
||||
entities = buildEntities(separator, builderBody),
|
||||
linkPreviewOptions = linkPreviewOptions,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -311,11 +350,13 @@ public suspend fun TelegramBot.sendTextMessage(
|
||||
separator: String,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null,
|
||||
builderBody: EntitiesBuilderBody
|
||||
@@ -324,11 +365,13 @@ public suspend fun TelegramBot.sendTextMessage(
|
||||
entities = buildEntities(separator, builderBody),
|
||||
linkPreviewOptions = linkPreviewOptions,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -342,11 +385,13 @@ public suspend fun TelegramBot.sendMessage(
|
||||
entities: TextSourcesList,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<TextContent> = sendMessage(
|
||||
@@ -354,11 +399,13 @@ public suspend fun TelegramBot.sendMessage(
|
||||
entities = entities,
|
||||
linkPreviewOptions = linkPreviewOptions,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -372,11 +419,13 @@ public suspend fun TelegramBot.sendMessage(
|
||||
separator: TextSource? = null,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null,
|
||||
builderBody: EntitiesBuilderBody
|
||||
@@ -385,11 +434,13 @@ public suspend fun TelegramBot.sendMessage(
|
||||
entities = buildEntities(separator, builderBody),
|
||||
linkPreviewOptions = linkPreviewOptions,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -404,11 +455,13 @@ public suspend fun TelegramBot.sendMessage(
|
||||
separator: String,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null,
|
||||
builderBody: EntitiesBuilderBody
|
||||
@@ -417,11 +470,13 @@ public suspend fun TelegramBot.sendMessage(
|
||||
entities = buildEntities(separator, builderBody),
|
||||
linkPreviewOptions = linkPreviewOptions,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -436,11 +491,13 @@ public suspend fun TelegramBot.sendTextMessage(
|
||||
entities: TextSourcesList,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<TextContent> = sendTextMessage(
|
||||
@@ -448,11 +505,13 @@ public suspend fun TelegramBot.sendTextMessage(
|
||||
entities = entities,
|
||||
linkPreviewOptions = linkPreviewOptions,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -466,11 +525,13 @@ public suspend fun TelegramBot.sendTextMessage(
|
||||
separator: TextSource? = null,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null,
|
||||
builderBody: EntitiesBuilderBody
|
||||
@@ -479,11 +540,13 @@ public suspend fun TelegramBot.sendTextMessage(
|
||||
entities = buildEntities(separator, builderBody),
|
||||
linkPreviewOptions = linkPreviewOptions,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -498,11 +561,13 @@ public suspend fun TelegramBot.sendTextMessage(
|
||||
separator: String,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null,
|
||||
builderBody: EntitiesBuilderBody
|
||||
@@ -511,11 +576,13 @@ public suspend fun TelegramBot.sendTextMessage(
|
||||
entities = buildEntities(separator, builderBody),
|
||||
linkPreviewOptions = linkPreviewOptions,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
@file:Suppress("KDocUnresolvedReference")
|
||||
|
||||
package dev.inmo.tgbotapi.extensions.api.send
|
||||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
@@ -6,6 +8,7 @@ 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.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.message.SuggestedPostParameters
|
||||
import dev.inmo.tgbotapi.types.location.Location
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||
import dev.inmo.tgbotapi.types.message.content.LocationContent
|
||||
@@ -20,11 +23,13 @@ public suspend fun TelegramBot.sendLocation(
|
||||
latitude: Double,
|
||||
longitude: Double,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<StaticLocationContent> = execute(
|
||||
@@ -33,11 +38,13 @@ public suspend fun TelegramBot.sendLocation(
|
||||
latitude = latitude,
|
||||
longitude = longitude,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -51,11 +58,13 @@ public suspend fun TelegramBot.sendLocation(
|
||||
chatId: ChatIdentifier,
|
||||
location: Location,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<StaticLocationContent> = sendLocation(
|
||||
@@ -63,11 +72,13 @@ public suspend fun TelegramBot.sendLocation(
|
||||
latitude = location.latitude,
|
||||
longitude = location.longitude,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -81,11 +92,13 @@ public suspend fun TelegramBot.sendLocation(
|
||||
latitude: Double,
|
||||
longitude: Double,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<StaticLocationContent> = sendLocation(
|
||||
@@ -93,11 +106,13 @@ public suspend fun TelegramBot.sendLocation(
|
||||
latitude = latitude,
|
||||
longitude = longitude,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -110,11 +125,13 @@ public suspend fun TelegramBot.sendLocation(
|
||||
chat: Chat,
|
||||
location: Location,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<StaticLocationContent> = sendLocation(
|
||||
@@ -122,11 +139,13 @@ public suspend fun TelegramBot.sendLocation(
|
||||
latitude = location.latitude,
|
||||
longitude = location.longitude,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -140,11 +159,13 @@ public suspend fun TelegramBot.sendStaticLocation(
|
||||
latitude: Double,
|
||||
longitude: Double,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<StaticLocationContent> = sendLocation(
|
||||
@@ -152,11 +173,13 @@ public suspend fun TelegramBot.sendStaticLocation(
|
||||
latitude = latitude,
|
||||
longitude = longitude,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -169,11 +192,13 @@ public suspend fun TelegramBot.sendStaticLocation(
|
||||
chatId: ChatIdentifier,
|
||||
location: Location,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<StaticLocationContent> = sendLocation(
|
||||
@@ -181,11 +206,13 @@ public suspend fun TelegramBot.sendStaticLocation(
|
||||
latitude = location.latitude,
|
||||
longitude = location.longitude,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -199,11 +226,13 @@ public suspend fun TelegramBot.sendStaticLocation(
|
||||
latitude: Double,
|
||||
longitude: Double,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<StaticLocationContent> = sendLocation(
|
||||
@@ -211,11 +240,13 @@ public suspend fun TelegramBot.sendStaticLocation(
|
||||
latitude = latitude,
|
||||
longitude = longitude,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -228,11 +259,13 @@ public suspend fun TelegramBot.sendStaticLocation(
|
||||
chat: Chat,
|
||||
location: Location,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<StaticLocationContent> = sendLocation(
|
||||
@@ -240,11 +273,13 @@ public suspend fun TelegramBot.sendStaticLocation(
|
||||
latitude = location.latitude,
|
||||
longitude = location.longitude,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
@file:Suppress("KDocUnresolvedReference")
|
||||
|
||||
package dev.inmo.tgbotapi.extensions.api.send
|
||||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
@@ -6,6 +8,7 @@ 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.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.message.SuggestedPostParameters
|
||||
import dev.inmo.tgbotapi.types.location.StaticLocation
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||
import dev.inmo.tgbotapi.types.message.content.VenueContent
|
||||
@@ -26,11 +29,13 @@ public suspend fun TelegramBot.sendVenue(
|
||||
googlePlaceId: GooglePlaceId? = null,
|
||||
googlePlaceType: GooglePlaceType? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<VenueContent> = execute(
|
||||
@@ -45,11 +50,13 @@ public suspend fun TelegramBot.sendVenue(
|
||||
googlePlaceId = googlePlaceId,
|
||||
googlePlaceType = googlePlaceType,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -70,11 +77,13 @@ public suspend fun TelegramBot.sendVenue(
|
||||
googlePlaceId: GooglePlaceId? = null,
|
||||
googlePlaceType: GooglePlaceType? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<VenueContent> = sendVenue(
|
||||
@@ -88,11 +97,13 @@ public suspend fun TelegramBot.sendVenue(
|
||||
googlePlaceId = googlePlaceId,
|
||||
googlePlaceType = googlePlaceType,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -111,11 +122,13 @@ public suspend fun TelegramBot.sendVenue(
|
||||
googlePlaceId: GooglePlaceId? = null,
|
||||
googlePlaceType: GooglePlaceType? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<VenueContent> = sendVenue(
|
||||
@@ -129,11 +142,13 @@ public suspend fun TelegramBot.sendVenue(
|
||||
googlePlaceId = googlePlaceId,
|
||||
googlePlaceType = googlePlaceType,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -152,11 +167,13 @@ public suspend fun TelegramBot.sendVenue(
|
||||
googlePlaceId: GooglePlaceId? = null,
|
||||
googlePlaceType: GooglePlaceType? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<VenueContent> = sendVenue(
|
||||
@@ -170,11 +187,13 @@ public suspend fun TelegramBot.sendVenue(
|
||||
googlePlaceId = googlePlaceId,
|
||||
googlePlaceType = googlePlaceType,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -187,11 +206,13 @@ public suspend fun TelegramBot.sendVenue(
|
||||
chatId: ChatIdentifier,
|
||||
venue: Venue,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<VenueContent> = execute(
|
||||
@@ -199,11 +220,13 @@ public suspend fun TelegramBot.sendVenue(
|
||||
chatId = chatId,
|
||||
venue = venue,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -217,22 +240,26 @@ public suspend fun TelegramBot.sendVenue(
|
||||
chat: Chat,
|
||||
venue: Venue,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<VenueContent> = sendVenue(
|
||||
chatId = chat.id,
|
||||
venue = venue,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -6,6 +6,7 @@ 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.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.message.SuggestedPostParameters
|
||||
import dev.inmo.tgbotapi.types.games.Game
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||
import dev.inmo.tgbotapi.types.message.content.GameContent
|
||||
@@ -18,11 +19,13 @@ public suspend fun TelegramBot.sendGame(
|
||||
chatId: ChatIdentifier,
|
||||
gameShortName: String,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<GameContent> = execute(
|
||||
@@ -30,11 +33,13 @@ public suspend fun TelegramBot.sendGame(
|
||||
chatId = chatId,
|
||||
gameShortName = gameShortName,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -48,22 +53,26 @@ public suspend fun TelegramBot.sendGame(
|
||||
chat: Chat,
|
||||
gameShortName: String,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<GameContent> = sendGame(
|
||||
chatId = chat.id,
|
||||
gameShortName = gameShortName,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -76,22 +85,26 @@ public suspend fun TelegramBot.sendGame(
|
||||
chatId: ChatIdentifier,
|
||||
game: Game,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<GameContent> = sendGame(
|
||||
chatId = chatId,
|
||||
gameShortName = game.title,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -104,22 +117,26 @@ public suspend fun TelegramBot.sendGame(
|
||||
chat: Chat,
|
||||
game: Game,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<GameContent> = sendGame(
|
||||
chatId = chat.id,
|
||||
gameShortName = game.title,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
@file:Suppress("KDocUnresolvedReference")
|
||||
|
||||
package dev.inmo.tgbotapi.extensions.api.send.media
|
||||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
@@ -7,6 +9,7 @@ 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.message.SuggestedPostParameters
|
||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.files.AnimationFile
|
||||
@@ -29,11 +32,13 @@ public suspend fun TelegramBot.sendAnimation(
|
||||
width: Int? = null,
|
||||
height: Int? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<AnimationContent> = execute(
|
||||
@@ -49,11 +54,13 @@ public suspend fun TelegramBot.sendAnimation(
|
||||
width = width,
|
||||
height = height,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -74,11 +81,13 @@ public suspend fun TelegramBot.sendAnimation(
|
||||
width: Int? = null,
|
||||
height: Int? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<AnimationContent> = sendAnimation(
|
||||
@@ -93,11 +102,13 @@ public suspend fun TelegramBot.sendAnimation(
|
||||
width = width,
|
||||
height = height,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -118,11 +129,13 @@ public suspend fun TelegramBot.sendAnimation(
|
||||
width: Int? = null,
|
||||
height: Int? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<AnimationContent> = sendAnimation(
|
||||
@@ -137,11 +150,13 @@ public suspend fun TelegramBot.sendAnimation(
|
||||
width = width,
|
||||
height = height,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -161,11 +176,13 @@ public suspend fun TelegramBot.sendAnimation(
|
||||
width: Int? = null,
|
||||
height: Int? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<AnimationContent> = sendAnimation(
|
||||
@@ -179,11 +196,13 @@ public suspend fun TelegramBot.sendAnimation(
|
||||
width = width,
|
||||
height = height,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -204,11 +223,13 @@ public suspend fun TelegramBot.sendAnimation(
|
||||
width: Int? = null,
|
||||
height: Int? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<AnimationContent> = execute(
|
||||
@@ -223,11 +244,13 @@ public suspend fun TelegramBot.sendAnimation(
|
||||
width = width,
|
||||
height = height,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -247,11 +270,13 @@ public suspend fun TelegramBot.sendAnimation(
|
||||
width: Int? = null,
|
||||
height: Int? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<AnimationContent> = sendAnimation(
|
||||
@@ -265,11 +290,13 @@ public suspend fun TelegramBot.sendAnimation(
|
||||
width = width,
|
||||
height = height,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -289,11 +316,13 @@ public suspend fun TelegramBot.sendAnimation(
|
||||
width: Int? = null,
|
||||
height: Int? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<AnimationContent> = sendAnimation(
|
||||
@@ -307,11 +336,13 @@ public suspend fun TelegramBot.sendAnimation(
|
||||
width = width,
|
||||
height = height,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -330,11 +361,13 @@ public suspend fun TelegramBot.sendAnimation(
|
||||
width: Int? = null,
|
||||
height: Int? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<AnimationContent> = sendAnimation(
|
||||
@@ -347,11 +380,13 @@ public suspend fun TelegramBot.sendAnimation(
|
||||
width = width,
|
||||
height = height,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
@@ -7,6 +7,7 @@ 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.message.SuggestedPostParameters
|
||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.files.AudioFile
|
||||
@@ -27,11 +28,13 @@ public suspend fun TelegramBot.sendAudio(
|
||||
performer: String? = null,
|
||||
title: String? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<AudioContent> = execute(
|
||||
@@ -45,11 +48,13 @@ public suspend fun TelegramBot.sendAudio(
|
||||
performer = performer,
|
||||
title = title,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -69,11 +74,13 @@ public suspend fun TelegramBot.sendAudio(
|
||||
performer: String? = null,
|
||||
title: String? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<AudioContent> = sendAudio(
|
||||
@@ -86,11 +93,13 @@ public suspend fun TelegramBot.sendAudio(
|
||||
performer = performer,
|
||||
title = title,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -106,11 +115,13 @@ public suspend fun TelegramBot.sendAudio(
|
||||
parseMode: ParseMode? = null,
|
||||
title: String? = audio.title,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<AudioContent> = sendAudio(
|
||||
@@ -123,11 +134,13 @@ public suspend fun TelegramBot.sendAudio(
|
||||
performer = audio.performer,
|
||||
title = title,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -143,11 +156,13 @@ public suspend fun TelegramBot.sendAudio(
|
||||
parseMode: ParseMode? = null,
|
||||
title: String? = audio.title,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<AudioContent> = sendAudio(
|
||||
@@ -157,11 +172,13 @@ public suspend fun TelegramBot.sendAudio(
|
||||
parseMode = parseMode,
|
||||
title = title,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -180,11 +197,13 @@ public suspend inline fun TelegramBot.sendAudio(
|
||||
performer: String? = null,
|
||||
title: String? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<AudioContent> = execute(
|
||||
@@ -197,11 +216,13 @@ public suspend inline fun TelegramBot.sendAudio(
|
||||
performer = performer,
|
||||
title = title,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -220,11 +241,13 @@ public suspend inline fun TelegramBot.sendAudio(
|
||||
performer: String? = null,
|
||||
title: String? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<AudioContent> = sendAudio(
|
||||
@@ -236,11 +259,13 @@ public suspend inline fun TelegramBot.sendAudio(
|
||||
performer = performer,
|
||||
title = title,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -255,11 +280,13 @@ public suspend inline fun TelegramBot.sendAudio(
|
||||
entities: TextSourcesList,
|
||||
title: String? = audio.title,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<AudioContent> = sendAudio(
|
||||
@@ -271,11 +298,13 @@ public suspend inline fun TelegramBot.sendAudio(
|
||||
performer = audio.performer,
|
||||
title = title,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -290,11 +319,13 @@ public suspend inline fun TelegramBot.sendAudio(
|
||||
entities: TextSourcesList,
|
||||
title: String? = audio.title,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<AudioContent> = sendAudio(
|
||||
@@ -303,11 +334,13 @@ public suspend inline fun TelegramBot.sendAudio(
|
||||
entities = entities,
|
||||
title = title,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
@@ -7,6 +7,7 @@ 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.message.SuggestedPostParameters
|
||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.files.DocumentFile
|
||||
@@ -24,11 +25,13 @@ public suspend fun TelegramBot.sendDocument(
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null,
|
||||
disableContentTypeDetection: Boolean? = null
|
||||
@@ -40,11 +43,13 @@ public suspend fun TelegramBot.sendDocument(
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup,
|
||||
disableContentTypeDetection = disableContentTypeDetection
|
||||
@@ -62,11 +67,13 @@ public suspend fun TelegramBot.sendDocument(
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null,
|
||||
disableContentTypeDetection: Boolean? = null
|
||||
@@ -77,11 +84,13 @@ public suspend fun TelegramBot.sendDocument(
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup,
|
||||
disableContentTypeDetection = disableContentTypeDetection
|
||||
@@ -97,11 +106,13 @@ public suspend fun TelegramBot.sendDocument(
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null,
|
||||
disableContentTypeDetection: Boolean? = null
|
||||
@@ -112,11 +123,13 @@ public suspend fun TelegramBot.sendDocument(
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup,
|
||||
disableContentTypeDetection = disableContentTypeDetection
|
||||
@@ -132,11 +145,13 @@ public suspend fun TelegramBot.sendDocument(
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null,
|
||||
disableContentTypeDetection: Boolean? = null
|
||||
@@ -146,11 +161,13 @@ public suspend fun TelegramBot.sendDocument(
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup,
|
||||
disableContentTypeDetection = disableContentTypeDetection
|
||||
@@ -166,11 +183,13 @@ public suspend inline fun TelegramBot.sendDocument(
|
||||
thumb: InputFile? = null,
|
||||
entities: TextSourcesList,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null,
|
||||
disableContentTypeDetection: Boolean? = null
|
||||
@@ -181,11 +200,13 @@ public suspend inline fun TelegramBot.sendDocument(
|
||||
thumbnail = thumb,
|
||||
entities = entities,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup,
|
||||
disableContentTypeDetection = disableContentTypeDetection
|
||||
@@ -202,11 +223,13 @@ public suspend inline fun TelegramBot.sendDocument(
|
||||
thumb: InputFile? = null,
|
||||
entities: TextSourcesList,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null,
|
||||
disableContentTypeDetection: Boolean? = null
|
||||
@@ -216,11 +239,13 @@ public suspend inline fun TelegramBot.sendDocument(
|
||||
thumb = thumb,
|
||||
entities = entities,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup,
|
||||
disableContentTypeDetection = disableContentTypeDetection
|
||||
@@ -235,11 +260,13 @@ public suspend inline fun TelegramBot.sendDocument(
|
||||
document: DocumentFile,
|
||||
entities: TextSourcesList,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null,
|
||||
disableContentTypeDetection: Boolean? = null
|
||||
@@ -249,11 +276,13 @@ public suspend inline fun TelegramBot.sendDocument(
|
||||
thumb = document.thumbnail ?.fileId,
|
||||
entities = entities,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup,
|
||||
disableContentTypeDetection = disableContentTypeDetection
|
||||
@@ -268,11 +297,13 @@ public suspend inline fun TelegramBot.sendDocument(
|
||||
document: DocumentFile,
|
||||
entities: TextSourcesList,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null,
|
||||
disableContentTypeDetection: Boolean? = null
|
||||
@@ -281,11 +312,13 @@ public suspend inline fun TelegramBot.sendDocument(
|
||||
document = document,
|
||||
entities = entities,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup,
|
||||
disableContentTypeDetection = disableContentTypeDetection
|
||||
|
||||
@@ -8,6 +8,7 @@ import dev.inmo.tgbotapi.types.media.*
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||
import dev.inmo.tgbotapi.types.message.content.*
|
||||
import dev.inmo.tgbotapi.types.message.SuggestedPostParameters
|
||||
import dev.inmo.tgbotapi.utils.RiskFeature
|
||||
import kotlin.jvm.JvmName
|
||||
|
||||
@@ -19,22 +20,26 @@ public suspend fun TelegramBot.sendMediaGroup(
|
||||
chatId: ChatIdentifier,
|
||||
media: List<MediaGroupMemberTelegramMedia>,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null
|
||||
): ContentMessage<MediaGroupContent<MediaGroupPartContent>> = execute(
|
||||
SendMediaGroup<MediaGroupPartContent>(
|
||||
chatId = chatId,
|
||||
media = media,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters
|
||||
)
|
||||
)
|
||||
@@ -47,21 +52,25 @@ public suspend fun TelegramBot.sendMediaGroup(
|
||||
chat: Chat,
|
||||
media: List<MediaGroupMemberTelegramMedia>,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null
|
||||
): ContentMessage<MediaGroupContent<MediaGroupPartContent>> = sendMediaGroup(
|
||||
chatId = chat.id,
|
||||
media = media,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters
|
||||
)
|
||||
|
||||
@@ -74,21 +83,25 @@ public suspend fun TelegramBot.sendMediaGroup(
|
||||
chatId: ChatIdentifier,
|
||||
media: List<MediaGroupPartContent>,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null
|
||||
): ContentMessage<MediaGroupContent<MediaGroupPartContent>> = sendMediaGroup(
|
||||
chatId = chatId,
|
||||
media = media.map { it.toMediaGroupMemberTelegramMedia() },
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters
|
||||
)
|
||||
|
||||
@@ -101,21 +114,25 @@ public suspend fun TelegramBot.sendMediaGroup(
|
||||
chat: Chat,
|
||||
media: List<MediaGroupPartContent>,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null
|
||||
): ContentMessage<MediaGroupContent<MediaGroupPartContent>> = sendMediaGroup(
|
||||
chatId = chat.id,
|
||||
media = media,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters
|
||||
)
|
||||
|
||||
@@ -126,22 +143,26 @@ public suspend fun TelegramBot.sendPlaylist(
|
||||
chatId: ChatIdentifier,
|
||||
media: List<AudioMediaGroupMemberTelegramMedia>,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null
|
||||
): ContentMessage<MediaGroupContent<AudioContent>> = execute(
|
||||
SendPlaylist(
|
||||
chatId = chatId,
|
||||
media = media,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters
|
||||
)
|
||||
)
|
||||
@@ -153,21 +174,25 @@ public suspend fun TelegramBot.sendPlaylist(
|
||||
chat: Chat,
|
||||
media: List<AudioMediaGroupMemberTelegramMedia>,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null
|
||||
): ContentMessage<MediaGroupContent<AudioContent>> = sendPlaylist(
|
||||
chatId = chat.id,
|
||||
media = media,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters
|
||||
)
|
||||
|
||||
@@ -179,21 +204,25 @@ public suspend fun TelegramBot.sendPlaylist(
|
||||
chatId: ChatIdentifier,
|
||||
media: List<AudioContent>,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null
|
||||
): ContentMessage<MediaGroupContent<AudioContent>> = sendPlaylist(
|
||||
chatId = chatId,
|
||||
media = media.map { it.toMediaGroupMemberTelegramMedia() },
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters
|
||||
)
|
||||
|
||||
@@ -205,21 +234,25 @@ public suspend fun TelegramBot.sendPlaylist(
|
||||
chat: Chat,
|
||||
media: List<AudioContent>,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null
|
||||
): ContentMessage<MediaGroupContent<AudioContent>> = sendPlaylist(
|
||||
chatId = chat.id,
|
||||
media = media,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters
|
||||
)
|
||||
|
||||
@@ -230,22 +263,26 @@ public suspend fun TelegramBot.sendDocumentsGroup(
|
||||
chatId: ChatIdentifier,
|
||||
media: List<DocumentMediaGroupMemberTelegramMedia>,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null
|
||||
): ContentMessage<MediaGroupContent<DocumentContent>> = execute(
|
||||
SendDocumentsGroup(
|
||||
chatId = chatId,
|
||||
media = media,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters
|
||||
)
|
||||
)
|
||||
@@ -257,21 +294,25 @@ public suspend fun TelegramBot.sendDocumentsGroup(
|
||||
chat: Chat,
|
||||
media: List<DocumentMediaGroupMemberTelegramMedia>,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null
|
||||
): ContentMessage<MediaGroupContent<DocumentContent>> = sendDocumentsGroup(
|
||||
chatId = chat.id,
|
||||
media = media,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters
|
||||
)
|
||||
|
||||
@@ -283,21 +324,25 @@ public suspend fun TelegramBot.sendDocumentsGroup(
|
||||
chatId: ChatIdentifier,
|
||||
media: List<DocumentContent>,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null
|
||||
): ContentMessage<MediaGroupContent<DocumentContent>> = sendDocumentsGroup(
|
||||
chatId = chatId,
|
||||
media = media.map { it.toMediaGroupMemberTelegramMedia() },
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters
|
||||
)
|
||||
|
||||
@@ -309,21 +354,25 @@ public suspend fun TelegramBot.sendDocumentsGroup(
|
||||
chat: Chat,
|
||||
media: List<DocumentContent>,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null
|
||||
): ContentMessage<MediaGroupContent<DocumentContent>> = sendDocumentsGroup(
|
||||
chatId = chat.id,
|
||||
media = media,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters
|
||||
)
|
||||
|
||||
@@ -334,22 +383,26 @@ public suspend fun TelegramBot.sendVisualMediaGroup(
|
||||
chatId: ChatIdentifier,
|
||||
media: List<VisualMediaGroupMemberTelegramMedia>,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null
|
||||
): ContentMessage<MediaGroupContent<VisualMediaGroupPartContent>> = execute(
|
||||
SendVisualMediaGroup(
|
||||
chatId = chatId,
|
||||
media = media,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters
|
||||
)
|
||||
)
|
||||
@@ -361,21 +414,25 @@ public suspend fun TelegramBot.sendVisualMediaGroup(
|
||||
chat: Chat,
|
||||
media: List<VisualMediaGroupMemberTelegramMedia>,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null
|
||||
): ContentMessage<MediaGroupContent<VisualMediaGroupPartContent>> = sendVisualMediaGroup(
|
||||
chatId = chat.id,
|
||||
media = media,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters
|
||||
)
|
||||
|
||||
@@ -387,21 +444,25 @@ public suspend fun TelegramBot.sendVisualMediaGroup(
|
||||
chatId: ChatIdentifier,
|
||||
media: List<VisualMediaGroupPartContent>,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null
|
||||
): ContentMessage<MediaGroupContent<VisualMediaGroupPartContent>> = sendVisualMediaGroup(
|
||||
chatId = chatId,
|
||||
media = media.map { it.toMediaGroupMemberTelegramMedia() },
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters
|
||||
)
|
||||
|
||||
@@ -413,20 +474,24 @@ public suspend fun TelegramBot.sendVisualMediaGroup(
|
||||
chat: Chat,
|
||||
media: List<VisualMediaGroupPartContent>,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null
|
||||
): ContentMessage<MediaGroupContent<VisualMediaGroupPartContent>> = sendVisualMediaGroup(
|
||||
chatId = chat.id,
|
||||
media = media,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters
|
||||
)
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
@file:Suppress("KDocUnresolvedReference")
|
||||
|
||||
package dev.inmo.tgbotapi.extensions.api.send.media
|
||||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
@@ -6,6 +8,7 @@ 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.message.SuggestedPostParameters
|
||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.media.TelegramPaidMedia
|
||||
@@ -25,10 +28,12 @@ public suspend fun TelegramBot.sendPaidMedia(
|
||||
payload: PaidMediaPayload? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<PaidMediaInfoContent> = execute(
|
||||
@@ -41,10 +46,12 @@ public suspend fun TelegramBot.sendPaidMedia(
|
||||
payload = payload,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -63,10 +70,12 @@ public suspend fun TelegramBot.sendPaidMedia(
|
||||
payload: PaidMediaPayload? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<PaidMediaInfoContent> = sendPaidMedia(
|
||||
@@ -78,10 +87,12 @@ public suspend fun TelegramBot.sendPaidMedia(
|
||||
payload = payload,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -99,10 +110,12 @@ public suspend inline fun TelegramBot.sendPaidMedia(
|
||||
payload: PaidMediaPayload? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<PaidMediaInfoContent> = execute(
|
||||
@@ -114,10 +127,12 @@ public suspend inline fun TelegramBot.sendPaidMedia(
|
||||
payload = payload,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -135,10 +150,12 @@ public suspend inline fun TelegramBot.sendPaidMedia(
|
||||
payload: PaidMediaPayload? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<PaidMediaInfoContent> = sendPaidMedia(
|
||||
@@ -149,10 +166,12 @@ public suspend inline fun TelegramBot.sendPaidMedia(
|
||||
payload = payload,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
@file:Suppress("KDocUnresolvedReference")
|
||||
|
||||
package dev.inmo.tgbotapi.extensions.api.send.media
|
||||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
@@ -7,6 +9,7 @@ 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.message.SuggestedPostParameters
|
||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.files.*
|
||||
@@ -25,11 +28,13 @@ public suspend fun TelegramBot.sendPhoto(
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<PhotoContent> = execute(
|
||||
@@ -41,11 +46,13 @@ public suspend fun TelegramBot.sendPhoto(
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -63,11 +70,13 @@ public suspend fun TelegramBot.sendPhoto(
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<PhotoContent> = sendPhoto(
|
||||
@@ -78,11 +87,13 @@ public suspend fun TelegramBot.sendPhoto(
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -99,11 +110,13 @@ public suspend fun TelegramBot.sendPhoto(
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<PhotoContent> = sendPhoto(
|
||||
@@ -114,11 +127,13 @@ public suspend fun TelegramBot.sendPhoto(
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -135,11 +150,13 @@ public suspend fun TelegramBot.sendPhoto(
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<PhotoContent> = sendPhoto(
|
||||
@@ -150,11 +167,13 @@ public suspend fun TelegramBot.sendPhoto(
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -171,11 +190,13 @@ public suspend fun TelegramBot.sendPhoto(
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<PhotoContent> = sendPhoto(
|
||||
@@ -186,11 +207,13 @@ public suspend fun TelegramBot.sendPhoto(
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -207,11 +230,13 @@ public suspend fun TelegramBot.sendPhoto(
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<PhotoContent> = sendPhoto(
|
||||
@@ -222,11 +247,13 @@ public suspend fun TelegramBot.sendPhoto(
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -243,11 +270,13 @@ public suspend inline fun TelegramBot.sendPhoto(
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<PhotoContent> = execute(
|
||||
@@ -258,11 +287,13 @@ public suspend inline fun TelegramBot.sendPhoto(
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -279,11 +310,13 @@ public suspend inline fun TelegramBot.sendPhoto(
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<PhotoContent> = sendPhoto(
|
||||
@@ -293,11 +326,13 @@ public suspend inline fun TelegramBot.sendPhoto(
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -313,11 +348,13 @@ public suspend inline fun TelegramBot.sendPhoto(
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<PhotoContent> = sendPhoto(
|
||||
@@ -327,11 +364,13 @@ public suspend inline fun TelegramBot.sendPhoto(
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -347,11 +386,13 @@ public suspend inline fun TelegramBot.sendPhoto(
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<PhotoContent> = sendPhoto(
|
||||
@@ -361,11 +402,13 @@ public suspend inline fun TelegramBot.sendPhoto(
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -381,11 +424,13 @@ public suspend inline fun TelegramBot.sendPhoto(
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<PhotoContent> = sendPhoto(
|
||||
@@ -395,11 +440,13 @@ public suspend inline fun TelegramBot.sendPhoto(
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -415,11 +462,13 @@ public suspend inline fun TelegramBot.sendPhoto(
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<PhotoContent> = sendPhoto(
|
||||
@@ -429,11 +478,13 @@ public suspend inline fun TelegramBot.sendPhoto(
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
@file:Suppress("KDocUnresolvedReference")
|
||||
|
||||
package dev.inmo.tgbotapi.extensions.api.send.media
|
||||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
@@ -10,6 +12,7 @@ import dev.inmo.tgbotapi.types.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.files.Sticker
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||
import dev.inmo.tgbotapi.types.message.content.StickerContent
|
||||
import dev.inmo.tgbotapi.types.message.SuggestedPostParameters
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
@@ -19,12 +22,14 @@ public suspend fun TelegramBot.sendSticker(
|
||||
chatId: ChatIdentifier,
|
||||
sticker: InputFile,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
emoji: String? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<StickerContent> = execute(
|
||||
@@ -32,12 +37,14 @@ public suspend fun TelegramBot.sendSticker(
|
||||
chatId = chatId,
|
||||
sticker = sticker,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
emoji = emoji,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -51,24 +58,28 @@ public suspend fun TelegramBot.sendSticker(
|
||||
chat: Chat,
|
||||
sticker: InputFile,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
emoji: String? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<StickerContent> = sendSticker(
|
||||
chatId = chat.id,
|
||||
sticker = sticker,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
emoji = emoji,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -81,24 +92,28 @@ public suspend fun TelegramBot.sendSticker(
|
||||
chatId: ChatIdentifier,
|
||||
sticker: Sticker,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
emoji: String? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<StickerContent> = sendSticker(
|
||||
chatId = chatId,
|
||||
sticker = sticker.fileId,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
emoji = emoji,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -111,24 +126,28 @@ public suspend fun TelegramBot.sendSticker(
|
||||
chat: Chat,
|
||||
sticker: Sticker,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
emoji: String? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<StickerContent> = sendSticker(
|
||||
chat = chat,
|
||||
sticker = sticker.fileId,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
emoji = emoji,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
@file:Suppress("KDocUnresolvedReference")
|
||||
|
||||
package dev.inmo.tgbotapi.extensions.api.send.media
|
||||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
@@ -7,6 +9,7 @@ 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.message.SuggestedPostParameters
|
||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.files.VideoFile
|
||||
@@ -31,11 +34,13 @@ public suspend fun TelegramBot.sendVideo(
|
||||
width: Int? = null,
|
||||
height: Int? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<VideoContent> = execute(
|
||||
@@ -54,11 +59,13 @@ public suspend fun TelegramBot.sendVideo(
|
||||
height = height,
|
||||
supportStreaming = null,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -76,11 +83,13 @@ public suspend fun TelegramBot.sendVideo(
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<VideoContent> = sendVideo(
|
||||
@@ -97,11 +106,13 @@ public suspend fun TelegramBot.sendVideo(
|
||||
width = video.width,
|
||||
height = video.height,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -124,11 +135,13 @@ public suspend fun TelegramBot.sendVideo(
|
||||
width: Int? = null,
|
||||
height: Int? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<VideoContent> = sendVideo(
|
||||
@@ -145,11 +158,13 @@ public suspend fun TelegramBot.sendVideo(
|
||||
width = width,
|
||||
height = height,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -167,11 +182,13 @@ public suspend fun TelegramBot.sendVideo(
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<VideoContent> = sendVideo(
|
||||
@@ -182,11 +199,13 @@ public suspend fun TelegramBot.sendVideo(
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -208,11 +227,13 @@ public suspend inline fun TelegramBot.sendVideo(
|
||||
width: Int? = null,
|
||||
height: Int? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<VideoContent> = execute(
|
||||
@@ -230,11 +251,13 @@ public suspend inline fun TelegramBot.sendVideo(
|
||||
height = height,
|
||||
supportStreaming = null,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -251,11 +274,13 @@ public suspend inline fun TelegramBot.sendVideo(
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<VideoContent> = sendVideo(
|
||||
@@ -271,11 +296,13 @@ public suspend inline fun TelegramBot.sendVideo(
|
||||
width = video.width,
|
||||
height = video.height,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -297,11 +324,13 @@ public suspend inline fun TelegramBot.sendVideo(
|
||||
width: Int? = null,
|
||||
height: Int? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<VideoContent> = sendVideo(
|
||||
@@ -317,11 +346,13 @@ public suspend inline fun TelegramBot.sendVideo(
|
||||
width = width,
|
||||
height = height,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -338,11 +369,13 @@ public suspend inline fun TelegramBot.sendVideo(
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<VideoContent> = sendVideo(
|
||||
@@ -352,11 +385,13 @@ public suspend inline fun TelegramBot.sendVideo(
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
@@ -7,6 +7,7 @@ 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.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.message.SuggestedPostParameters
|
||||
import dev.inmo.tgbotapi.types.files.VideoNoteFile
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||
import dev.inmo.tgbotapi.types.message.content.VideoNoteContent
|
||||
@@ -22,11 +23,13 @@ public suspend fun TelegramBot.sendVideoNote(
|
||||
duration: Long? = null,
|
||||
size: Int? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<VideoNoteContent> = execute(
|
||||
@@ -37,11 +40,13 @@ public suspend fun TelegramBot.sendVideoNote(
|
||||
duration = duration,
|
||||
size = size,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -55,11 +60,13 @@ public suspend fun TelegramBot.sendVideoNote(
|
||||
chatId: ChatIdentifier,
|
||||
videoNote: VideoNoteFile,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<VideoNoteContent> = sendVideoNote(
|
||||
@@ -69,11 +76,13 @@ public suspend fun TelegramBot.sendVideoNote(
|
||||
duration = videoNote.duration,
|
||||
size = videoNote.width,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -89,11 +98,13 @@ public suspend fun TelegramBot.sendVideoNote(
|
||||
duration: Long? = null,
|
||||
size: Int? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<VideoNoteContent> = sendVideoNote(
|
||||
@@ -103,11 +114,13 @@ public suspend fun TelegramBot.sendVideoNote(
|
||||
duration = duration,
|
||||
size = size,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -120,22 +133,26 @@ public suspend fun TelegramBot.sendVideoNote(
|
||||
chat: Chat,
|
||||
videoNote: VideoNoteFile,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<VideoNoteContent> = sendVideoNote(
|
||||
chatId = chat.id,
|
||||
videoNote = videoNote,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
@@ -7,6 +7,7 @@ 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.message.SuggestedPostParameters
|
||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.files.VoiceFile
|
||||
@@ -24,11 +25,13 @@ public suspend fun TelegramBot.sendVoice(
|
||||
parseMode: ParseMode? = null,
|
||||
duration: Long? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<VoiceContent> = execute(
|
||||
@@ -39,11 +42,13 @@ public suspend fun TelegramBot.sendVoice(
|
||||
parseMode = parseMode,
|
||||
duration = duration,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -60,11 +65,13 @@ public suspend fun TelegramBot.sendVoice(
|
||||
parseMode: ParseMode? = null,
|
||||
duration: Long? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<VoiceContent> = sendVoice(
|
||||
@@ -74,11 +81,13 @@ public suspend fun TelegramBot.sendVoice(
|
||||
parseMode = parseMode,
|
||||
duration = duration,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -93,11 +102,13 @@ public suspend fun TelegramBot.sendVoice(
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<VoiceContent> = sendVoice(
|
||||
@@ -107,11 +118,13 @@ public suspend fun TelegramBot.sendVoice(
|
||||
parseMode = parseMode,
|
||||
duration = voice.duration,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -126,11 +139,13 @@ public suspend fun TelegramBot.sendVoice(
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<VoiceContent> = sendVoice(
|
||||
@@ -139,11 +154,13 @@ public suspend fun TelegramBot.sendVoice(
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -159,11 +176,13 @@ public suspend inline fun TelegramBot.sendVoice(
|
||||
entities: TextSourcesList,
|
||||
duration: Long? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<VoiceContent> = execute(
|
||||
@@ -172,12 +191,14 @@ public suspend inline fun TelegramBot.sendVoice(
|
||||
voice = voice,
|
||||
entities = entities,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
duration = duration,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -193,11 +214,13 @@ public suspend inline fun TelegramBot.sendVoice(
|
||||
entities: TextSourcesList,
|
||||
duration: Long? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<VoiceContent> = sendVoice(
|
||||
@@ -206,11 +229,13 @@ public suspend inline fun TelegramBot.sendVoice(
|
||||
entities = entities,
|
||||
duration = duration,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -224,11 +249,13 @@ public suspend inline fun TelegramBot.sendVoice(
|
||||
voice: VoiceFile,
|
||||
entities: TextSourcesList,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<VoiceContent> = sendVoice(
|
||||
@@ -237,11 +264,13 @@ public suspend inline fun TelegramBot.sendVoice(
|
||||
entities = entities,
|
||||
duration = voice.duration,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -254,11 +283,13 @@ public suspend inline fun TelegramBot.sendVoice(
|
||||
voice: VoiceFile,
|
||||
entities: TextSourcesList,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<VoiceContent> = sendVoice(
|
||||
@@ -266,11 +297,13 @@ public suspend inline fun TelegramBot.sendVoice(
|
||||
voice = voice,
|
||||
entities = entities,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
@file:Suppress("KDocUnresolvedReference")
|
||||
|
||||
package dev.inmo.tgbotapi.extensions.api.send.payments
|
||||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
@@ -5,11 +7,11 @@ import dev.inmo.tgbotapi.requests.send.payments.SendInvoice
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.chat.CommonUser
|
||||
import dev.inmo.tgbotapi.types.message.SuggestedPostParameters
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||
import dev.inmo.tgbotapi.types.message.content.InvoiceContent
|
||||
import dev.inmo.tgbotapi.types.payments.LabeledPrice
|
||||
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]
|
||||
@@ -35,10 +37,12 @@ public suspend fun TelegramBot.sendInvoice(
|
||||
shouldSendEmailToProvider: Boolean = false,
|
||||
priceDependOnShipAddress: Boolean = false,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
): ContentMessage<InvoiceContent> = execute(
|
||||
@@ -62,10 +66,12 @@ public suspend fun TelegramBot.sendInvoice(
|
||||
shouldSendEmailToProvider = shouldSendEmailToProvider,
|
||||
priceDependOnShipAddress = priceDependOnShipAddress,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -98,6 +104,7 @@ public suspend fun TelegramBot.sendInvoice(
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
): ContentMessage<InvoiceContent> = sendInvoice(
|
||||
@@ -120,10 +127,12 @@ public suspend fun TelegramBot.sendInvoice(
|
||||
shouldSendEmailToProvider = shouldSendEmailToProvider,
|
||||
priceDependOnShipAddress = priceDependOnShipAddress,
|
||||
threadId = null,
|
||||
directMessageThreadId = null,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -142,10 +151,12 @@ public suspend fun TelegramBot.sendInvoice(
|
||||
startParameter: StartParameter? = null,
|
||||
providerData: String? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
): ContentMessage<InvoiceContent> = execute(
|
||||
@@ -158,10 +169,12 @@ public suspend fun TelegramBot.sendInvoice(
|
||||
startParameter = startParameter,
|
||||
providerData = providerData,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -183,6 +196,7 @@ public suspend fun TelegramBot.sendInvoice(
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
): ContentMessage<InvoiceContent> = sendInvoice(
|
||||
@@ -194,10 +208,12 @@ public suspend fun TelegramBot.sendInvoice(
|
||||
startParameter = startParameter,
|
||||
providerData = providerData,
|
||||
threadId = null,
|
||||
directMessageThreadId = null,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
@@ -6,6 +6,7 @@ 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.SuggestedPostParameters
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||
import dev.inmo.tgbotapi.types.message.content.PollContent
|
||||
import dev.inmo.tgbotapi.types.message.textsources.TextSource
|
||||
@@ -26,11 +27,13 @@ public suspend fun TelegramBot.sendQuizPoll(
|
||||
openPeriod: LongSeconds? = null,
|
||||
closeDate: LongSeconds? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<PollContent> = execute(
|
||||
@@ -47,11 +50,13 @@ public suspend fun TelegramBot.sendQuizPoll(
|
||||
openPeriod = openPeriod,
|
||||
closeDate = closeDate,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -69,11 +74,13 @@ public suspend fun TelegramBot.sendQuizPoll(
|
||||
openPeriod: LongSeconds? = null,
|
||||
closeDate: LongSeconds? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<PollContent> = execute(
|
||||
@@ -89,11 +96,13 @@ public suspend fun TelegramBot.sendQuizPoll(
|
||||
openPeriod = openPeriod,
|
||||
closeDate = closeDate,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -111,11 +120,13 @@ public suspend fun TelegramBot.sendQuizPoll(
|
||||
openPeriod: LongSeconds? = null,
|
||||
closeDate: LongSeconds? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<PollContent> = execute(
|
||||
@@ -131,11 +142,13 @@ public suspend fun TelegramBot.sendQuizPoll(
|
||||
openPeriod = openPeriod,
|
||||
closeDate = closeDate,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -153,11 +166,13 @@ public suspend fun TelegramBot.sendQuizPoll(
|
||||
openPeriod: LongSeconds? = null,
|
||||
closeDate: LongSeconds? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<PollContent> = execute(
|
||||
@@ -172,11 +187,13 @@ public suspend fun TelegramBot.sendQuizPoll(
|
||||
openPeriod = openPeriod,
|
||||
closeDate = closeDate,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -194,11 +211,13 @@ public suspend fun TelegramBot.sendQuizPoll(
|
||||
isAnonymous: Boolean = true,
|
||||
isClosed: Boolean = false,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<PollContent> = execute(
|
||||
@@ -214,11 +233,13 @@ public suspend fun TelegramBot.sendQuizPoll(
|
||||
isAnonymous = isAnonymous,
|
||||
isClosed = isClosed,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -235,11 +256,13 @@ public suspend fun TelegramBot.sendQuizPoll(
|
||||
isAnonymous: Boolean = true,
|
||||
isClosed: Boolean = false,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<PollContent> = execute(
|
||||
@@ -254,11 +277,13 @@ public suspend fun TelegramBot.sendQuizPoll(
|
||||
isAnonymous = isAnonymous,
|
||||
isClosed = isClosed,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -275,11 +300,13 @@ public suspend fun TelegramBot.sendQuizPoll(
|
||||
isAnonymous: Boolean = true,
|
||||
isClosed: Boolean = false,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<PollContent> = execute(
|
||||
@@ -294,11 +321,13 @@ public suspend fun TelegramBot.sendQuizPoll(
|
||||
isAnonymous = isAnonymous,
|
||||
isClosed = isClosed,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -314,11 +343,13 @@ public suspend fun TelegramBot.sendQuizPoll(
|
||||
isAnonymous: Boolean = true,
|
||||
isClosed: Boolean = false,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<PollContent> = execute(
|
||||
@@ -332,11 +363,13 @@ public suspend fun TelegramBot.sendQuizPoll(
|
||||
isAnonymous = isAnonymous,
|
||||
isClosed = isClosed,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
@@ -6,6 +6,7 @@ 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.SuggestedPostParameters
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||
import dev.inmo.tgbotapi.types.message.content.PollContent
|
||||
import dev.inmo.tgbotapi.types.message.textsources.TextSource
|
||||
@@ -24,11 +25,13 @@ public suspend fun TelegramBot.sendRegularPoll(
|
||||
openPeriod: LongSeconds? = null,
|
||||
closeDate: LongSeconds? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<PollContent> = execute(
|
||||
@@ -43,13 +46,15 @@ public suspend fun TelegramBot.sendRegularPoll(
|
||||
openPeriod = openPeriod,
|
||||
closeDate = closeDate,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
)
|
||||
|
||||
@@ -63,11 +68,13 @@ public suspend fun TelegramBot.sendRegularPoll(
|
||||
openPeriod: LongSeconds? = null,
|
||||
closeDate: LongSeconds? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<PollContent> = execute(
|
||||
@@ -81,13 +88,15 @@ public suspend fun TelegramBot.sendRegularPoll(
|
||||
openPeriod = openPeriod,
|
||||
closeDate = closeDate,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
)
|
||||
|
||||
@@ -101,11 +110,13 @@ public suspend fun TelegramBot.sendRegularPoll(
|
||||
isClosed: Boolean = false,
|
||||
allowMultipleAnswers: Boolean = false,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<PollContent> = execute(
|
||||
@@ -119,13 +130,15 @@ public suspend fun TelegramBot.sendRegularPoll(
|
||||
isClosed = isClosed,
|
||||
allowMultipleAnswers = allowMultipleAnswers,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
)
|
||||
|
||||
@@ -138,11 +151,13 @@ public suspend fun TelegramBot.sendRegularPoll(
|
||||
isClosed: Boolean = false,
|
||||
allowMultipleAnswers: Boolean = false,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<PollContent> = execute(
|
||||
@@ -155,12 +170,14 @@ public suspend fun TelegramBot.sendRegularPoll(
|
||||
isClosed = isClosed,
|
||||
allowMultipleAnswers = allowMultipleAnswers,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
)
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
package dev.inmo.tgbotapi.extensions.api.suggested
|
||||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.suggested.ApproveSuggestedPost
|
||||
import dev.inmo.tgbotapi.types.IdChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.MessageId
|
||||
import dev.inmo.tgbotapi.types.TelegramDate
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
||||
|
||||
public suspend fun TelegramBot.approveSuggestedPost(
|
||||
chatId: IdChatIdentifier,
|
||||
messageId: MessageId,
|
||||
sendDate: TelegramDate? = null,
|
||||
): Boolean = execute(
|
||||
ApproveSuggestedPost(chatId, messageId, sendDate)
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.approveSuggestedPost(
|
||||
chat: Chat,
|
||||
messageId: MessageId,
|
||||
sendDate: TelegramDate? = null,
|
||||
): Boolean = approveSuggestedPost(chat.id, messageId, sendDate)
|
||||
|
||||
public suspend fun TelegramBot.approveSuggestedPost(
|
||||
message: Message,
|
||||
sendDate: TelegramDate? = null,
|
||||
): Boolean = approveSuggestedPost(message.chat, message.messageId, sendDate)
|
||||
@@ -0,0 +1,29 @@
|
||||
package dev.inmo.tgbotapi.extensions.api.suggested
|
||||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.suggested.ApproveSuggestedPost
|
||||
import dev.inmo.tgbotapi.requests.suggested.DeclineSuggestedPost
|
||||
import dev.inmo.tgbotapi.types.IdChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.MessageId
|
||||
import dev.inmo.tgbotapi.types.TelegramDate
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
||||
|
||||
public suspend fun TelegramBot.declineSuggestedPost(
|
||||
chatId: IdChatIdentifier,
|
||||
messageId: MessageId,
|
||||
comment: String? = null,
|
||||
): Boolean = execute(
|
||||
DeclineSuggestedPost(chatId, messageId, comment)
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.declineSuggestedPost(
|
||||
chat: Chat,
|
||||
messageId: MessageId,
|
||||
comment: String? = null,
|
||||
): Boolean = declineSuggestedPost(chat.id, messageId, comment)
|
||||
|
||||
public suspend fun TelegramBot.declineSuggestedPost(
|
||||
message: Message,
|
||||
comment: String? = null,
|
||||
): Boolean = declineSuggestedPost(message.chat, message.messageId, comment)
|
||||
@@ -35,14 +35,14 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourConte
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextWithFSMBuilderKt {
|
||||
public static final fun buildBehaviourWithFSM (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
public static final fun buildBehaviourWithFSM (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/flow/Flow;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
public static synthetic fun buildBehaviourWithFSM$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
|
||||
public static synthetic fun buildBehaviourWithFSM$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/flow/Flow;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
|
||||
public static final fun buildBehaviourWithFSMAndStartLongPolling (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;Lkotlin/jvm/functions/Function3;IZZLjava/lang/Long;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
public static final fun buildBehaviourWithFSMAndStartLongPolling (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/flow/Flow;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;Lkotlin/jvm/functions/Function3;IZZLjava/lang/Long;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
public static synthetic fun buildBehaviourWithFSMAndStartLongPolling$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;Lkotlin/jvm/functions/Function3;IZZLjava/lang/Long;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
|
||||
public static synthetic fun buildBehaviourWithFSMAndStartLongPolling$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/flow/Flow;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;Lkotlin/jvm/functions/Function3;IZZLjava/lang/Long;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
|
||||
public static final fun buildBehaviourWithFSM (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;ZLkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
public static final fun buildBehaviourWithFSM (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/flow/Flow;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;ZLkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
public static synthetic fun buildBehaviourWithFSM$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;ZLkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
|
||||
public static synthetic fun buildBehaviourWithFSM$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/flow/Flow;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;ZLkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
|
||||
public static final fun buildBehaviourWithFSMAndStartLongPolling (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;Lkotlin/jvm/functions/Function3;IZZLjava/lang/Long;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;ZLkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
public static final fun buildBehaviourWithFSMAndStartLongPolling (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/flow/Flow;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;Lkotlin/jvm/functions/Function3;IZZLjava/lang/Long;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;ZLkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
public static synthetic fun buildBehaviourWithFSMAndStartLongPolling$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;Lkotlin/jvm/functions/Function3;IZZLjava/lang/Long;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;ZLkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
|
||||
public static synthetic fun buildBehaviourWithFSMAndStartLongPolling$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/flow/Flow;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;Lkotlin/jvm/functions/Function3;IZZLjava/lang/Long;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;ZLkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextWithFSMKt {
|
||||
@@ -128,9 +128,9 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/DefaultBehavio
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/TelegramBotWithFSMKt {
|
||||
public static final fun telegramBotWithBehaviourAndFSM (Ljava/lang/String;Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;Lkotlinx/coroutines/CoroutineScope;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;ZLkotlin/jvm/functions/Function3;IZZLjava/lang/Long;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
public static synthetic fun telegramBotWithBehaviourAndFSM$default (Ljava/lang/String;Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;Lkotlinx/coroutines/CoroutineScope;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;ZLkotlin/jvm/functions/Function3;IZZLjava/lang/Long;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
|
||||
public static final fun telegramBotWithBehaviourAndFSMAndStartLongPolling (Ljava/lang/String;Lkotlinx/coroutines/CoroutineScope;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;ZLkotlin/jvm/functions/Function3;IZZLjava/lang/Long;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
public static synthetic fun telegramBotWithBehaviourAndFSMAndStartLongPolling$default (Ljava/lang/String;Lkotlinx/coroutines/CoroutineScope;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;ZLkotlin/jvm/functions/Function3;IZZLjava/lang/Long;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
|
||||
public static final fun telegramBotWithBehaviourAndFSM (Ljava/lang/String;Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;Lkotlinx/coroutines/CoroutineScope;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;ZLkotlin/jvm/functions/Function3;IZZLjava/lang/Long;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;ZLkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
public static synthetic fun telegramBotWithBehaviourAndFSM$default (Ljava/lang/String;Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;Lkotlinx/coroutines/CoroutineScope;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;ZLkotlin/jvm/functions/Function3;IZZLjava/lang/Long;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;ZLkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
|
||||
public static final fun telegramBotWithBehaviourAndFSMAndStartLongPolling (Ljava/lang/String;Lkotlinx/coroutines/CoroutineScope;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;ZLkotlin/jvm/functions/Function3;IZZLjava/lang/Long;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;ZLkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
public static synthetic fun telegramBotWithBehaviourAndFSMAndStartLongPolling$default (Ljava/lang/String;Lkotlinx/coroutines/CoroutineScope;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;ZLkotlin/jvm/functions/Function3;IZZLjava/lang/Long;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;ZLkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
|
||||
}
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ import dev.inmo.tgbotapi.types.update.abstracts.Update
|
||||
import dev.inmo.tgbotapi.updateshandlers.FlowsUpdatesFilter
|
||||
import kotlinx.coroutines.*
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
import kotlinx.coroutines.flow.emptyFlow
|
||||
|
||||
/**
|
||||
* Creates [BehaviourContextWithFSM] via creating of [DefaultBehaviourContext] with [this] as [TelegramBot],
|
||||
@@ -35,12 +36,14 @@ suspend fun <T : State> TelegramBot.buildBehaviourWithFSM(
|
||||
onStateHandlingErrorHandler: StateHandlingErrorHandler<T> = defaultStateHandlingErrorHandler(),
|
||||
subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {},
|
||||
stateInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContextWithFSM<T>, Unit, T> = {},
|
||||
useDefaultSubcontextInitialAction: Boolean = true,
|
||||
block: CustomBehaviourContextReceiver<DefaultBehaviourContextWithFSM<T>, Unit>
|
||||
): DefaultBehaviourContextWithFSM<T> = BehaviourContextWithFSM(
|
||||
behaviourContext = DefaultBehaviourContext(
|
||||
behaviourContext = BehaviourContext(
|
||||
bot = this,
|
||||
scope = defaultExceptionsHandler ?.let { scope + ContextSafelyExceptionHandler(it) } ?: scope,
|
||||
upstreamUpdatesFlow = upstreamUpdatesFlow,
|
||||
upstreamUpdatesFlow = upstreamUpdatesFlow ?: emptyFlow(),
|
||||
useDefaultSubcontextInitialAction = useDefaultSubcontextInitialAction,
|
||||
subcontextInitialAction = subcontextInitialAction
|
||||
),
|
||||
handlers = presetHandlers,
|
||||
@@ -73,6 +76,7 @@ suspend fun <T : State> TelegramBot.buildBehaviourWithFSMAndStartLongPolling(
|
||||
mediaGroupsDebounceTimeMillis: Long? = 1000L,
|
||||
subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {},
|
||||
stateInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContextWithFSM<T>, Unit, T> = {},
|
||||
useDefaultSubcontextInitialAction: Boolean = true,
|
||||
block: CustomBehaviourContextReceiver<DefaultBehaviourContextWithFSM<T>, Unit>
|
||||
): Pair<DefaultBehaviourContextWithFSM<T>, Job> = buildBehaviourWithFSM(
|
||||
upstreamUpdatesFlow = upstreamUpdatesFlow,
|
||||
@@ -84,6 +88,7 @@ suspend fun <T : State> TelegramBot.buildBehaviourWithFSMAndStartLongPolling(
|
||||
onStateHandlingErrorHandler = onStateHandlingErrorHandler,
|
||||
subcontextInitialAction = subcontextInitialAction,
|
||||
stateInitialAction = stateInitialAction,
|
||||
useDefaultSubcontextInitialAction = useDefaultSubcontextInitialAction,
|
||||
block = block
|
||||
).run {
|
||||
this to scope.launch {
|
||||
@@ -120,13 +125,15 @@ suspend fun <T : State> TelegramBot.buildBehaviourWithFSM(
|
||||
onStateHandlingErrorHandler: StateHandlingErrorHandler<T> = defaultStateHandlingErrorHandler(),
|
||||
subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {},
|
||||
stateInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContextWithFSM<T>, Unit, T> = {},
|
||||
useDefaultSubcontextInitialAction: Boolean = true,
|
||||
block: CustomBehaviourContextReceiver<DefaultBehaviourContextWithFSM<T>, Unit>
|
||||
): DefaultBehaviourContextWithFSM<T> = BehaviourContextWithFSM(
|
||||
DefaultBehaviourContext(
|
||||
BehaviourContext(
|
||||
this,
|
||||
defaultExceptionsHandler ?.let { scope + ContextSafelyExceptionHandler(it) } ?: scope,
|
||||
upstreamUpdatesFlow = flowUpdatesFilter.allUpdatesFlow,
|
||||
subcontextInitialAction = subcontextInitialAction
|
||||
subcontextInitialAction = subcontextInitialAction,
|
||||
useDefaultSubcontextInitialAction = useDefaultSubcontextInitialAction
|
||||
),
|
||||
presetHandlers,
|
||||
statesManager,
|
||||
@@ -163,6 +170,7 @@ suspend fun <T : State> TelegramBot.buildBehaviourWithFSMAndStartLongPolling(
|
||||
mediaGroupsDebounceTimeMillis: Long? = 1000L,
|
||||
subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {},
|
||||
stateInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContextWithFSM<T>, Unit, T> = {},
|
||||
useDefaultSubcontextInitialAction: Boolean = true,
|
||||
block: CustomBehaviourContextReceiver<DefaultBehaviourContextWithFSM<T>, Unit>
|
||||
) = FlowsUpdatesFilter().let {
|
||||
buildBehaviourWithFSM(
|
||||
@@ -175,6 +183,7 @@ suspend fun <T : State> TelegramBot.buildBehaviourWithFSMAndStartLongPolling(
|
||||
onStateHandlingErrorHandler = onStateHandlingErrorHandler,
|
||||
subcontextInitialAction = subcontextInitialAction,
|
||||
stateInitialAction = stateInitialAction,
|
||||
useDefaultSubcontextInitialAction = useDefaultSubcontextInitialAction,
|
||||
block = block
|
||||
).run {
|
||||
start()
|
||||
|
||||
@@ -58,6 +58,7 @@ suspend fun <T : State> telegramBotWithBehaviourAndFSM(
|
||||
subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {},
|
||||
stateInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContextWithFSM<T>, Unit, T> = {},
|
||||
fileLinkUrlMapper: TelegramAPIUrlsKeeper.(String) -> String = { "${fileBaseUrl}/$it" },
|
||||
useDefaultSubcontextInitialAction: Boolean = true,
|
||||
block: CustomBehaviourContextReceiver<DefaultBehaviourContextWithFSM<T>, Unit>
|
||||
): TelegramBot = telegramBot(
|
||||
token,
|
||||
@@ -80,6 +81,7 @@ suspend fun <T : State> telegramBotWithBehaviourAndFSM(
|
||||
mediaGroupsDebounceTimeMillis = mediaGroupsDebounceTimeMillis,
|
||||
subcontextInitialAction = subcontextInitialAction,
|
||||
stateInitialAction = stateInitialAction,
|
||||
useDefaultSubcontextInitialAction = useDefaultSubcontextInitialAction,
|
||||
block = block
|
||||
)
|
||||
}
|
||||
@@ -117,6 +119,7 @@ suspend fun <T : State> telegramBotWithBehaviourAndFSMAndStartLongPolling(
|
||||
subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {},
|
||||
stateInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContextWithFSM<T>, Unit, T> = {},
|
||||
fileLinkUrlMapper: TelegramAPIUrlsKeeper.(String) -> String = { "${fileBaseUrl}/$it" },
|
||||
useDefaultSubcontextInitialAction: Boolean = true,
|
||||
block: CustomBehaviourContextReceiver<DefaultBehaviourContextWithFSM<T>, Unit>
|
||||
): Pair<TelegramBot, Job> {
|
||||
return telegramBot(
|
||||
@@ -139,6 +142,7 @@ suspend fun <T : State> telegramBotWithBehaviourAndFSMAndStartLongPolling(
|
||||
mediaGroupsDebounceTimeMillis = mediaGroupsDebounceTimeMillis,
|
||||
subcontextInitialAction = subcontextInitialAction,
|
||||
stateInitialAction = stateInitialAction,
|
||||
useDefaultSubcontextInitialAction = useDefaultSubcontextInitialAction,
|
||||
block = block
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourBuildersKt {
|
||||
public static final fun buildBehaviour (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
public static synthetic fun buildBehaviour$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
|
||||
public static final fun buildBehaviourWithLongPolling (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function2;IZZLjava/lang/Long;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
public static synthetic fun buildBehaviourWithLongPolling$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function2;IZZLjava/lang/Long;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
|
||||
public static final fun buildBehaviour (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function3;ZLkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
public static synthetic fun buildBehaviour$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function3;ZLkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
|
||||
public static final fun buildBehaviourWithLongPolling (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function2;IZZLjava/lang/Long;Lkotlin/jvm/functions/Function3;ZLkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
public static synthetic fun buildBehaviourWithLongPolling$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function2;IZZLjava/lang/Long;Lkotlin/jvm/functions/Function3;ZLkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
|
||||
}
|
||||
|
||||
public abstract interface class dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext : dev/inmo/tgbotapi/bot/RequestsExecutor, dev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter, kotlinx/coroutines/CoroutineScope {
|
||||
@@ -64,13 +64,18 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourConte
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextKt {
|
||||
public static final fun BehaviourContext (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;Lkotlin/jvm/functions/Function3;)Ldev/inmo/tgbotapi/extensions/behaviour_builder/DefaultBehaviourContext;
|
||||
public static final fun BehaviourContext (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||
public static synthetic fun BehaviourContext$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Ldev/inmo/tgbotapi/extensions/behaviour_builder/DefaultBehaviourContext;
|
||||
public static synthetic fun BehaviourContext$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ljava/lang/Object;
|
||||
public static final fun BehaviourContext (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;Lkotlin/jvm/functions/Function3;ZLkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||
public static final fun BehaviourContext (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;ZLkotlin/jvm/functions/Function3;)Ldev/inmo/tgbotapi/extensions/behaviour_builder/DefaultBehaviourContext;
|
||||
public static final fun BehaviourContext (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;Lkotlinx/coroutines/flow/Flow;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;Lkotlin/jvm/functions/Function3;ZLkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||
public static final fun BehaviourContext (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;Lkotlinx/coroutines/flow/Flow;Lkotlin/jvm/functions/Function3;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;Z)Ldev/inmo/tgbotapi/extensions/behaviour_builder/DefaultBehaviourContext;
|
||||
public static synthetic fun BehaviourContext$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;Lkotlin/jvm/functions/Function3;ZLkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ljava/lang/Object;
|
||||
public static synthetic fun BehaviourContext$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;ZLkotlin/jvm/functions/Function3;ILjava/lang/Object;)Ldev/inmo/tgbotapi/extensions/behaviour_builder/DefaultBehaviourContext;
|
||||
public static synthetic fun BehaviourContext$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;Lkotlinx/coroutines/flow/Flow;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;Lkotlin/jvm/functions/Function3;ZLkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ljava/lang/Object;
|
||||
public static synthetic fun BehaviourContext$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;Lkotlinx/coroutines/flow/Flow;Lkotlin/jvm/functions/Function3;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;ZILjava/lang/Object;)Ldev/inmo/tgbotapi/extensions/behaviour_builder/DefaultBehaviourContext;
|
||||
public static final fun BehaviourContextAndTwoTypesReceiver (Lkotlin/jvm/functions/Function4;)Lkotlin/jvm/functions/Function4;
|
||||
public static final fun BehaviourContextAndTypeReceiver (Lkotlin/jvm/functions/Function3;)Lkotlin/jvm/functions/Function3;
|
||||
public static final fun BehaviourContextReceiver (Lkotlin/jvm/functions/Function2;)Lkotlin/jvm/functions/Function2;
|
||||
public static final fun CustomBehaviourContextAndTypeReceiver (Lkotlin/jvm/functions/Function3;)Lkotlin/jvm/functions/Function3;
|
||||
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;Lkotlin/jvm/functions/Function3;)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;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;
|
||||
@@ -110,8 +115,8 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/CombinedSubcon
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/DefaultBehaviourContext : dev/inmo/tgbotapi/updateshandlers/AbstractFlowsUpdatesFilter, dev/inmo/tgbotapi/bot/RequestsExecutor, dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext, kotlinx/coroutines/CoroutineScope {
|
||||
public fun <init> (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;ILkotlinx/coroutines/channels/BufferOverflow;Lkotlinx/coroutines/flow/Flow;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;Lkotlin/jvm/functions/Function3;)V
|
||||
public synthetic fun <init> (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;ILkotlinx/coroutines/channels/BufferOverflow;Lkotlinx/coroutines/flow/Flow;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;Lkotlin/jvm/functions/Function3;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
|
||||
public fun <init> (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;ILkotlinx/coroutines/channels/BufferOverflow;Lkotlinx/coroutines/flow/Flow;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextData;Lkotlin/jvm/functions/Function3;)V
|
||||
public synthetic fun <init> (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;ILkotlinx/coroutines/channels/BufferOverflow;Lkotlinx/coroutines/flow/Flow;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextData;Lkotlin/jvm/functions/Function3;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
|
||||
public fun close ()V
|
||||
public synthetic fun copy (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;ILkotlinx/coroutines/channels/BufferOverflow;Lkotlinx/coroutines/flow/Flow;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;Lkotlin/jvm/functions/Function3;)Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;
|
||||
public fun copy (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;ILkotlinx/coroutines/channels/BufferOverflow;Lkotlinx/coroutines/flow/Flow;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;Lkotlin/jvm/functions/Function3;)Ldev/inmo/tgbotapi/extensions/behaviour_builder/DefaultBehaviourContext;
|
||||
@@ -134,10 +139,10 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/DefaultCorouti
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/TelegramBotKt {
|
||||
public static final fun telegramBotWithBehaviour (Ljava/lang/String;Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;Lkotlinx/coroutines/CoroutineScope;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;ZLkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
public static synthetic fun telegramBotWithBehaviour$default (Ljava/lang/String;Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;Lkotlinx/coroutines/CoroutineScope;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;ZLkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
|
||||
public static final fun telegramBotWithBehaviourAndLongPolling (Ljava/lang/String;Lkotlinx/coroutines/CoroutineScope;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;ZIZZLjava/lang/Long;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
public static synthetic fun telegramBotWithBehaviourAndLongPolling$default (Ljava/lang/String;Lkotlinx/coroutines/CoroutineScope;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;ZIZZLjava/lang/Long;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
|
||||
public static final fun telegramBotWithBehaviour (Ljava/lang/String;Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;Lkotlinx/coroutines/CoroutineScope;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;ZLkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;ZLkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
public static synthetic fun telegramBotWithBehaviour$default (Ljava/lang/String;Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;Lkotlinx/coroutines/CoroutineScope;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;ZLkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;ZLkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
|
||||
public static final fun telegramBotWithBehaviourAndLongPolling (Ljava/lang/String;Lkotlinx/coroutines/CoroutineScope;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;ZIZZLjava/lang/Long;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;ZLkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
public static synthetic fun telegramBotWithBehaviourAndLongPolling$default (Ljava/lang/String;Lkotlinx/coroutines/CoroutineScope;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;ZIZZLjava/lang/Long;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;ZLkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/VariantsKt {
|
||||
@@ -334,12 +339,12 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/W
|
||||
public static final fun requireCommandAtStart (Lkotlinx/coroutines/flow/Flow;)Lkotlinx/coroutines/flow/Flow;
|
||||
public static final fun requireCommandsWithoutParams (Lkotlinx/coroutines/flow/Flow;)Lkotlinx/coroutines/flow/Flow;
|
||||
public static final fun requireSingleCommand (Lkotlinx/coroutines/flow/Flow;)Lkotlinx/coroutines/flow/Flow;
|
||||
public static final fun waitCommandMessage (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
|
||||
public static final fun waitCommandMessage (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
|
||||
public static final fun waitCommandMessage (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
|
||||
public static synthetic fun waitCommandMessage$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
|
||||
public static synthetic fun waitCommandMessage$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
|
||||
public static synthetic fun waitCommandMessage$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
|
||||
public static final fun waitCommandMessage (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;Ldev/inmo/tgbotapi/requests/abstracts/Request;ZLkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
|
||||
public static final fun waitCommandMessage (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/requests/abstracts/Request;ZLkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
|
||||
public static final fun waitCommandMessage (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Ldev/inmo/tgbotapi/requests/abstracts/Request;ZLkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
|
||||
public static synthetic fun waitCommandMessage$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;Ldev/inmo/tgbotapi/requests/abstracts/Request;ZLkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
|
||||
public static synthetic fun waitCommandMessage$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/requests/abstracts/Request;ZLkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
|
||||
public static synthetic fun waitCommandMessage$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Ldev/inmo/tgbotapi/requests/abstracts/Request;ZLkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitContentKt {
|
||||
@@ -485,12 +490,12 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/W
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitDeepLinksKt {
|
||||
public static final fun waitDeepLinks (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
|
||||
public static final fun waitDeepLinks (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
|
||||
public static final fun waitDeepLinks (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
|
||||
public static synthetic fun waitDeepLinks$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
|
||||
public static synthetic fun waitDeepLinks$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
|
||||
public static synthetic fun waitDeepLinks$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
|
||||
public static final fun waitDeepLinks (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;ZLkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
|
||||
public static final fun waitDeepLinks (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/requests/abstracts/Request;ZLkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
|
||||
public static final fun waitDeepLinks (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Ldev/inmo/tgbotapi/requests/abstracts/Request;ZLkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
|
||||
public static synthetic fun waitDeepLinks$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;ZLkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
|
||||
public static synthetic fun waitDeepLinks$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/requests/abstracts/Request;ZLkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
|
||||
public static synthetic fun waitDeepLinks$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Ldev/inmo/tgbotapi/requests/abstracts/Request;ZLkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitDeletedBusinessMessagesKt {
|
||||
@@ -687,6 +692,16 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/W
|
||||
public static synthetic fun waitRegularGiftSentOrReceived$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
|
||||
public static final fun waitSuccessfulPaymentEvents (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
|
||||
public static synthetic fun waitSuccessfulPaymentEvents$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
|
||||
public static final fun waitSuggestedPostApprovalFailed (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
|
||||
public static synthetic fun waitSuggestedPostApprovalFailed$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
|
||||
public static final fun waitSuggestedPostApproved (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
|
||||
public static synthetic fun waitSuggestedPostApproved$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
|
||||
public static final fun waitSuggestedPostDeclined (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
|
||||
public static synthetic fun waitSuggestedPostDeclined$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
|
||||
public static final fun waitSuggestedPostPaid (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
|
||||
public static synthetic fun waitSuggestedPostPaid$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
|
||||
public static final fun waitSuggestedPostRefunded (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
|
||||
public static synthetic fun waitSuggestedPostRefunded$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
|
||||
public static final fun waitSupergroupChatCreatedEvents (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
|
||||
public static synthetic fun waitSupergroupChatCreatedEvents$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
|
||||
public static final fun waitSupergroupEvents (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
|
||||
@@ -1151,42 +1166,42 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handl
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/CommandHandlingKt {
|
||||
public static final fun command (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
|
||||
public static final fun command (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
|
||||
public static final fun command (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
|
||||
public static synthetic fun command$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
||||
public static synthetic fun command$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
||||
public static synthetic fun command$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
||||
public static final fun commandWithArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;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/Function4;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job;
|
||||
public static final fun commandWithArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;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/Function4;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job;
|
||||
public static final fun commandWithArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;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/Function4;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job;
|
||||
public static synthetic fun commandWithArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;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/Function4;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
||||
public static synthetic fun commandWithArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;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/Function4;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
||||
public static synthetic fun commandWithArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;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/Function4;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
||||
public static final fun commandWithNamedArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;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/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job;
|
||||
public static final fun commandWithNamedArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;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/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job;
|
||||
public static final fun commandWithNamedArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;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/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job;
|
||||
public static synthetic fun commandWithNamedArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;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/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
||||
public static synthetic fun commandWithNamedArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;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/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
||||
public static synthetic fun commandWithNamedArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;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/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
||||
public static final fun onCommand (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
|
||||
public static final fun onCommand (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
|
||||
public static final fun onCommand (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
|
||||
public static synthetic fun onCommand$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
||||
public static synthetic fun onCommand$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
||||
public static synthetic fun onCommand$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
||||
public static final fun onCommandWithArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;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/Function4;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job;
|
||||
public static final fun onCommandWithArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;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/Function4;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job;
|
||||
public static final fun onCommandWithArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;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/Function4;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job;
|
||||
public static synthetic fun onCommandWithArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;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/Function4;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
||||
public static synthetic fun onCommandWithArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;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/Function4;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
||||
public static synthetic fun onCommandWithArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;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/Function4;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
||||
public static final fun onCommandWithNamedArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;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/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job;
|
||||
public static final fun onCommandWithNamedArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;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/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job;
|
||||
public static final fun onCommandWithNamedArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;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/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job;
|
||||
public static synthetic fun onCommandWithNamedArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;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/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
||||
public static synthetic fun onCommandWithNamedArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;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/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
||||
public static synthetic fun onCommandWithNamedArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;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/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
||||
public static final fun command (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;ZLkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
|
||||
public static final fun command (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;ZLkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
|
||||
public static final fun command (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;ZLkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
|
||||
public static synthetic fun command$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;ZLkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
||||
public static synthetic fun command$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;ZLkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
||||
public static synthetic fun command$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;ZLkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
||||
public static final fun commandWithArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;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/Function4;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job;
|
||||
public static final fun commandWithArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;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/Function4;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job;
|
||||
public static final fun commandWithArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;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/Function4;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job;
|
||||
public static synthetic fun commandWithArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;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/Function4;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
||||
public static synthetic fun commandWithArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;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/Function4;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
||||
public static synthetic fun commandWithArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;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/Function4;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
||||
public static final fun commandWithNamedArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;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/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job;
|
||||
public static final fun commandWithNamedArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;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/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job;
|
||||
public static final fun commandWithNamedArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;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/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job;
|
||||
public static synthetic fun commandWithNamedArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;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/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
||||
public static synthetic fun commandWithNamedArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;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/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
||||
public static synthetic fun commandWithNamedArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;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/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
||||
public static final fun onCommand (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;ZLkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
|
||||
public static final fun onCommand (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;ZLkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
|
||||
public static final fun onCommand (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;ZLkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
|
||||
public static synthetic fun onCommand$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;ZLkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
||||
public static synthetic fun onCommand$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;ZLkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
||||
public static synthetic fun onCommand$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;ZLkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
||||
public static final fun onCommandWithArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;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/Function4;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job;
|
||||
public static final fun onCommandWithArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;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/Function4;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job;
|
||||
public static final fun onCommandWithArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;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/Function4;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job;
|
||||
public static synthetic fun onCommandWithArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;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/Function4;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
||||
public static synthetic fun onCommandWithArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;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/Function4;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
||||
public static synthetic fun onCommandWithArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;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/Function4;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
||||
public static final fun onCommandWithNamedArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;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/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job;
|
||||
public static final fun onCommandWithNamedArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;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/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job;
|
||||
public static final fun onCommandWithNamedArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;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/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job;
|
||||
public static synthetic fun onCommandWithNamedArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;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/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
||||
public static synthetic fun onCommandWithNamedArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;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/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
||||
public static synthetic fun onCommandWithNamedArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;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/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/CommandHandlingUnhandledKt {
|
||||
@@ -1403,6 +1418,16 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handl
|
||||
public static synthetic fun onRegularGiftSentOrReceived$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/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
||||
public static final fun onSuccessfulPayment (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/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
|
||||
public static synthetic fun onSuccessfulPayment$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/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
||||
public static final fun onSuggestedPostApprovalFailed (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/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
|
||||
public static synthetic fun onSuggestedPostApprovalFailed$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/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
||||
public static final fun onSuggestedPostApproved (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/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
|
||||
public static synthetic fun onSuggestedPostApproved$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/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
||||
public static final fun onSuggestedPostDeclined (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/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
|
||||
public static synthetic fun onSuggestedPostDeclined$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/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
||||
public static final fun onSuggestedPostPaid (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/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
|
||||
public static synthetic fun onSuggestedPostPaid$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/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
||||
public static final fun onSuggestedPostRefunded (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/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
|
||||
public static synthetic fun onSuggestedPostRefunded$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/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
||||
public static final fun onSupergroupChatCreated (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/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
|
||||
public static synthetic fun onSupergroupChatCreated$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/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
||||
public static final fun onSupergroupEvent (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/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
|
||||
@@ -1587,6 +1612,32 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handl
|
||||
public static synthetic fun onShippingQuery$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/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/utils/DefaultCustomBehaviourContextAndTypeReceiver : kotlin/coroutines/jvm/internal/SuspendFunction, kotlin/jvm/functions/Function3 {
|
||||
public static final field BOT_INFO_RECEIVER Ljava/lang/String;
|
||||
public static final field Companion Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/DefaultCustomBehaviourContextAndTypeReceiver$Companion;
|
||||
public fun <init> (Lkotlin/jvm/functions/Function3;)V
|
||||
public fun invoke (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/update/abstracts/Update;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
public final fun invoke (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextData;)V
|
||||
public synthetic fun invoke (Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/utils/DefaultCustomBehaviourContextAndTypeReceiver$Companion {
|
||||
}
|
||||
|
||||
public abstract interface class dev/inmo/tgbotapi/extensions/behaviour_builder/utils/DefaultCustomBehaviourContextAndTypeReceiver$IReceiver {
|
||||
public abstract fun invoke (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/utils/DefaultCustomBehaviourContextAndTypeReceiverKt {
|
||||
public static final fun botInfo (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
public static final fun containsCommand (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ljava/util/List;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
public static final fun containsCommand (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Ljava/util/List;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
public static final fun containsCommand (Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
public static final fun containsCommand (Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
public static final fun optionallyWithDefaultReceiver (Lkotlin/jvm/functions/Function3;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextData;)Lkotlin/jvm/functions/Function3;
|
||||
public static final fun withDefaultReceiver (Lkotlin/jvm/functions/Function3;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextData;)Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/DefaultCustomBehaviourContextAndTypeReceiver;
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/utils/LiveLocationKt {
|
||||
public static final fun followLocation (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/message/abstracts/ContentMessage;Lkotlin/jvm/functions/Function3;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
}
|
||||
|
||||
@@ -3,6 +3,8 @@ package dev.inmo.tgbotapi.extensions.behaviour_builder
|
||||
import dev.inmo.micro_utils.coroutines.ContextSafelyExceptionHandler
|
||||
import dev.inmo.micro_utils.coroutines.ExceptionHandler
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.DefaultCustomBehaviourContextAndTypeReceiver
|
||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.optionallyWithDefaultReceiver
|
||||
import dev.inmo.tgbotapi.extensions.utils.updates.retrieving.longPolling
|
||||
import dev.inmo.tgbotapi.extensions.utils.updates.retrieving.startGettingOfUpdatesByLongPolling
|
||||
import dev.inmo.tgbotapi.extensions.utils.updates.retrieving.updateHandlerWithMediaGroupsAdaptation
|
||||
@@ -31,6 +33,7 @@ suspend fun TelegramBot.buildBehaviour(
|
||||
scope: CoroutineScope = defaultCoroutineScopeProvider(),
|
||||
defaultExceptionsHandler: ExceptionHandler<Unit>? = null,
|
||||
subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {},
|
||||
useDefaultSubcontextInitialAction: Boolean = true,
|
||||
block: BehaviourContextReceiver<Unit>
|
||||
): BehaviourContext = BehaviourContext(
|
||||
bot = this,
|
||||
@@ -42,6 +45,7 @@ suspend fun TelegramBot.buildBehaviour(
|
||||
}
|
||||
},
|
||||
flowsUpdatesFilter = flowUpdatesFilter,
|
||||
useDefaultSubcontextInitialAction = useDefaultSubcontextInitialAction,
|
||||
subcontextInitialAction = subcontextInitialAction
|
||||
).apply {
|
||||
block()
|
||||
@@ -67,12 +71,14 @@ suspend fun TelegramBot.buildBehaviourWithLongPolling(
|
||||
autoSkipTimeoutExceptions: Boolean = true,
|
||||
mediaGroupsDebounceTimeMillis: Long? = 1000L,
|
||||
subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {},
|
||||
useDefaultSubcontextInitialAction: Boolean = true,
|
||||
block: BehaviourContextReceiver<Unit>
|
||||
): Job {
|
||||
val behaviourContext = buildBehaviour(
|
||||
scope = scope,
|
||||
defaultExceptionsHandler = defaultExceptionsHandler,
|
||||
subcontextInitialAction = subcontextInitialAction,
|
||||
useDefaultSubcontextInitialAction = useDefaultSubcontextInitialAction,
|
||||
block = block
|
||||
)
|
||||
return longPolling(
|
||||
@@ -81,6 +87,7 @@ suspend fun TelegramBot.buildBehaviourWithLongPolling(
|
||||
timeoutSeconds = timeoutSeconds,
|
||||
autoDisableWebhooks = autoDisableWebhooks,
|
||||
autoSkipTimeoutExceptions = autoSkipTimeoutExceptions,
|
||||
mediaGroupsDebounceTimeMillis = mediaGroupsDebounceTimeMillis
|
||||
mediaGroupsDebounceTimeMillis = mediaGroupsDebounceTimeMillis,
|
||||
exceptionsHandler = defaultExceptionsHandler
|
||||
)
|
||||
}
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
package dev.inmo.tgbotapi.extensions.behaviour_builder
|
||||
|
||||
import dev.inmo.kslog.common.KSLog
|
||||
import dev.inmo.micro_utils.coroutines.*
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.handlers_registrar.TriggersHolder
|
||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.optionallyWithDefaultReceiver
|
||||
import dev.inmo.tgbotapi.types.UpdateId
|
||||
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
||||
import dev.inmo.tgbotapi.updateshandlers.*
|
||||
@@ -24,6 +24,7 @@ typealias CustomBehaviourContextAndTwoTypesReceiver<BC, T, I1, I2> = suspend BC.
|
||||
typealias BehaviourContextAndTwoTypesReceiver<T, I1, I2> = CustomBehaviourContextAndTwoTypesReceiver<BehaviourContext, T, I1, I2>
|
||||
inline fun <T> BehaviourContextReceiver(noinline block: BehaviourContextReceiver<T>) = block
|
||||
inline fun <BC, T> CustomBehaviourContextReceiver(noinline block: CustomBehaviourContextReceiver<BC, T>) = block
|
||||
inline fun <BC, T, I> CustomBehaviourContextAndTypeReceiver(noinline block: CustomBehaviourContextAndTypeReceiver<BC, T, I>) = block
|
||||
inline fun <T, I> BehaviourContextAndTypeReceiver(noinline block: BehaviourContextAndTypeReceiver<T, I>) = block
|
||||
inline fun <T, I1, I2> BehaviourContextAndTwoTypesReceiver(noinline block: BehaviourContextAndTwoTypesReceiver<T, I1, I2>) = block
|
||||
internal inline fun <BC, T, I1, I2> CustomBehaviourContextAndTwoTypesReceiver<BC, T, I1, I2>.toOneType(
|
||||
@@ -82,6 +83,7 @@ class DefaultBehaviourContext(
|
||||
onBufferOverflow: BufferOverflow = BufferOverflow.SUSPEND,
|
||||
private val upstreamUpdatesFlow: Flow<Update>? = null,
|
||||
override val triggersHolder: TriggersHolder = TriggersHolder(),
|
||||
override val data: BehaviourContextData = BehaviourContextData(),
|
||||
override val subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {}
|
||||
) : AbstractFlowsUpdatesFilter(), TelegramBot by bot, CoroutineScope by scope, BehaviourContext {
|
||||
|
||||
@@ -106,8 +108,6 @@ class DefaultBehaviourContext(
|
||||
}.accumulatorFlow(WeakScope(scope))
|
||||
override val asUpdateReceiver: UpdateReceiver<Update> = additionalUpdatesSharedFlow::emit
|
||||
|
||||
override val data: BehaviourContextData = BehaviourContextData()
|
||||
|
||||
override fun copy(
|
||||
bot: TelegramBot,
|
||||
scope: CoroutineScope,
|
||||
@@ -123,6 +123,7 @@ class DefaultBehaviourContext(
|
||||
onBufferOverflow = onBufferOverflow,
|
||||
upstreamUpdatesFlow = upstreamUpdatesFlow,
|
||||
triggersHolder = triggersHolder,
|
||||
data = BehaviourContextData().apply { include(this@DefaultBehaviourContext.data) },
|
||||
subcontextInitialAction = subcontextInitialAction
|
||||
).apply {
|
||||
data.include(this@DefaultBehaviourContext.data)
|
||||
@@ -134,8 +135,19 @@ fun BehaviourContext(
|
||||
scope: CoroutineScope,
|
||||
flowsUpdatesFilter: FlowsUpdatesFilter = FlowsUpdatesFilter(),
|
||||
triggersHolder: TriggersHolder = TriggersHolder(),
|
||||
useDefaultSubcontextInitialAction: Boolean = true,
|
||||
subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {}
|
||||
) = DefaultBehaviourContext(bot, scope, upstreamUpdatesFlow = flowsUpdatesFilter.allUpdatesFlow, triggersHolder = triggersHolder, subcontextInitialAction = subcontextInitialAction)
|
||||
): DefaultBehaviourContext {
|
||||
val data = BehaviourContextData()
|
||||
return DefaultBehaviourContext(
|
||||
bot = bot,
|
||||
scope = scope,
|
||||
upstreamUpdatesFlow = flowsUpdatesFilter.allUpdatesFlow,
|
||||
triggersHolder = triggersHolder,
|
||||
data = data,
|
||||
subcontextInitialAction = subcontextInitialAction.optionallyWithDefaultReceiver(useDefaultSubcontextInitialAction, data)
|
||||
)
|
||||
}
|
||||
|
||||
inline fun <T> BehaviourContext(
|
||||
bot: TelegramBot,
|
||||
@@ -143,8 +155,58 @@ inline fun <T> BehaviourContext(
|
||||
flowsUpdatesFilter: FlowsUpdatesFilter = FlowsUpdatesFilter(),
|
||||
triggersHolder: TriggersHolder = TriggersHolder(),
|
||||
noinline subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {},
|
||||
useDefaultSubcontextInitialAction: Boolean = true,
|
||||
crossinline block: BehaviourContext.() -> T
|
||||
) = DefaultBehaviourContext(bot, scope, upstreamUpdatesFlow = flowsUpdatesFilter.allUpdatesFlow, triggersHolder = triggersHolder, subcontextInitialAction = subcontextInitialAction).run(block)
|
||||
): T {
|
||||
val data = BehaviourContextData()
|
||||
return DefaultBehaviourContext(
|
||||
bot = bot,
|
||||
scope = scope,
|
||||
upstreamUpdatesFlow = flowsUpdatesFilter.allUpdatesFlow,
|
||||
triggersHolder = triggersHolder,
|
||||
data = data,
|
||||
subcontextInitialAction = subcontextInitialAction.optionallyWithDefaultReceiver(useDefaultSubcontextInitialAction, data)
|
||||
).run(block)
|
||||
}
|
||||
|
||||
inline fun <T> BehaviourContext(
|
||||
bot: TelegramBot,
|
||||
scope: CoroutineScope,
|
||||
upstreamUpdatesFlow: Flow<Update>,
|
||||
triggersHolder: TriggersHolder = TriggersHolder(),
|
||||
noinline subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {},
|
||||
useDefaultSubcontextInitialAction: Boolean = true,
|
||||
crossinline block: BehaviourContext.() -> T
|
||||
): T {
|
||||
val data = BehaviourContextData()
|
||||
return DefaultBehaviourContext(
|
||||
bot = bot,
|
||||
scope = scope,
|
||||
upstreamUpdatesFlow = upstreamUpdatesFlow,
|
||||
triggersHolder = triggersHolder,
|
||||
data = data,
|
||||
subcontextInitialAction = subcontextInitialAction.optionallyWithDefaultReceiver(useDefaultSubcontextInitialAction, data)
|
||||
).run(block)
|
||||
}
|
||||
|
||||
fun BehaviourContext(
|
||||
bot: TelegramBot,
|
||||
scope: CoroutineScope,
|
||||
upstreamUpdatesFlow: Flow<Update>,
|
||||
subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update>,
|
||||
triggersHolder: TriggersHolder = TriggersHolder(),
|
||||
useDefaultSubcontextInitialAction: Boolean = true
|
||||
): DefaultBehaviourContext {
|
||||
val data = BehaviourContextData()
|
||||
return DefaultBehaviourContext(
|
||||
bot = bot,
|
||||
scope = scope,
|
||||
upstreamUpdatesFlow = upstreamUpdatesFlow,
|
||||
triggersHolder = triggersHolder,
|
||||
data = data,
|
||||
subcontextInitialAction = subcontextInitialAction.optionallyWithDefaultReceiver(useDefaultSubcontextInitialAction, data)
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new [BehaviourContext] using its [BehaviourContext.copy] method
|
||||
@@ -167,7 +229,7 @@ fun <BC : BehaviourContext> BC.createSubContext(
|
||||
) as BC
|
||||
|
||||
/**
|
||||
* Launch [behaviourContextReceiver] in context of [this] as [BehaviourContext] and as [kotlin.coroutines.CoroutineContext]
|
||||
* Launch [behaviourContextReceiver] in context of [this] as [BehaviourContext] and as [CoroutineContext]
|
||||
*
|
||||
* [this] [BehaviourContext] will **NOT** be closed automatically
|
||||
*/
|
||||
@@ -180,7 +242,7 @@ suspend fun <T, BC : BehaviourContext> BC.doInContext(
|
||||
}
|
||||
|
||||
/**
|
||||
* Launch [behaviourContextReceiver] in context of [this] as [BehaviourContext] and as [kotlin.coroutines.CoroutineContext]
|
||||
* Launch [behaviourContextReceiver] in context of [this] as [BehaviourContext] and as [CoroutineContext]
|
||||
*
|
||||
* [this] [BehaviourContext] will **NOT** be closed automatically
|
||||
*/
|
||||
@@ -202,7 +264,7 @@ suspend fun <T, BC : BehaviourContext> BC.doInNewSubContext(
|
||||
}
|
||||
|
||||
/**
|
||||
* Launch [behaviourContextReceiver] in context of [this] as [BehaviourContext] and as [kotlin.coroutines.CoroutineContext]
|
||||
* Launch [behaviourContextReceiver] in context of [this] as [BehaviourContext] and as [CoroutineContext]
|
||||
*
|
||||
* [this] [BehaviourContext] will **NOT** be closed automatically
|
||||
*/
|
||||
|
||||
@@ -39,6 +39,7 @@ suspend fun telegramBotWithBehaviour(
|
||||
testServer: Boolean = false,
|
||||
subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {},
|
||||
fileLinkUrlMapper: TelegramAPIUrlsKeeper.(String) -> String = { "${fileBaseUrl}/$it" },
|
||||
useDefaultSubcontextInitialAction: Boolean = true,
|
||||
block: BehaviourContextReceiver<Unit>
|
||||
): TelegramBot = telegramBot(
|
||||
token,
|
||||
@@ -52,6 +53,7 @@ suspend fun telegramBotWithBehaviour(
|
||||
scope = scope ?: CoroutineScope(coroutineContext),
|
||||
defaultExceptionsHandler = defaultExceptionsHandler,
|
||||
subcontextInitialAction = subcontextInitialAction,
|
||||
useDefaultSubcontextInitialAction = useDefaultSubcontextInitialAction,
|
||||
block = block
|
||||
)
|
||||
}
|
||||
@@ -86,6 +88,7 @@ suspend fun telegramBotWithBehaviourAndLongPolling(
|
||||
mediaGroupsDebounceTimeMillis: Long? = 1000L,
|
||||
subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {},
|
||||
fileLinkUrlMapper: TelegramAPIUrlsKeeper.(String) -> String = { "${fileBaseUrl}/$it" },
|
||||
useDefaultSubcontextInitialAction: Boolean = true,
|
||||
block: BehaviourContextReceiver<Unit>
|
||||
): Pair<TelegramBot, Job> {
|
||||
return telegramBot(
|
||||
@@ -103,6 +106,7 @@ suspend fun telegramBotWithBehaviourAndLongPolling(
|
||||
autoSkipTimeoutExceptions = autoSkipTimeoutExceptions,
|
||||
mediaGroupsDebounceTimeMillis = mediaGroupsDebounceTimeMillis,
|
||||
subcontextInitialAction = subcontextInitialAction,
|
||||
useDefaultSubcontextInitialAction = useDefaultSubcontextInitialAction,
|
||||
block = block
|
||||
)
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations
|
||||
|
||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
|
||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.containsCommand
|
||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.handlers_registrar.doWithRegistration
|
||||
import dev.inmo.tgbotapi.extensions.utils.*
|
||||
import dev.inmo.tgbotapi.extensions.utils.extensions.TelegramBotCommandsDefaults
|
||||
@@ -27,6 +28,7 @@ import kotlinx.coroutines.flow.*
|
||||
fun BehaviourContext.waitCommandMessage(
|
||||
commandRegex: Regex,
|
||||
initRequest: Request<*>? = null,
|
||||
excludeCommandsToOtherBots: Boolean = true,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = channelFlow {
|
||||
triggersHolder.handleableCommandsHolder.doWithRegistration(
|
||||
@@ -34,6 +36,16 @@ fun BehaviourContext.waitCommandMessage(
|
||||
) {
|
||||
waitTextMessage(initRequest, errorFactory).filter {
|
||||
it.content.textSources.any { it.botCommandTextSourceOrNull() ?.command ?.matches(commandRegex) == true }
|
||||
}.let {
|
||||
if (excludeCommandsToOtherBots) {
|
||||
it.filter {
|
||||
with(it.content.textSources) {
|
||||
containsCommand(commandRegex)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
it
|
||||
}
|
||||
}.collect {
|
||||
send(it)
|
||||
}
|
||||
@@ -43,14 +55,16 @@ fun BehaviourContext.waitCommandMessage(
|
||||
fun BehaviourContext.waitCommandMessage(
|
||||
command: String,
|
||||
initRequest: Request<*>? = null,
|
||||
excludeCommandsToOtherBots: Boolean = true,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitCommandMessage(Regex(command), initRequest, errorFactory)
|
||||
) = waitCommandMessage(Regex(command), initRequest, excludeCommandsToOtherBots, errorFactory)
|
||||
|
||||
fun BehaviourContext.waitCommandMessage(
|
||||
botCommand: BotCommand,
|
||||
initRequest: Request<*>? = null,
|
||||
excludeCommandsToOtherBots: Boolean = true,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitCommandMessage(botCommand.command, initRequest, errorFactory)
|
||||
) = waitCommandMessage(botCommand.command, initRequest, excludeCommandsToOtherBots, errorFactory)
|
||||
|
||||
fun Flow<CommonMessage<TextContent>>.requireCommandAtStart() = filter {
|
||||
it.content.textSources.firstOrNull() is BotCommandTextSource
|
||||
|
||||
@@ -10,11 +10,13 @@ import kotlinx.coroutines.flow.*
|
||||
|
||||
fun BehaviourContext.waitDeepLinks(
|
||||
initRequest: Request<*>? = null,
|
||||
excludeCommandsToOtherBots: Boolean = true,
|
||||
errorFactory: NullableRequestBuilder<*> = { null },
|
||||
): Flow<Pair<CommonMessage<TextContent>, String>> = waitCommandMessage(
|
||||
"start",
|
||||
initRequest,
|
||||
errorFactory
|
||||
command = "start",
|
||||
initRequest = initRequest,
|
||||
excludeCommandsToOtherBots = excludeCommandsToOtherBots,
|
||||
errorFactory = errorFactory
|
||||
)
|
||||
.requireSingleCommand()
|
||||
.requireCommandAtStart()
|
||||
@@ -25,13 +27,24 @@ fun BehaviourContext.waitDeepLinks(
|
||||
fun BehaviourContext.waitDeepLinks(
|
||||
regex: Regex,
|
||||
initRequest: Request<*>? = null,
|
||||
excludeCommandsToOtherBots: Boolean = true,
|
||||
errorFactory: NullableRequestBuilder<*> = { null },
|
||||
): Flow<Pair<CommonMessage<TextContent>, String>> = waitDeepLinks(initRequest, errorFactory).filter {
|
||||
): Flow<Pair<CommonMessage<TextContent>, String>> = waitDeepLinks(
|
||||
initRequest = initRequest,
|
||||
excludeCommandsToOtherBots = excludeCommandsToOtherBots,
|
||||
errorFactory = errorFactory
|
||||
).filter {
|
||||
regex.matches(it.second)
|
||||
}
|
||||
|
||||
fun BehaviourContext.waitDeepLinks(
|
||||
deepLink: String,
|
||||
initRequest: Request<*>? = null,
|
||||
excludeCommandsToOtherBots: Boolean = true,
|
||||
errorFactory: NullableRequestBuilder<*> = { null },
|
||||
): Flow<Pair<CommonMessage<TextContent>, String>> = waitDeepLinks(Regex("^$deepLink$"), initRequest, errorFactory)
|
||||
): Flow<Pair<CommonMessage<TextContent>, String>> = waitDeepLinks(
|
||||
regex = Regex(pattern = "^$deepLink$"),
|
||||
initRequest = initRequest,
|
||||
excludeCommandsToOtherBots = excludeCommandsToOtherBots,
|
||||
errorFactory = errorFactory
|
||||
)
|
||||
|
||||
@@ -5,7 +5,7 @@ package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations
|
||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
|
||||
import dev.inmo.tgbotapi.extensions.utils.*
|
||||
import dev.inmo.tgbotapi.requests.abstracts.Request
|
||||
import dev.inmo.tgbotapi.types.ChannelDirectMessagesConfigurationChanged
|
||||
import dev.inmo.tgbotapi.types.DirectMessagesConfigurationChanged
|
||||
import dev.inmo.tgbotapi.types.PaidMessagePriceChanged
|
||||
import dev.inmo.tgbotapi.types.chat.ChatBackground
|
||||
import dev.inmo.tgbotapi.types.checklists.ChecklistTasksAdded
|
||||
@@ -22,6 +22,12 @@ import dev.inmo.tgbotapi.types.message.ChatEvents.forum.ForumTopicReopened
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.forum.GeneralForumTopicHidden
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.forum.GeneralForumTopicUnhidden
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.forum.WriteAccessAllowed
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostApprovalFailed
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostApproved
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostDeclined
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostInfo
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostPaid
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostRefunded
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.voice.*
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.ChatEventMessage
|
||||
import dev.inmo.tgbotapi.types.message.payments.RefundedPaymentEvent
|
||||
@@ -281,4 +287,29 @@ fun BehaviourContext.waitChecklistTasksAdded(
|
||||
fun BehaviourContext.waitChannelDirectMessagesConfigurationChanged(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitEvents<ChannelDirectMessagesConfigurationChanged>(initRequest, errorFactory)
|
||||
) = waitEvents<DirectMessagesConfigurationChanged>(initRequest, errorFactory)
|
||||
|
||||
fun BehaviourContext.waitSuggestedPostApprovalFailed(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitEvents<SuggestedPostApprovalFailed>(initRequest, errorFactory)
|
||||
|
||||
fun BehaviourContext.waitSuggestedPostRefunded(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitEvents<SuggestedPostRefunded>(initRequest, errorFactory)
|
||||
|
||||
fun BehaviourContext.waitSuggestedPostDeclined(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitEvents<SuggestedPostDeclined>(initRequest, errorFactory)
|
||||
|
||||
fun BehaviourContext.waitSuggestedPostPaid(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitEvents<SuggestedPostPaid>(initRequest, errorFactory)
|
||||
|
||||
fun BehaviourContext.waitSuggestedPostApproved(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitEvents<SuggestedPostApproved>(initRequest, errorFactory)
|
||||
|
||||
@@ -5,6 +5,8 @@ package dev.inmo.tgbotapi.extensions.behaviour_builder.triggers_handling
|
||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.*
|
||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.filters.CommonMessageFilterExcludeMediaGroups
|
||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.filters.MessageFilterByChat
|
||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.botInfo
|
||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.containsCommand
|
||||
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.times
|
||||
@@ -15,6 +17,7 @@ import dev.inmo.tgbotapi.extensions.utils.extensions.parseCommandsWithNamedArgs
|
||||
import dev.inmo.tgbotapi.types.BotCommand
|
||||
import dev.inmo.tgbotapi.types.message.content.TextContent
|
||||
import dev.inmo.tgbotapi.types.message.content.TextMessage
|
||||
import dev.inmo.tgbotapi.types.message.textsources.BotCommandTextSource
|
||||
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
||||
import dev.inmo.tgbotapi.utils.launchWithBotLogger
|
||||
import kotlinx.coroutines.Job
|
||||
@@ -27,6 +30,7 @@ internal fun <BC : BehaviourContext> BC.commandUncounted(
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
|
||||
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
|
||||
excludeCommandsToOtherBots: Boolean = true,
|
||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage>
|
||||
): Job = onText(
|
||||
CommonMessageFilter<TextContent> { message ->
|
||||
@@ -40,6 +44,16 @@ internal fun <BC : BehaviourContext> BC.commandUncounted(
|
||||
sizeRequirement && textSources.any {
|
||||
commandRegex.matches(it.botCommandTextSourceOrNull() ?.command ?: return@any false)
|
||||
}
|
||||
}.let {
|
||||
if (excludeCommandsToOtherBots) {
|
||||
it * lambda@{
|
||||
with(it.content.textSources) {
|
||||
containsCommand(commandRegex)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
it
|
||||
}
|
||||
}.let {
|
||||
initialFilter ?.times(it) ?: it
|
||||
},
|
||||
@@ -56,17 +70,19 @@ fun <BC : BehaviourContext> BC.command(
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
|
||||
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
|
||||
excludeCommandsToOtherBots: Boolean = true,
|
||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage>
|
||||
): Job = launchInNewSubContext {
|
||||
runCatching {
|
||||
this@launchInNewSubContext.commandUncounted(
|
||||
commandRegex,
|
||||
requireOnlyCommandInMessage,
|
||||
initialFilter,
|
||||
subcontextUpdatesFilter,
|
||||
markerFactory,
|
||||
additionalSubcontextInitialAction,
|
||||
scenarioReceiver
|
||||
commandRegex = commandRegex,
|
||||
requireOnlyCommandInMessage = requireOnlyCommandInMessage,
|
||||
initialFilter = initialFilter,
|
||||
subcontextUpdatesFilter = subcontextUpdatesFilter,
|
||||
markerFactory = markerFactory,
|
||||
additionalSubcontextInitialAction = additionalSubcontextInitialAction,
|
||||
excludeCommandsToOtherBots = excludeCommandsToOtherBots,
|
||||
scenarioReceiver = scenarioReceiver
|
||||
)
|
||||
}.onFailure {
|
||||
triggersHolder.handleableCommandsHolder.unregisterHandleable(commandRegex)
|
||||
@@ -94,8 +110,18 @@ fun <BC : BehaviourContext> BC.command(
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
|
||||
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
|
||||
excludeCommandsToOtherBots: Boolean = true,
|
||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage>
|
||||
) = command(command.toRegex(), requireOnlyCommandInMessage, initialFilter, subcontextUpdatesFilter, markerFactory, additionalSubcontextInitialAction, scenarioReceiver)
|
||||
) = command(
|
||||
commandRegex = command.toRegex(),
|
||||
requireOnlyCommandInMessage = requireOnlyCommandInMessage,
|
||||
initialFilter = initialFilter,
|
||||
subcontextUpdatesFilter = subcontextUpdatesFilter,
|
||||
markerFactory = markerFactory,
|
||||
additionalSubcontextInitialAction = additionalSubcontextInitialAction,
|
||||
excludeCommandsToOtherBots = excludeCommandsToOtherBots,
|
||||
scenarioReceiver = scenarioReceiver
|
||||
)
|
||||
|
||||
/**
|
||||
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
|
||||
@@ -109,8 +135,18 @@ fun <BC : BehaviourContext> BC.command(
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
|
||||
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
|
||||
excludeCommandsToOtherBots: Boolean = true,
|
||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage>
|
||||
) = command(botCommand.command, requireOnlyCommandInMessage, initialFilter, subcontextUpdatesFilter, markerFactory, additionalSubcontextInitialAction, scenarioReceiver)
|
||||
) = command(
|
||||
command = botCommand.command,
|
||||
requireOnlyCommandInMessage = requireOnlyCommandInMessage,
|
||||
initialFilter = initialFilter,
|
||||
subcontextUpdatesFilter = subcontextUpdatesFilter,
|
||||
markerFactory = markerFactory,
|
||||
additionalSubcontextInitialAction = additionalSubcontextInitialAction,
|
||||
excludeCommandsToOtherBots = excludeCommandsToOtherBots,
|
||||
scenarioReceiver = scenarioReceiver
|
||||
)
|
||||
|
||||
/**
|
||||
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
|
||||
@@ -124,8 +160,18 @@ fun <BC : BehaviourContext> BC.onCommand(
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
|
||||
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
|
||||
excludeCommandsToOtherBots: Boolean = true,
|
||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage>
|
||||
): Job = command(commandRegex, requireOnlyCommandInMessage, initialFilter, subcontextUpdatesFilter, markerFactory, additionalSubcontextInitialAction, scenarioReceiver)
|
||||
): Job = command(
|
||||
commandRegex = commandRegex,
|
||||
requireOnlyCommandInMessage = requireOnlyCommandInMessage,
|
||||
initialFilter = initialFilter,
|
||||
subcontextUpdatesFilter = subcontextUpdatesFilter,
|
||||
markerFactory = markerFactory,
|
||||
additionalSubcontextInitialAction = additionalSubcontextInitialAction,
|
||||
excludeCommandsToOtherBots = excludeCommandsToOtherBots,
|
||||
scenarioReceiver = scenarioReceiver
|
||||
)
|
||||
|
||||
/**
|
||||
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
|
||||
@@ -139,8 +185,18 @@ fun <BC : BehaviourContext> BC.onCommand(
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
|
||||
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
|
||||
excludeCommandsToOtherBots: Boolean = true,
|
||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage>
|
||||
): Job = onCommand(command.toRegex(), requireOnlyCommandInMessage, initialFilter, subcontextUpdatesFilter, markerFactory, additionalSubcontextInitialAction, scenarioReceiver)
|
||||
): Job = onCommand(
|
||||
commandRegex = command.toRegex(),
|
||||
requireOnlyCommandInMessage = requireOnlyCommandInMessage,
|
||||
initialFilter = initialFilter,
|
||||
subcontextUpdatesFilter = subcontextUpdatesFilter,
|
||||
markerFactory = markerFactory,
|
||||
additionalSubcontextInitialAction = additionalSubcontextInitialAction,
|
||||
excludeCommandsToOtherBots = excludeCommandsToOtherBots,
|
||||
scenarioReceiver = scenarioReceiver
|
||||
)
|
||||
|
||||
/**
|
||||
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
|
||||
@@ -154,8 +210,18 @@ fun <BC : BehaviourContext> BC.onCommand(
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
|
||||
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
|
||||
excludeCommandsToOtherBots: Boolean = true,
|
||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage>
|
||||
): Job = onCommand(botCommand.command, requireOnlyCommandInMessage, initialFilter, subcontextUpdatesFilter, markerFactory, additionalSubcontextInitialAction, scenarioReceiver)
|
||||
): Job = onCommand(
|
||||
command = botCommand.command,
|
||||
requireOnlyCommandInMessage = requireOnlyCommandInMessage,
|
||||
initialFilter = initialFilter,
|
||||
subcontextUpdatesFilter = subcontextUpdatesFilter,
|
||||
markerFactory = markerFactory,
|
||||
additionalSubcontextInitialAction = additionalSubcontextInitialAction,
|
||||
excludeCommandsToOtherBots = excludeCommandsToOtherBots,
|
||||
scenarioReceiver = scenarioReceiver
|
||||
)
|
||||
|
||||
/**
|
||||
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
|
||||
@@ -169,13 +235,15 @@ fun <BC : BehaviourContext> BC.commandWithArgs(
|
||||
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
|
||||
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
|
||||
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
|
||||
excludeCommandsToOtherBots: Boolean = true,
|
||||
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>>
|
||||
) = command(
|
||||
commandRegex,
|
||||
requireOnlyCommandInMessage = false,
|
||||
initialFilter = initialFilter,
|
||||
subcontextUpdatesFilter = subcontextUpdatesFilter,
|
||||
markerFactory = markerFactory
|
||||
markerFactory = markerFactory,
|
||||
excludeCommandsToOtherBots = excludeCommandsToOtherBots,
|
||||
) {
|
||||
val args = it.parseCommandsWithArgs(argsSeparator = argsSeparator).let { commandsWithArgs ->
|
||||
val key = commandsWithArgs.keys.firstOrNull { it.matches(commandRegex) } ?: return@let null
|
||||
@@ -196,6 +264,7 @@ fun <BC : BehaviourContext> BC.commandWithArgs(
|
||||
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
|
||||
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
|
||||
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
|
||||
excludeCommandsToOtherBots: Boolean = true,
|
||||
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>>
|
||||
) = commandWithArgs(
|
||||
command.toRegex(),
|
||||
@@ -203,6 +272,7 @@ fun <BC : BehaviourContext> BC.commandWithArgs(
|
||||
subcontextUpdatesFilter = subcontextUpdatesFilter,
|
||||
markerFactory = markerFactory,
|
||||
argsSeparator = argsSeparator,
|
||||
excludeCommandsToOtherBots = excludeCommandsToOtherBots,
|
||||
scenarioReceiver = scenarioReceiver
|
||||
)
|
||||
|
||||
@@ -218,6 +288,7 @@ fun <BC : BehaviourContext> BC.commandWithArgs(
|
||||
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
|
||||
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
|
||||
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
|
||||
excludeCommandsToOtherBots: Boolean = true,
|
||||
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>>
|
||||
) = commandWithArgs(
|
||||
botCommand.command,
|
||||
@@ -225,6 +296,7 @@ fun <BC : BehaviourContext> BC.commandWithArgs(
|
||||
subcontextUpdatesFilter = subcontextUpdatesFilter,
|
||||
markerFactory = markerFactory,
|
||||
argsSeparator = argsSeparator,
|
||||
excludeCommandsToOtherBots = excludeCommandsToOtherBots,
|
||||
scenarioReceiver = scenarioReceiver
|
||||
)
|
||||
|
||||
@@ -241,12 +313,14 @@ fun <BC : BehaviourContext> BC.commandWithNamedArgs(
|
||||
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
|
||||
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
|
||||
nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex,
|
||||
excludeCommandsToOtherBots: Boolean = true,
|
||||
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, List<Pair<String, String>>>
|
||||
) = command(
|
||||
commandRegex,
|
||||
requireOnlyCommandInMessage = false,
|
||||
initialFilter = initialFilter,
|
||||
subcontextUpdatesFilter = subcontextUpdatesFilter,
|
||||
excludeCommandsToOtherBots = excludeCommandsToOtherBots,
|
||||
markerFactory = markerFactory
|
||||
) {
|
||||
val args = it.parseCommandsWithNamedArgs(argsSeparator = argsSeparator, nameArgSeparator = nameArgSeparator).let { commandsWithArgs ->
|
||||
@@ -269,6 +343,7 @@ fun <BC : BehaviourContext> BC.commandWithNamedArgs(
|
||||
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
|
||||
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
|
||||
nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex,
|
||||
excludeCommandsToOtherBots: Boolean = true,
|
||||
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, List<Pair<String, String>>>
|
||||
) = commandWithNamedArgs(
|
||||
command.toRegex(),
|
||||
@@ -277,6 +352,7 @@ fun <BC : BehaviourContext> BC.commandWithNamedArgs(
|
||||
markerFactory = markerFactory,
|
||||
argsSeparator = argsSeparator,
|
||||
nameArgSeparator = nameArgSeparator,
|
||||
excludeCommandsToOtherBots = excludeCommandsToOtherBots,
|
||||
scenarioReceiver = scenarioReceiver
|
||||
)
|
||||
|
||||
@@ -293,6 +369,7 @@ fun <BC : BehaviourContext> BC.commandWithNamedArgs(
|
||||
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
|
||||
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
|
||||
nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex,
|
||||
excludeCommandsToOtherBots: Boolean = true,
|
||||
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, List<Pair<String, String>>>
|
||||
) = commandWithNamedArgs(
|
||||
botCommand.command,
|
||||
@@ -301,6 +378,7 @@ fun <BC : BehaviourContext> BC.commandWithNamedArgs(
|
||||
markerFactory = markerFactory,
|
||||
argsSeparator = argsSeparator,
|
||||
nameArgSeparator = nameArgSeparator,
|
||||
excludeCommandsToOtherBots = excludeCommandsToOtherBots,
|
||||
scenarioReceiver = scenarioReceiver
|
||||
)
|
||||
|
||||
@@ -316,6 +394,7 @@ fun <BC : BehaviourContext> BC.onCommandWithArgs(
|
||||
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
|
||||
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
|
||||
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
|
||||
excludeCommandsToOtherBots: Boolean = true,
|
||||
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>>
|
||||
): Job = commandWithArgs(
|
||||
commandRegex = commandRegex,
|
||||
@@ -323,6 +402,7 @@ fun <BC : BehaviourContext> BC.onCommandWithArgs(
|
||||
subcontextUpdatesFilter = subcontextUpdatesFilter,
|
||||
markerFactory = markerFactory,
|
||||
argsSeparator = argsSeparator,
|
||||
excludeCommandsToOtherBots = excludeCommandsToOtherBots,
|
||||
scenarioReceiver = scenarioReceiver
|
||||
)
|
||||
|
||||
@@ -338,6 +418,7 @@ fun <BC : BehaviourContext> BC.onCommandWithArgs(
|
||||
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
|
||||
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
|
||||
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
|
||||
excludeCommandsToOtherBots: Boolean = true,
|
||||
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>>
|
||||
): Job = onCommandWithArgs(
|
||||
commandRegex = command.toRegex(),
|
||||
@@ -345,6 +426,7 @@ fun <BC : BehaviourContext> BC.onCommandWithArgs(
|
||||
subcontextUpdatesFilter = subcontextUpdatesFilter,
|
||||
markerFactory = markerFactory,
|
||||
argsSeparator = argsSeparator,
|
||||
excludeCommandsToOtherBots = excludeCommandsToOtherBots,
|
||||
scenarioReceiver = scenarioReceiver
|
||||
)
|
||||
|
||||
@@ -360,6 +442,7 @@ fun <BC : BehaviourContext> BC.onCommandWithArgs(
|
||||
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
|
||||
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
|
||||
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
|
||||
excludeCommandsToOtherBots: Boolean = true,
|
||||
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>>
|
||||
): Job = onCommandWithArgs(
|
||||
command = botCommand.command,
|
||||
@@ -367,6 +450,7 @@ fun <BC : BehaviourContext> BC.onCommandWithArgs(
|
||||
subcontextUpdatesFilter = subcontextUpdatesFilter,
|
||||
markerFactory = markerFactory,
|
||||
argsSeparator = argsSeparator,
|
||||
excludeCommandsToOtherBots = excludeCommandsToOtherBots,
|
||||
scenarioReceiver = scenarioReceiver
|
||||
)
|
||||
|
||||
@@ -383,6 +467,7 @@ fun <BC : BehaviourContext> BC.onCommandWithNamedArgs(
|
||||
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
|
||||
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
|
||||
nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex,
|
||||
excludeCommandsToOtherBots: Boolean = true,
|
||||
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, List<Pair<String, String>>>
|
||||
) = commandWithNamedArgs(
|
||||
commandRegex,
|
||||
@@ -391,6 +476,7 @@ fun <BC : BehaviourContext> BC.onCommandWithNamedArgs(
|
||||
markerFactory = markerFactory,
|
||||
argsSeparator = argsSeparator,
|
||||
nameArgSeparator = nameArgSeparator,
|
||||
excludeCommandsToOtherBots = excludeCommandsToOtherBots,
|
||||
scenarioReceiver = scenarioReceiver,
|
||||
)
|
||||
|
||||
@@ -407,6 +493,7 @@ fun <BC : BehaviourContext> BC.onCommandWithNamedArgs(
|
||||
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
|
||||
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
|
||||
nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex,
|
||||
excludeCommandsToOtherBots: Boolean = true,
|
||||
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, List<Pair<String, String>>>
|
||||
) = onCommandWithNamedArgs(
|
||||
command.toRegex(),
|
||||
@@ -415,6 +502,7 @@ fun <BC : BehaviourContext> BC.onCommandWithNamedArgs(
|
||||
markerFactory = markerFactory,
|
||||
argsSeparator = argsSeparator,
|
||||
nameArgSeparator = nameArgSeparator,
|
||||
excludeCommandsToOtherBots = excludeCommandsToOtherBots,
|
||||
scenarioReceiver = scenarioReceiver
|
||||
)
|
||||
|
||||
@@ -431,6 +519,7 @@ fun <BC : BehaviourContext> BC.onCommandWithNamedArgs(
|
||||
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
|
||||
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
|
||||
nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex,
|
||||
excludeCommandsToOtherBots: Boolean = true,
|
||||
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, List<Pair<String, String>>>
|
||||
) = onCommandWithNamedArgs(
|
||||
botCommand.command,
|
||||
@@ -439,5 +528,6 @@ fun <BC : BehaviourContext> BC.onCommandWithNamedArgs(
|
||||
markerFactory = markerFactory,
|
||||
argsSeparator = argsSeparator,
|
||||
nameArgSeparator = nameArgSeparator,
|
||||
excludeCommandsToOtherBots = excludeCommandsToOtherBots,
|
||||
scenarioReceiver = scenarioReceiver
|
||||
)
|
||||
|
||||
@@ -10,7 +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.utils.baseSentMessageUpdateOrNull
|
||||
import dev.inmo.tgbotapi.extensions.utils.chatEventMessageOrNull
|
||||
import dev.inmo.tgbotapi.types.ChannelDirectMessagesConfigurationChanged
|
||||
import dev.inmo.tgbotapi.types.DirectMessagesConfigurationChanged
|
||||
import dev.inmo.tgbotapi.types.PaidMessagePriceChanged
|
||||
import dev.inmo.tgbotapi.types.chat.ChatBackground
|
||||
import dev.inmo.tgbotapi.types.checklists.ChecklistTasksAdded
|
||||
@@ -28,8 +28,15 @@ import dev.inmo.tgbotapi.types.message.ChatEvents.forum.ForumTopicReopened
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.forum.GeneralForumTopicHidden
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.forum.GeneralForumTopicUnhidden
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.forum.WriteAccessAllowed
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostApprovalFailed
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostApproved
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostDeclined
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostInfo
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostPaid
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostRefunded
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.voice.*
|
||||
import dev.inmo.tgbotapi.types.message.PrivateEventMessage
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.ChannelDirectMessagesEventMessage
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.ChatEventMessage
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.SupergroupEventMessage
|
||||
import dev.inmo.tgbotapi.types.message.payments.RefundedPaymentEvent
|
||||
@@ -1176,9 +1183,119 @@ fun <BC : BehaviourContext> BC.onChecklistTasksAdded(
|
||||
* data
|
||||
*/
|
||||
fun <BC : BehaviourContext> BC.onChannelDirectMessagesConfigurationChanged(
|
||||
initialFilter: SimpleFilter<ChannelEventMessage<ChannelDirectMessagesConfigurationChanged>>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChannelEventMessage<ChannelDirectMessagesConfigurationChanged>, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in ChannelEventMessage<ChannelDirectMessagesConfigurationChanged>, Any>? = ByChatMessageMarkerFactory,
|
||||
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, ChannelEventMessage<ChannelDirectMessagesConfigurationChanged>>? = null,
|
||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChannelEventMessage<ChannelDirectMessagesConfigurationChanged>>
|
||||
initialFilter: SimpleFilter<ChannelEventMessage<DirectMessagesConfigurationChanged>>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChannelEventMessage<DirectMessagesConfigurationChanged>, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in ChannelEventMessage<DirectMessagesConfigurationChanged>, Any>? = ByChatMessageMarkerFactory,
|
||||
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, ChannelEventMessage<DirectMessagesConfigurationChanged>>? = null,
|
||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChannelEventMessage<DirectMessagesConfigurationChanged>>
|
||||
) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, additionalSubcontextInitialAction, 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
|
||||
*/
|
||||
fun <BC : BehaviourContext> BC.onSuggestedPostApproved(
|
||||
initialFilter: SimpleFilter<ChannelDirectMessagesEventMessage<SuggestedPostApproved>>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChannelDirectMessagesEventMessage<SuggestedPostApproved>, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in ChannelDirectMessagesEventMessage<SuggestedPostApproved>, Any>? = ByChatMessageMarkerFactory,
|
||||
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, ChannelDirectMessagesEventMessage<SuggestedPostApproved>>? = null,
|
||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChannelDirectMessagesEventMessage<SuggestedPostApproved>>
|
||||
) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, additionalSubcontextInitialAction, 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
|
||||
*/
|
||||
fun <BC : BehaviourContext> BC.onSuggestedPostApprovalFailed(
|
||||
initialFilter: SimpleFilter<ChannelDirectMessagesEventMessage<SuggestedPostApprovalFailed>>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChannelDirectMessagesEventMessage<SuggestedPostApprovalFailed>, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in ChannelDirectMessagesEventMessage<SuggestedPostApprovalFailed>, Any>? = ByChatMessageMarkerFactory,
|
||||
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, ChannelDirectMessagesEventMessage<SuggestedPostApprovalFailed>>? = null,
|
||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChannelDirectMessagesEventMessage<SuggestedPostApprovalFailed>>
|
||||
) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, additionalSubcontextInitialAction, 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
|
||||
*/
|
||||
fun <BC : BehaviourContext> BC.onSuggestedPostDeclined(
|
||||
initialFilter: SimpleFilter<ChannelDirectMessagesEventMessage<SuggestedPostDeclined>>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChannelDirectMessagesEventMessage<SuggestedPostDeclined>, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in ChannelDirectMessagesEventMessage<SuggestedPostDeclined>, Any>? = ByChatMessageMarkerFactory,
|
||||
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, ChannelDirectMessagesEventMessage<SuggestedPostDeclined>>? = null,
|
||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChannelDirectMessagesEventMessage<SuggestedPostDeclined>>
|
||||
) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, additionalSubcontextInitialAction, 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
|
||||
*/
|
||||
fun <BC : BehaviourContext> BC.onSuggestedPostPaid(
|
||||
initialFilter: SimpleFilter<ChannelDirectMessagesEventMessage<SuggestedPostPaid>>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChannelDirectMessagesEventMessage<SuggestedPostPaid>, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in ChannelDirectMessagesEventMessage<SuggestedPostPaid>, Any>? = ByChatMessageMarkerFactory,
|
||||
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, ChannelDirectMessagesEventMessage<SuggestedPostPaid>>? = null,
|
||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChannelDirectMessagesEventMessage<SuggestedPostPaid>>
|
||||
) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, additionalSubcontextInitialAction, 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
|
||||
*/
|
||||
fun <BC : BehaviourContext> BC.onSuggestedPostRefunded(
|
||||
initialFilter: SimpleFilter<ChannelDirectMessagesEventMessage<SuggestedPostRefunded>>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChannelDirectMessagesEventMessage<SuggestedPostRefunded>, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in ChannelDirectMessagesEventMessage<SuggestedPostRefunded>, Any>? = ByChatMessageMarkerFactory,
|
||||
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, ChannelDirectMessagesEventMessage<SuggestedPostRefunded>>? = null,
|
||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChannelDirectMessagesEventMessage<SuggestedPostRefunded>>
|
||||
) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, additionalSubcontextInitialAction, scenarioReceiver)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
package dev.inmo.tgbotapi.extensions.behaviour_builder.triggers_handling
|
||||
|
||||
import dev.inmo.micro_utils.coroutines.SpecialMutableStateFlow
|
||||
import dev.inmo.micro_utils.coroutines.MutableRedeliverStateFlow
|
||||
import dev.inmo.micro_utils.coroutines.runCatchingLogging
|
||||
import dev.inmo.micro_utils.coroutines.subscribeAsync
|
||||
import dev.inmo.micro_utils.coroutines.subscribeLoggingDropExceptions
|
||||
@@ -49,7 +49,7 @@ internal fun <BC : BehaviourContext, T> BC.on(
|
||||
}
|
||||
val handler: suspend (Pair<Update, T>) -> Unit = subcontextUpdatesFilter ?.let {
|
||||
{ (update, triggerData) ->
|
||||
val contextStateFlow = SpecialMutableStateFlow<BC?>(null)
|
||||
val contextStateFlow = MutableRedeliverStateFlow<BC?>(null)
|
||||
createSubContextAndDoSynchronouslyWithUpdatesFilter(
|
||||
updatesUpstreamFlow = contextStateFlow.flatMapLatest { context ->
|
||||
if (context == null) {
|
||||
|
||||
@@ -0,0 +1,137 @@
|
||||
package dev.inmo.tgbotapi.extensions.behaviour_builder.utils
|
||||
|
||||
import dev.inmo.micro_utils.common.Warning
|
||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
|
||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextData
|
||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.CustomBehaviourContextAndTypeReceiver
|
||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.DefaultCustomBehaviourContextAndTypeReceiver.Companion.BOT_INFO_RECEIVER
|
||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.botInfo
|
||||
import dev.inmo.tgbotapi.extensions.utils.botCommandTextSourceOrNull
|
||||
import dev.inmo.tgbotapi.requests.bot.GetMe
|
||||
import dev.inmo.tgbotapi.types.chat.ExtendedBot
|
||||
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
||||
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
||||
import kotlinx.coroutines.sync.Mutex
|
||||
import kotlinx.coroutines.sync.withLock
|
||||
|
||||
/**
|
||||
* Returns bot information (result of [GetMe]) associated with this [BehaviourContext], if available.
|
||||
*
|
||||
* The value is lazily computed and cached by [DefaultCustomBehaviourContextAndTypeReceiver] when it is used
|
||||
* to wrap behaviour handlers. If this context was not prepared by that wrapper, the function returns null.
|
||||
*
|
||||
* Thread-safety:
|
||||
* - The underlying retrieval is protected by a mutex to ensure the info is fetched at most once per context.
|
||||
*
|
||||
* @return [ExtendedBot] with bot details, or null if no bot info provider is registered in this context.
|
||||
*/
|
||||
suspend fun BehaviourContext.botInfo(): ExtendedBot? {
|
||||
return (data[BOT_INFO_RECEIVER] as? DefaultCustomBehaviourContextAndTypeReceiver.IReceiver) ?.run {
|
||||
invoke()
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun BehaviourContext.containsCommand(commandRegex: Regex, textSources: TextSourcesList) = textSources.any {
|
||||
val command = it.botCommandTextSourceOrNull() ?.takeIf {
|
||||
commandRegex.matches(it.command)
|
||||
} ?: return@any false
|
||||
if (command.username == null) {
|
||||
return@any true
|
||||
}
|
||||
val botInfo = botInfo()
|
||||
if (botInfo == null || command.username == botInfo.username) {
|
||||
return@any true
|
||||
}
|
||||
false
|
||||
}
|
||||
|
||||
context(textSources: TextSourcesList, bc: BehaviourContext)
|
||||
suspend fun containsCommand(commandRegex: Regex) = bc.containsCommand(commandRegex, textSources)
|
||||
|
||||
context(textSources: TextSourcesList, bc: BehaviourContext)
|
||||
suspend fun containsCommand(command: String) = containsCommand(Regex(command))
|
||||
|
||||
suspend fun BehaviourContext.containsCommand(command: String, textSources: TextSourcesList) = containsCommand(Regex(command), textSources)
|
||||
|
||||
@Warning("It is internal API and can be changed without notes")
|
||||
fun <BC : BehaviourContext, R, U : Update> CustomBehaviourContextAndTypeReceiver<BC, R, U>.withDefaultReceiver(
|
||||
data: BehaviourContextData
|
||||
) = DefaultCustomBehaviourContextAndTypeReceiver(this).also {
|
||||
it(data)
|
||||
}
|
||||
@Warning("It is internal API and can be changed without notes")
|
||||
fun <BC : BehaviourContext, R, U : Update> CustomBehaviourContextAndTypeReceiver<BC, R, U>.optionallyWithDefaultReceiver(
|
||||
include: Boolean,
|
||||
data: BehaviourContextData
|
||||
) = if (include) {
|
||||
withDefaultReceiver(data)
|
||||
} else {
|
||||
this
|
||||
}
|
||||
|
||||
/**
|
||||
* Behaviour wrapper that injects a lazily-evaluated, cached provider of bot information into the [BehaviourContext].
|
||||
*
|
||||
* When this wrapper is used, any code executed inside it may call [BehaviourContext.botInfo] to obtain
|
||||
* the current bot's [ExtendedBot] information. The info is fetched via [GetMe] only once and then cached
|
||||
* for subsequent calls, with concurrent access synchronized by a mutex.
|
||||
*
|
||||
* @param BC Type of [BehaviourContext] used in the wrapped logic.
|
||||
* @param R Result type produced by the wrapped receiver.
|
||||
* @param U Type of [Update] handled by the wrapped receiver.
|
||||
* @param wrapperReceiver The original receiver to be invoked after the bot info provider is registered in the context.
|
||||
*/
|
||||
class DefaultCustomBehaviourContextAndTypeReceiver<BC : BehaviourContext, R, U : Update>(
|
||||
private val wrapperReceiver: CustomBehaviourContextAndTypeReceiver<BC, R, U>
|
||||
) : CustomBehaviourContextAndTypeReceiver<BC, R, U> {
|
||||
private var botInfo: ExtendedBot? = null
|
||||
private val mutex = Mutex()
|
||||
|
||||
/**
|
||||
* Lightweight provider of bot information bound to a [BehaviourContext].
|
||||
*
|
||||
* Implementations must return the current [ExtendedBot] instance, computing it if necessary.
|
||||
*/
|
||||
fun interface IReceiver {
|
||||
/**
|
||||
* Get or compute the bot information for the current [BehaviourContext].
|
||||
*
|
||||
* Implementations may cache the value and are free to apply synchronization as needed.
|
||||
*/
|
||||
suspend fun BehaviourContext.invoke(): ExtendedBot
|
||||
}
|
||||
|
||||
/**
|
||||
* Internal provider that performs a single, thread-safe retrieval of bot info via [GetMe] and caches it.
|
||||
*/
|
||||
private val internalReceiver: IReceiver = IReceiver {
|
||||
botInfo ?: mutex.withLock {
|
||||
botInfo ?: execute(GetMe).also {
|
||||
botInfo = it
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
operator fun invoke(data: BehaviourContextData) {
|
||||
data[BOT_INFO_RECEIVER] = internalReceiver
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers the internal bot info provider in [BehaviourContext.data] and then delegates to [wrapperReceiver].
|
||||
*
|
||||
* The provider is stored under [BOT_INFO_RECEIVER] key, enabling calls to [BehaviourContext.botInfo] within
|
||||
* the wrapped behaviour.
|
||||
*/
|
||||
override suspend fun invoke(p1: BC, p2: U): R {
|
||||
invoke(p1.data)
|
||||
|
||||
return wrapperReceiver(p1, p2)
|
||||
}
|
||||
|
||||
companion object {
|
||||
/**
|
||||
* Key used to store the bot info provider inside [BehaviourContext.data].
|
||||
*/
|
||||
const val BOT_INFO_RECEIVER = "ktgbotapi_bot_info_receiver"
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -47,12 +47,19 @@ kotlin {
|
||||
api libs.ktor.server.host.common
|
||||
|
||||
api libs.ktor.client.cio
|
||||
api libs.ktor.client.java
|
||||
|
||||
api libs.javax.activation
|
||||
}
|
||||
}
|
||||
|
||||
linuxX64Main {
|
||||
jsMain {
|
||||
dependencies {
|
||||
api libs.ktor.client.js
|
||||
}
|
||||
}
|
||||
|
||||
linuxMain {
|
||||
dependencies {
|
||||
api libs.ktor.client.curl
|
||||
}
|
||||
@@ -64,7 +71,7 @@ kotlin {
|
||||
}
|
||||
}
|
||||
|
||||
mingwX64Main {
|
||||
mingwMain {
|
||||
dependencies {
|
||||
api libs.ktor.client.winhttp
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
package dev.inmo.tgbotapi.abstracts.types
|
||||
|
||||
import dev.inmo.tgbotapi.types.message.SuggestedPostParameters
|
||||
|
||||
interface OptionallyPaidPost {
|
||||
val suggestedPostParameters: SuggestedPostParameters?
|
||||
}
|
||||
@@ -8,6 +8,7 @@ import dev.inmo.tgbotapi.bot.settings.limiters.RequestLimiter
|
||||
import dev.inmo.tgbotapi.requests.abstracts.Request
|
||||
import dev.inmo.tgbotapi.utils.DefaultKTgBotAPIKSLog
|
||||
import dev.inmo.tgbotapi.utils.TelegramAPIUrlsKeeper
|
||||
import dev.inmo.tgbotapi.utils.defaultKtorEngine
|
||||
import dev.inmo.tgbotapi.utils.nonstrictJsonFormat
|
||||
import io.ktor.client.*
|
||||
import kotlinx.serialization.json.Json
|
||||
@@ -37,7 +38,7 @@ expect class KtorRequestsExecutor internal constructor(
|
||||
|
||||
fun KtorRequestsExecutor(
|
||||
telegramAPIUrlsKeeper: TelegramAPIUrlsKeeper,
|
||||
client: HttpClient = HttpClient(),
|
||||
client: HttpClient = HttpClient(defaultKtorEngine),
|
||||
callsFactories: List<KtorCallFactory> = emptyList(),
|
||||
excludeDefaultFactories: Boolean = false,
|
||||
requestsLimiter: RequestLimiter = ExceptionsOnlyLimiter,
|
||||
|
||||
@@ -21,7 +21,7 @@ fun createTelegramBotDefaultKtorCallRequestsFactories(logger: KSLog? = null) = l
|
||||
class KtorRequestsExecutorBuilder(
|
||||
var telegramAPIUrlsKeeper: TelegramAPIUrlsKeeper
|
||||
) {
|
||||
var client: HttpClient = HttpClient()
|
||||
var client: HttpClient = HttpClient(defaultKtorEngine)
|
||||
var callsFactories: List<KtorCallFactory> = emptyList()
|
||||
var excludeDefaultFactories: Boolean = false
|
||||
var requestsLimiter: RequestLimiter = ExceptionsOnlyLimiter
|
||||
|
||||
@@ -84,7 +84,7 @@ class DefaultKtorRequestsExecutor internal constructor(
|
||||
|
||||
when (e) {
|
||||
is ClientRequestException -> {
|
||||
val exceptionResult = runCatching {
|
||||
val exceptionResult = runCatchingLogging(logger = Log) {
|
||||
val content = e.response.bodyAsText()
|
||||
val responseObject = jsonFormatter.decodeFromString(Response.serializer(), content)
|
||||
newRequestException(
|
||||
|
||||
@@ -21,6 +21,7 @@ object DownloadFileRequestCallFactory : KtorCallFactory {
|
||||
jsonFormatter: Json,
|
||||
): T? = (request as? DownloadFile)?.let {
|
||||
resolveFile(it.filePath) ?.let {
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
return@makeCall it.bytes() as T // Always ByteArray
|
||||
}
|
||||
|
||||
|
||||
@@ -4,8 +4,11 @@ import dev.inmo.tgbotapi.abstracts.WithCustomStartMediaData
|
||||
import dev.inmo.tgbotapi.abstracts.types.MessageAction
|
||||
import dev.inmo.tgbotapi.abstracts.types.ProtectContent
|
||||
import dev.inmo.tgbotapi.requests.abstracts.SimpleRequest
|
||||
import dev.inmo.tgbotapi.requests.send.abstracts.OptionallyDirectMessageThreadRequest
|
||||
import dev.inmo.tgbotapi.requests.send.abstracts.OptionallyMessageThreadRequest
|
||||
import dev.inmo.tgbotapi.requests.send.abstracts.OptionallySuggestedPostRequest
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.message.SuggestedPostParameters
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.PossiblyForwardedMessage
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass
|
||||
import kotlinx.serialization.*
|
||||
@@ -20,15 +23,29 @@ data class ForwardMessage(
|
||||
val toChatId: ChatIdentifier,
|
||||
@SerialName(messageIdField)
|
||||
override val messageId: MessageId,
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
@SerialName(messageThreadIdField)
|
||||
@EncodeDefault
|
||||
override val threadId: MessageThreadId? = toChatId.threadId,
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
@EncodeDefault
|
||||
@SerialName(directMessagesTopicIdField)
|
||||
override val directMessageThreadId: DirectMessageThreadId? = toChatId.directMessageThreadId,
|
||||
@SerialName(videoStartTimestampField)
|
||||
override val startTimestamp: Seconds? = null,
|
||||
@SerialName(disableNotificationField)
|
||||
val disableNotification: Boolean = false,
|
||||
@SerialName(protectContentField)
|
||||
override val protectContent: Boolean = false
|
||||
): SimpleRequest<PossiblyForwardedMessage>, MessageAction, ProtectContent, OptionallyMessageThreadRequest, WithCustomStartMediaData {
|
||||
override val protectContent: Boolean = false,
|
||||
@SerialName(suggestedPostParametersField)
|
||||
override val suggestedPostParameters: SuggestedPostParameters? = null
|
||||
): SimpleRequest<PossiblyForwardedMessage>,
|
||||
MessageAction,
|
||||
ProtectContent,
|
||||
OptionallyMessageThreadRequest,
|
||||
OptionallyDirectMessageThreadRequest,
|
||||
OptionallySuggestedPostRequest,
|
||||
WithCustomStartMediaData {
|
||||
override val chatId: ChatIdentifier
|
||||
get() = fromChatId
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import dev.inmo.tgbotapi.abstracts.types.DisableNotification
|
||||
import dev.inmo.tgbotapi.abstracts.types.MessagesAction
|
||||
import dev.inmo.tgbotapi.abstracts.types.ProtectContent
|
||||
import dev.inmo.tgbotapi.requests.abstracts.SimpleRequest
|
||||
import dev.inmo.tgbotapi.requests.send.abstracts.OptionallyDirectMessageThreadRequest
|
||||
import dev.inmo.tgbotapi.requests.send.abstracts.OptionallyMessageThreadRequest
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import kotlinx.serialization.*
|
||||
@@ -14,6 +15,7 @@ fun ForwardMessages(
|
||||
fromChatId: ChatIdentifier,
|
||||
messageIds: Array<MessageId>,
|
||||
threadId: MessageThreadId? = toChatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = toChatId.directMessageThreadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
removeCaption: Boolean = false
|
||||
@@ -22,6 +24,7 @@ fun ForwardMessages(
|
||||
fromChatId = fromChatId,
|
||||
messageIds = messageIds.toList(),
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
removeCaption = removeCaption
|
||||
@@ -35,8 +38,14 @@ data class ForwardMessages (
|
||||
val fromChatId: ChatIdentifier,
|
||||
@SerialName(messageIdsField)
|
||||
override val messageIds: List<MessageId>,
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
@SerialName(messageThreadIdField)
|
||||
@EncodeDefault
|
||||
override val threadId: MessageThreadId? = toChatId.threadId,
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
@EncodeDefault
|
||||
@SerialName(directMessagesTopicIdField)
|
||||
override val directMessageThreadId: DirectMessageThreadId? = toChatId.directMessageThreadId,
|
||||
@SerialName(disableNotificationField)
|
||||
override val disableNotification: Boolean = false,
|
||||
@SerialName(protectContentField)
|
||||
@@ -47,6 +56,7 @@ data class ForwardMessages (
|
||||
MessagesAction,
|
||||
ProtectContent,
|
||||
OptionallyMessageThreadRequest,
|
||||
OptionallyDirectMessageThreadRequest,
|
||||
DisableNotification {
|
||||
override val chatId: ChatIdentifier
|
||||
get() = fromChatId
|
||||
|
||||
@@ -46,7 +46,9 @@ data class PromoteChatMember(
|
||||
@SerialName(canEditStoriesField)
|
||||
private val canEditStories: Boolean? = null,
|
||||
@SerialName(canDeleteStoriesField)
|
||||
private val canDeleteStories: Boolean? = null
|
||||
private val canDeleteStories: Boolean? = null,
|
||||
@SerialName(canManageDirectMessagesField)
|
||||
private val canManageDirectMessages: Boolean? = null,
|
||||
) : ChatMemberRequest<Boolean>, UntilDate {
|
||||
override fun method(): String = "promoteChatMember"
|
||||
override val resultDeserializer: DeserializationStrategy<Boolean>
|
||||
@@ -104,7 +106,8 @@ fun PromoteChannelAdministrator(
|
||||
canManageChat: Boolean? = null,
|
||||
canPostStories: Boolean? = null,
|
||||
canEditStories: Boolean? = null,
|
||||
canDeleteStories: Boolean? = null
|
||||
canDeleteStories: Boolean? = null,
|
||||
canManageDirectMessages: Boolean? = null,
|
||||
) = PromoteChatMember(
|
||||
chatId = chatId,
|
||||
userId = userId,
|
||||
@@ -123,7 +126,8 @@ fun PromoteChannelAdministrator(
|
||||
canManageTopics = null,
|
||||
canPostStories = canPostStories,
|
||||
canEditStories = canEditStories,
|
||||
canDeleteStories = canDeleteStories
|
||||
canDeleteStories = canDeleteStories,
|
||||
canManageDirectMessages = canManageDirectMessages
|
||||
)
|
||||
|
||||
fun PromoteSupergroupAdministrator(
|
||||
|
||||
@@ -90,10 +90,12 @@ fun CopyMessage(
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
threadId: MessageThreadId? = toChatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = toChatId.directMessageThreadId,
|
||||
startTimestamp: Seconds? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = CopyMessage(
|
||||
@@ -105,10 +107,12 @@ fun CopyMessage(
|
||||
rawEntities = null,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
startTimestamp = startTimestamp,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -120,10 +124,12 @@ fun CopyMessage(
|
||||
entities: List<TextSource>,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
threadId: MessageThreadId? = toChatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = toChatId.directMessageThreadId,
|
||||
startTimestamp: Seconds? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = CopyMessage(
|
||||
@@ -135,10 +141,12 @@ fun CopyMessage(
|
||||
rawEntities = entities.toRawMessageEntities(),
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
startTimestamp = startTimestamp,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -160,8 +168,14 @@ data class CopyMessage internal constructor(
|
||||
private val rawEntities: List<RawMessageEntity>? = null,
|
||||
@SerialName(showCaptionAboveMediaField)
|
||||
override val showCaptionAboveMedia: Boolean = false,
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
@SerialName(messageThreadIdField)
|
||||
@EncodeDefault
|
||||
override val threadId: MessageThreadId? = toChatId.threadId,
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
@EncodeDefault
|
||||
@SerialName(directMessagesTopicIdField)
|
||||
override val directMessageThreadId: DirectMessageThreadId? = toChatId.directMessageThreadId,
|
||||
@SerialName(videoStartTimestampField)
|
||||
override val startTimestamp: Seconds? = null,
|
||||
@SerialName(disableNotificationField)
|
||||
@@ -170,6 +184,8 @@ data class CopyMessage internal constructor(
|
||||
override val protectContent: Boolean = false,
|
||||
@SerialName(allowPaidBroadcastField)
|
||||
override val allowPaidBroadcast: Boolean = false,
|
||||
@SerialName(suggestedPostParametersField)
|
||||
override val suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
@SerialName(replyParametersField)
|
||||
override val replyParameters: ReplyParameters? = null,
|
||||
@SerialName(replyMarkupField)
|
||||
|
||||
@@ -2,6 +2,7 @@ package dev.inmo.tgbotapi.requests.send
|
||||
|
||||
import dev.inmo.tgbotapi.abstracts.types.*
|
||||
import dev.inmo.tgbotapi.requests.abstracts.SimpleRequest
|
||||
import dev.inmo.tgbotapi.requests.send.abstracts.OptionallyDirectMessageThreadRequest
|
||||
import dev.inmo.tgbotapi.requests.send.abstracts.OptionallyMessageThreadRequest
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
@@ -19,6 +20,7 @@ fun CopyMessages(
|
||||
fromChatId: ChatIdentifier,
|
||||
messageIds: Array<MessageId>,
|
||||
threadId: MessageThreadId? = toChatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = toChatId.directMessageThreadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
removeCaption: Boolean = false
|
||||
@@ -27,6 +29,7 @@ fun CopyMessages(
|
||||
fromChatId = fromChatId,
|
||||
messageIds = messageIds.toList(),
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
removeCaption = removeCaption
|
||||
@@ -40,8 +43,14 @@ data class CopyMessages (
|
||||
val fromChatId: ChatIdentifier,
|
||||
@SerialName(messageIdsField)
|
||||
override val messageIds: List<MessageId>,
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
@SerialName(messageThreadIdField)
|
||||
@EncodeDefault
|
||||
override val threadId: MessageThreadId? = toChatId.threadId,
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
@EncodeDefault
|
||||
@SerialName(directMessagesTopicIdField)
|
||||
override val directMessageThreadId: DirectMessageThreadId? = toChatId.directMessageThreadId,
|
||||
@SerialName(disableNotificationField)
|
||||
override val disableNotification: Boolean = false,
|
||||
@SerialName(protectContentField)
|
||||
@@ -52,6 +61,7 @@ data class CopyMessages (
|
||||
MessagesAction,
|
||||
ProtectContent,
|
||||
OptionallyMessageThreadRequest,
|
||||
OptionallyDirectMessageThreadRequest,
|
||||
DisableNotification {
|
||||
override val chatId: ChatIdentifier
|
||||
get() = fromChatId
|
||||
|
||||
@@ -18,7 +18,9 @@ data class SendAction(
|
||||
override val chatId: ChatIdentifier,
|
||||
@SerialName(actionField)
|
||||
val action: BotAction,
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
@SerialName(messageThreadIdField)
|
||||
@EncodeDefault
|
||||
override val threadId: MessageThreadId? = chatId.threadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId
|
||||
|
||||
@@ -6,6 +6,7 @@ import dev.inmo.tgbotapi.requests.send.abstracts.SendMessageRequest
|
||||
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.SuggestedPostParameters
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass
|
||||
import dev.inmo.tgbotapi.types.message.content.ContactContent
|
||||
@@ -24,8 +25,14 @@ data class SendContact(
|
||||
val firstName: String,
|
||||
@SerialName(lastNameField)
|
||||
val lastName: String? = null,
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
@SerialName(messageThreadIdField)
|
||||
@EncodeDefault
|
||||
override val threadId: MessageThreadId? = chatId.threadId,
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
@EncodeDefault
|
||||
@SerialName(directMessagesTopicIdField)
|
||||
override val directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(disableNotificationField)
|
||||
@@ -36,6 +43,8 @@ data class SendContact(
|
||||
override val allowPaidBroadcast: Boolean = false,
|
||||
@SerialName(messageEffectIdField)
|
||||
override val effectId: EffectId? = null,
|
||||
@SerialName(suggestedPostParametersField)
|
||||
override val suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
@SerialName(replyParametersField)
|
||||
override val replyParameters: ReplyParameters? = null,
|
||||
@SerialName(replyMarkupField)
|
||||
@@ -47,11 +56,13 @@ data class SendContact(
|
||||
chatId: ChatIdentifier,
|
||||
contact: Contact,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): this(
|
||||
@@ -60,11 +71,13 @@ data class SendContact(
|
||||
contact.firstName,
|
||||
contact.lastName,
|
||||
threadId,
|
||||
directMessageThreadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
allowPaidBroadcast,
|
||||
effectId,
|
||||
suggestedPostParameters,
|
||||
replyParameters,
|
||||
replyMarkup
|
||||
)
|
||||
@@ -79,22 +92,26 @@ data class SendContact(
|
||||
fun Contact.toRequest(
|
||||
chatId: ChatIdentifier,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): SendContact = SendContact(
|
||||
chatId = chatId,
|
||||
contact = this,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
@@ -9,6 +9,7 @@ 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.dice.DiceAnimationType
|
||||
import dev.inmo.tgbotapi.types.message.SuggestedPostParameters
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass
|
||||
import dev.inmo.tgbotapi.types.message.content.DiceContent
|
||||
@@ -23,8 +24,14 @@ data class SendDice(
|
||||
override val chatId: ChatIdentifier,
|
||||
@SerialName(emojiField)
|
||||
val animationType: DiceAnimationType? = null,
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
@SerialName(messageThreadIdField)
|
||||
@EncodeDefault
|
||||
override val threadId: MessageThreadId? = chatId.threadId,
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
@EncodeDefault
|
||||
@SerialName(directMessagesTopicIdField)
|
||||
override val directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(disableNotificationField)
|
||||
@@ -35,6 +42,8 @@ data class SendDice(
|
||||
override val allowPaidBroadcast: Boolean = false,
|
||||
@SerialName(messageEffectIdField)
|
||||
override val effectId: EffectId? = null,
|
||||
@SerialName(suggestedPostParametersField)
|
||||
override val suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
@SerialName(replyParametersField)
|
||||
override val replyParameters: ReplyParameters? = null,
|
||||
@SerialName(replyMarkupField)
|
||||
|
||||
@@ -6,6 +6,7 @@ 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.location.LiveLocation
|
||||
import dev.inmo.tgbotapi.types.message.SuggestedPostParameters
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass
|
||||
import dev.inmo.tgbotapi.types.message.content.*
|
||||
@@ -30,11 +31,13 @@ fun SendLocation(
|
||||
latitude: Double,
|
||||
longitude: Double,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = SendLocation.Static(
|
||||
@@ -42,11 +45,13 @@ fun SendLocation(
|
||||
latitude = latitude,
|
||||
longitude = longitude,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -56,11 +61,13 @@ fun SendStaticLocation(
|
||||
latitude: Double,
|
||||
longitude: Double,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = SendLocation.Static(
|
||||
@@ -68,11 +75,13 @@ fun SendStaticLocation(
|
||||
latitude = latitude,
|
||||
longitude = longitude,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -86,11 +95,13 @@ fun SendLiveLocation(
|
||||
heading: Degrees? = null,
|
||||
proximityAlertRadius: Meters? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = SendLocation.Live(
|
||||
@@ -102,11 +113,13 @@ fun SendLiveLocation(
|
||||
heading = heading,
|
||||
proximityAlertRadius = proximityAlertRadius,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -139,10 +152,14 @@ sealed interface SendLocation<T : LocationContent> : SendContentMessageRequest<C
|
||||
override val heading: Degrees? = null,
|
||||
@SerialName(proximityAlertRadiusField)
|
||||
override val proximityAlertRadius: Meters? = null,
|
||||
@SerialName(messageThreadIdField)
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
@SerialName(messageThreadIdField)
|
||||
@EncodeDefault
|
||||
override val threadId: MessageThreadId? = chatId.threadId,
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
@EncodeDefault
|
||||
@SerialName(directMessagesTopicIdField)
|
||||
override val directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
@EncodeDefault
|
||||
@@ -155,6 +172,8 @@ sealed interface SendLocation<T : LocationContent> : SendContentMessageRequest<C
|
||||
override val allowPaidBroadcast: Boolean = false,
|
||||
@SerialName(messageEffectIdField)
|
||||
override val effectId: EffectId? = null,
|
||||
@SerialName(suggestedPostParametersField)
|
||||
override val suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
@SerialName(replyParametersField)
|
||||
override val replyParameters: ReplyParameters? = null,
|
||||
@SerialName(replyMarkupField)
|
||||
@@ -187,6 +206,10 @@ sealed interface SendLocation<T : LocationContent> : SendContentMessageRequest<C
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
@EncodeDefault
|
||||
override val threadId: MessageThreadId? = chatId.threadId,
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
@EncodeDefault
|
||||
@SerialName(directMessagesTopicIdField)
|
||||
override val directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
@EncodeDefault
|
||||
@@ -199,6 +222,8 @@ sealed interface SendLocation<T : LocationContent> : SendContentMessageRequest<C
|
||||
override val allowPaidBroadcast: Boolean = false,
|
||||
@SerialName(messageEffectIdField)
|
||||
override val effectId: EffectId? = null,
|
||||
@SerialName(suggestedPostParametersField)
|
||||
override val suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
@SerialName(replyParametersField)
|
||||
override val replyParameters: ReplyParameters? = null,
|
||||
@SerialName(replyMarkupField)
|
||||
@@ -237,6 +262,8 @@ sealed interface SendLocation<T : LocationContent> : SendContentMessageRequest<C
|
||||
val proximityAlertRadius: Meters? = null,
|
||||
@SerialName(messageThreadIdField)
|
||||
val threadId: MessageThreadId? = chatId.threadId,
|
||||
@SerialName(directMessagesTopicIdField)
|
||||
val directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(disableNotificationField)
|
||||
@@ -247,6 +274,8 @@ sealed interface SendLocation<T : LocationContent> : SendContentMessageRequest<C
|
||||
val allowPaidBroadcast: Boolean = false,
|
||||
@SerialName(messageEffectIdField)
|
||||
val effectId: EffectId? = null,
|
||||
@SerialName(suggestedPostParametersField)
|
||||
val suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
@SerialName(replyParametersField)
|
||||
val replyParameters: ReplyParameters? = null,
|
||||
@SerialName(replyMarkupField)
|
||||
@@ -265,11 +294,13 @@ sealed interface SendLocation<T : LocationContent> : SendContentMessageRequest<C
|
||||
latitude = surrogate.latitude,
|
||||
longitude = surrogate.longitude,
|
||||
threadId = surrogate.threadId,
|
||||
directMessageThreadId = surrogate.directMessageThreadId,
|
||||
businessConnectionId = surrogate.businessConnectionId,
|
||||
disableNotification = surrogate.disableNotification,
|
||||
protectContent = surrogate.protectContent,
|
||||
allowPaidBroadcast = surrogate.allowPaidBroadcast,
|
||||
effectId = surrogate.effectId,
|
||||
suggestedPostParameters = surrogate.suggestedPostParameters,
|
||||
replyParameters = surrogate.replyParameters,
|
||||
replyMarkup = surrogate.replyMarkup
|
||||
)
|
||||
@@ -282,11 +313,13 @@ sealed interface SendLocation<T : LocationContent> : SendContentMessageRequest<C
|
||||
heading = surrogate.heading,
|
||||
proximityAlertRadius = surrogate.proximityAlertRadius,
|
||||
threadId = surrogate.threadId,
|
||||
directMessageThreadId = surrogate.directMessageThreadId,
|
||||
businessConnectionId = surrogate.businessConnectionId,
|
||||
disableNotification = surrogate.disableNotification,
|
||||
protectContent = surrogate.protectContent,
|
||||
allowPaidBroadcast = surrogate.allowPaidBroadcast,
|
||||
effectId = surrogate.effectId,
|
||||
suggestedPostParameters = surrogate.suggestedPostParameters,
|
||||
replyParameters = surrogate.replyParameters,
|
||||
replyMarkup = surrogate.replyMarkup
|
||||
)
|
||||
@@ -304,11 +337,13 @@ sealed interface SendLocation<T : LocationContent> : SendContentMessageRequest<C
|
||||
heading = heading,
|
||||
proximityAlertRadius = proximityAlertRadius,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
@@ -27,11 +27,13 @@ fun SendTextMessage(
|
||||
parseMode: ParseMode? = null,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = SendTextMessage(
|
||||
@@ -40,12 +42,14 @@ fun SendTextMessage(
|
||||
parseMode = parseMode,
|
||||
rawEntities = null,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
linkPreviewOptions = linkPreviewOptions,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -55,11 +59,13 @@ fun SendTextMessage(
|
||||
entities: TextSourcesList,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = SendTextMessage(
|
||||
@@ -68,12 +74,14 @@ fun SendTextMessage(
|
||||
parseMode = null,
|
||||
rawEntities = entities.toRawMessageEntities(),
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
linkPreviewOptions = linkPreviewOptions,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -89,8 +97,14 @@ data class SendTextMessage internal constructor(
|
||||
override val parseMode: ParseMode? = null,
|
||||
@SerialName(entitiesField)
|
||||
private val rawEntities: List<RawMessageEntity>? = null,
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
@SerialName(messageThreadIdField)
|
||||
@EncodeDefault
|
||||
override val threadId: MessageThreadId? = chatId.threadId,
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
@EncodeDefault
|
||||
@SerialName(directMessagesTopicIdField)
|
||||
override val directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(linkPreviewOptionsField)
|
||||
@@ -103,6 +117,8 @@ data class SendTextMessage internal constructor(
|
||||
override val allowPaidBroadcast: Boolean = false,
|
||||
@SerialName(messageEffectIdField)
|
||||
override val effectId: EffectId? = null,
|
||||
@SerialName(suggestedPostParametersField)
|
||||
override val suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
@SerialName(replyParametersField)
|
||||
override val replyParameters: ReplyParameters? = null,
|
||||
@SerialName(replyMarkupField)
|
||||
|
||||
@@ -4,6 +4,7 @@ import dev.inmo.tgbotapi.requests.send.abstracts.*
|
||||
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.SuggestedPostParameters
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass
|
||||
import dev.inmo.tgbotapi.types.message.content.VenueContent
|
||||
@@ -33,8 +34,14 @@ data class SendVenue(
|
||||
val googlePlaceId: GooglePlaceId? = null,
|
||||
@SerialName(googlePlaceTypeField)
|
||||
val googlePlaceType: GooglePlaceType? = null,
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
@SerialName(messageThreadIdField)
|
||||
@EncodeDefault
|
||||
override val threadId: MessageThreadId? = chatId.threadId,
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
@EncodeDefault
|
||||
@SerialName(directMessagesTopicIdField)
|
||||
override val directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(disableNotificationField)
|
||||
@@ -45,6 +52,8 @@ data class SendVenue(
|
||||
override val allowPaidBroadcast: Boolean = false,
|
||||
@SerialName(messageEffectIdField)
|
||||
override val effectId: EffectId? = null,
|
||||
@SerialName(suggestedPostParametersField)
|
||||
override val suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
@SerialName(replyParametersField)
|
||||
override val replyParameters: ReplyParameters? = null,
|
||||
@SerialName(replyMarkupField)
|
||||
@@ -58,11 +67,13 @@ data class SendVenue(
|
||||
chatId: ChatIdentifier,
|
||||
venue: Venue,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): this(
|
||||
@@ -76,11 +87,13 @@ data class SendVenue(
|
||||
googlePlaceId = venue.googlePlaceId,
|
||||
googlePlaceType = venue.googlePlaceType,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -95,22 +108,26 @@ data class SendVenue(
|
||||
fun Venue.toRequest(
|
||||
chatId: ChatIdentifier,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): SendVenue = SendVenue(
|
||||
chatId = chatId,
|
||||
venue = this,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
package dev.inmo.tgbotapi.requests.send.abstracts
|
||||
|
||||
import dev.inmo.tgbotapi.types.DirectMessageThreadId
|
||||
|
||||
interface OptionallyDirectMessageThreadRequest {
|
||||
val directMessageThreadId: DirectMessageThreadId?
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package dev.inmo.tgbotapi.requests.send.abstracts
|
||||
|
||||
import dev.inmo.tgbotapi.types.message.SuggestedPostParameters
|
||||
|
||||
interface OptionallySuggestedPostRequest {
|
||||
val suggestedPostParameters: SuggestedPostParameters?
|
||||
}
|
||||
@@ -7,4 +7,6 @@ interface SendMessageRequest<T: Any> : SendChatMessageRequest<T>,
|
||||
DisableNotification,
|
||||
ProtectContent,
|
||||
AllowPaidBroadcast,
|
||||
OptionallyMessageThreadRequest
|
||||
OptionallyMessageThreadRequest,
|
||||
OptionallyDirectMessageThreadRequest,
|
||||
OptionallySuggestedPostRequest
|
||||
|
||||
@@ -6,6 +6,7 @@ import dev.inmo.tgbotapi.requests.send.abstracts.SendMessageRequest
|
||||
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.SuggestedPostParameters
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass
|
||||
import dev.inmo.tgbotapi.types.message.content.GameContent
|
||||
@@ -20,8 +21,14 @@ data class SendGame (
|
||||
override val chatId: ChatIdentifier,
|
||||
@SerialName(gameShortNameField)
|
||||
val gameShortName: String,
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
@SerialName(messageThreadIdField)
|
||||
@EncodeDefault
|
||||
override val threadId: MessageThreadId? = chatId.threadId,
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
@EncodeDefault
|
||||
@SerialName(directMessagesTopicIdField)
|
||||
override val directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(disableNotificationField)
|
||||
@@ -32,6 +39,8 @@ data class SendGame (
|
||||
override val allowPaidBroadcast: Boolean = false,
|
||||
@SerialName(messageEffectIdField)
|
||||
override val effectId: EffectId? = null,
|
||||
@SerialName(suggestedPostParametersField)
|
||||
override val suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
@SerialName(replyParametersField)
|
||||
override val replyParameters: ReplyParameters? = null,
|
||||
@SerialName(replyMarkupField)
|
||||
|
||||
@@ -35,11 +35,13 @@ fun SendAnimation(
|
||||
width: Int? = null,
|
||||
height: Int? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): Request<ContentMessage<AnimationContent>> {
|
||||
@@ -59,11 +61,13 @@ fun SendAnimation(
|
||||
width = width,
|
||||
height = height,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -89,11 +93,13 @@ fun SendAnimation(
|
||||
width: Int? = null,
|
||||
height: Int? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): Request<ContentMessage<AnimationContent>> {
|
||||
@@ -113,11 +119,13 @@ fun SendAnimation(
|
||||
width = width,
|
||||
height = height,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -160,8 +168,14 @@ data class SendAnimationData internal constructor(
|
||||
override val width: Int? = null,
|
||||
@SerialName(heightField)
|
||||
override val height: Int? = null,
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
@SerialName(messageThreadIdField)
|
||||
@EncodeDefault
|
||||
override val threadId: MessageThreadId? = chatId.threadId,
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
@EncodeDefault
|
||||
@SerialName(directMessagesTopicIdField)
|
||||
override val directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(disableNotificationField)
|
||||
@@ -172,6 +186,8 @@ data class SendAnimationData internal constructor(
|
||||
override val allowPaidBroadcast: Boolean = false,
|
||||
@SerialName(messageEffectIdField)
|
||||
override val effectId: EffectId? = null,
|
||||
@SerialName(suggestedPostParametersField)
|
||||
override val suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
@SerialName(replyParametersField)
|
||||
override val replyParameters: ReplyParameters? = null,
|
||||
@SerialName(replyMarkupField)
|
||||
|
||||
@@ -34,11 +34,13 @@ fun SendAudio(
|
||||
performer: String? = null,
|
||||
title: String? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): Request<ContentMessage<AudioContent>> {
|
||||
@@ -56,11 +58,13 @@ fun SendAudio(
|
||||
performer = performer,
|
||||
title = title,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -84,11 +88,13 @@ fun SendAudio(
|
||||
performer: String? = null,
|
||||
title: String? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): Request<ContentMessage<AudioContent>> {
|
||||
@@ -106,11 +112,13 @@ fun SendAudio(
|
||||
performer = performer,
|
||||
title = title,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -149,8 +157,14 @@ data class SendAudioData internal constructor(
|
||||
override val performer: String? = null,
|
||||
@SerialName(titleField)
|
||||
override val title: String? = null,
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
@SerialName(messageThreadIdField)
|
||||
@EncodeDefault
|
||||
override val threadId: MessageThreadId? = chatId.threadId,
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
@EncodeDefault
|
||||
@SerialName(directMessagesTopicIdField)
|
||||
override val directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(disableNotificationField)
|
||||
@@ -161,6 +175,8 @@ data class SendAudioData internal constructor(
|
||||
override val allowPaidBroadcast: Boolean = false,
|
||||
@SerialName(messageEffectIdField)
|
||||
override val effectId: EffectId? = null,
|
||||
@SerialName(suggestedPostParametersField)
|
||||
override val suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
@SerialName(replyParametersField)
|
||||
override val replyParameters: ReplyParameters? = null,
|
||||
@SerialName(replyMarkupField)
|
||||
|
||||
@@ -39,11 +39,13 @@ fun SendDocument(
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null,
|
||||
disableContentTypeDetection: Boolean? = null
|
||||
@@ -59,11 +61,13 @@ fun SendDocument(
|
||||
parseMode = parseMode,
|
||||
rawEntities = null,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup,
|
||||
disableContentTypeDetection = disableContentTypeDetection
|
||||
@@ -94,11 +98,13 @@ fun SendDocument(
|
||||
thumbnail: InputFile? = null,
|
||||
entities: TextSourcesList,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null,
|
||||
disableContentTypeDetection: Boolean? = null
|
||||
@@ -114,11 +120,13 @@ fun SendDocument(
|
||||
parseMode = null,
|
||||
rawEntities = entities.toRawMessageEntities(),
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup,
|
||||
disableContentTypeDetection = disableContentTypeDetection
|
||||
@@ -161,8 +169,14 @@ data class SendDocumentData internal constructor(
|
||||
override val parseMode: ParseMode? = null,
|
||||
@SerialName(captionEntitiesField)
|
||||
private val rawEntities: List<RawMessageEntity>? = null,
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
@SerialName(messageThreadIdField)
|
||||
@EncodeDefault
|
||||
override val threadId: MessageThreadId? = chatId.threadId,
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
@EncodeDefault
|
||||
@SerialName(directMessagesTopicIdField)
|
||||
override val directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(disableNotificationField)
|
||||
@@ -173,6 +187,8 @@ data class SendDocumentData internal constructor(
|
||||
override val allowPaidBroadcast: Boolean = false,
|
||||
@SerialName(messageEffectIdField)
|
||||
override val effectId: EffectId? = null,
|
||||
@SerialName(suggestedPostParametersField)
|
||||
override val suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
@SerialName(replyParametersField)
|
||||
override val replyParameters: ReplyParameters? = null,
|
||||
@SerialName(replyMarkupField)
|
||||
|
||||
@@ -10,6 +10,7 @@ import dev.inmo.tgbotapi.requests.send.media.base.*
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.media.*
|
||||
import dev.inmo.tgbotapi.types.message.SuggestedPostParameters
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.PossiblySentViaBotCommonMessage
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializeOnlySerializerClass
|
||||
@@ -35,11 +36,13 @@ fun <T : MediaGroupPartContent> SendMediaGroup(
|
||||
chatId: ChatIdentifier,
|
||||
media: List<MediaGroupMemberTelegramMedia>,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null
|
||||
): Request<ContentMessage<MediaGroupContent<T>>> {
|
||||
if (media.size !in mediaCountInMediaGroup) {
|
||||
@@ -66,11 +69,13 @@ fun <T : MediaGroupPartContent> SendMediaGroup(
|
||||
chatId = chatId,
|
||||
media = media,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters
|
||||
)
|
||||
|
||||
@@ -95,21 +100,25 @@ inline fun SendPlaylist(
|
||||
chatId: ChatIdentifier,
|
||||
media: List<AudioMediaGroupMemberTelegramMedia>,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null
|
||||
) = SendMediaGroup<AudioContent>(
|
||||
chatId = chatId,
|
||||
media = media,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters
|
||||
)
|
||||
|
||||
@@ -123,21 +132,25 @@ inline fun SendDocumentsGroup(
|
||||
chatId: ChatIdentifier,
|
||||
media: List<DocumentMediaGroupMemberTelegramMedia>,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null
|
||||
) = SendMediaGroup<DocumentContent>(
|
||||
chatId = chatId,
|
||||
media = media,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters
|
||||
)
|
||||
|
||||
@@ -152,21 +165,25 @@ inline fun SendVisualMediaGroup(
|
||||
chatId: ChatIdentifier,
|
||||
media: List<VisualMediaGroupMemberTelegramMedia>,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
) = SendMediaGroup<VisualMediaGroupPartContent>(
|
||||
chatId = chatId,
|
||||
media = media,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters
|
||||
)
|
||||
|
||||
@@ -191,8 +208,14 @@ data class SendMediaGroupData internal constructor(
|
||||
@SerialName(chatIdField)
|
||||
override val chatId: ChatIdentifier,
|
||||
val media: List<MediaGroupMemberTelegramMedia> = emptyList(),
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
@SerialName(messageThreadIdField)
|
||||
@EncodeDefault
|
||||
override val threadId: MessageThreadId? = chatId.threadId,
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
@EncodeDefault
|
||||
@SerialName(directMessagesTopicIdField)
|
||||
override val directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(disableNotificationField)
|
||||
@@ -203,6 +226,8 @@ data class SendMediaGroupData internal constructor(
|
||||
override val allowPaidBroadcast: Boolean = false,
|
||||
@SerialName(messageEffectIdField)
|
||||
override val effectId: EffectId? = null,
|
||||
@SerialName(suggestedPostParametersField)
|
||||
override val suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
@SerialName(replyParametersField)
|
||||
override val replyParameters: ReplyParameters? = null,
|
||||
) : DataRequest<PossiblySentViaBotCommonMessage<MediaGroupContent<MediaGroupPartContent>>>,
|
||||
|
||||
@@ -34,10 +34,12 @@ fun SendPaidMedia(
|
||||
payload: PaidMediaPayload? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): Request<ContentMessage<PaidMediaInfoContent>> {
|
||||
@@ -51,10 +53,12 @@ fun SendPaidMedia(
|
||||
rawEntities = null,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -93,10 +97,12 @@ fun SendPaidMedia(
|
||||
payload: PaidMediaPayload? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): Request<ContentMessage<PaidMediaInfoContent>> {
|
||||
@@ -110,10 +116,12 @@ fun SendPaidMedia(
|
||||
rawEntities = entities.toRawMessageEntities(),
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -167,8 +175,14 @@ data class SendPaidMediaData internal constructor(
|
||||
val payload: PaidMediaPayload? = null,
|
||||
@SerialName(showCaptionAboveMediaField)
|
||||
override val showCaptionAboveMedia: Boolean = false,
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
@SerialName(messageThreadIdField)
|
||||
@EncodeDefault
|
||||
override val threadId: MessageThreadId? = chatId.threadId,
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
@EncodeDefault
|
||||
@SerialName(directMessagesTopicIdField)
|
||||
override val directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(disableNotificationField)
|
||||
@@ -177,6 +191,8 @@ data class SendPaidMediaData internal constructor(
|
||||
override val protectContent: Boolean = false,
|
||||
@SerialName(allowPaidBroadcastField)
|
||||
override val allowPaidBroadcast: Boolean = false,
|
||||
@SerialName(suggestedPostParametersField)
|
||||
override val suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
@SerialName(replyParametersField)
|
||||
override val replyParameters: ReplyParameters? = null,
|
||||
@SerialName(replyMarkupField)
|
||||
|
||||
@@ -30,11 +30,13 @@ fun SendPhoto(
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): Request<ContentMessage<PhotoContent>> {
|
||||
@@ -47,11 +49,13 @@ fun SendPhoto(
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -72,11 +76,13 @@ fun SendPhoto(
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): Request<ContentMessage<PhotoContent>> {
|
||||
@@ -89,11 +95,13 @@ fun SendPhoto(
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -128,8 +136,14 @@ data class SendPhotoData internal constructor(
|
||||
override val showCaptionAboveMedia: Boolean = false,
|
||||
@SerialName(hasSpoilerField)
|
||||
override val spoilered: Boolean = false,
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
@SerialName(messageThreadIdField)
|
||||
@EncodeDefault
|
||||
override val threadId: MessageThreadId? = chatId.threadId,
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
@EncodeDefault
|
||||
@SerialName(directMessagesTopicIdField)
|
||||
override val directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(disableNotificationField)
|
||||
@@ -140,6 +154,8 @@ data class SendPhotoData internal constructor(
|
||||
override val allowPaidBroadcast: Boolean = false,
|
||||
@SerialName(messageEffectIdField)
|
||||
override val effectId: EffectId? = null,
|
||||
@SerialName(suggestedPostParametersField)
|
||||
override val suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
@SerialName(replyParametersField)
|
||||
override val replyParameters: ReplyParameters? = null,
|
||||
@SerialName(replyMarkupField)
|
||||
|
||||
@@ -8,6 +8,7 @@ import dev.inmo.tgbotapi.requests.send.abstracts.SendMessageRequest
|
||||
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.SuggestedPostParameters
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass
|
||||
import dev.inmo.tgbotapi.types.message.content.StickerContent
|
||||
@@ -18,24 +19,28 @@ fun SendSticker(
|
||||
chatId: ChatIdentifier,
|
||||
sticker: InputFile,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
emoji: String? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): Request<ContentMessage<StickerContent>> = SendStickerByFileId(
|
||||
chatId = chatId,
|
||||
sticker = sticker,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
emoji = emoji,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
).let {
|
||||
@@ -58,8 +63,14 @@ data class SendStickerByFileId internal constructor(
|
||||
override val chatId: ChatIdentifier,
|
||||
@SerialName(stickerField)
|
||||
val sticker: InputFile,
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
@SerialName(messageThreadIdField)
|
||||
@EncodeDefault
|
||||
override val threadId: MessageThreadId? = chatId.threadId,
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
@EncodeDefault
|
||||
@SerialName(directMessagesTopicIdField)
|
||||
override val directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(emojiField)
|
||||
@@ -72,6 +83,8 @@ data class SendStickerByFileId internal constructor(
|
||||
override val allowPaidBroadcast: Boolean = false,
|
||||
@SerialName(messageEffectIdField)
|
||||
override val effectId: EffectId? = null,
|
||||
@SerialName(suggestedPostParametersField)
|
||||
override val suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
@SerialName(replyParametersField)
|
||||
override val replyParameters: ReplyParameters? = null,
|
||||
@SerialName(replyMarkupField)
|
||||
|
||||
@@ -39,11 +39,13 @@ fun SendVideo(
|
||||
height: Int? = null,
|
||||
supportStreaming: Boolean? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): Request<ContentMessage<VideoContent>> {
|
||||
@@ -67,11 +69,13 @@ fun SendVideo(
|
||||
height = height,
|
||||
supportStreaming = supportStreaming,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -100,11 +104,13 @@ fun SendVideo(
|
||||
height: Int? = null,
|
||||
supportStreaming: Boolean? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): Request<ContentMessage<VideoContent>> {
|
||||
@@ -128,11 +134,13 @@ fun SendVideo(
|
||||
height = height,
|
||||
supportStreaming = supportStreaming,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -181,8 +189,14 @@ data class SendVideoData internal constructor(
|
||||
override val height: Int? = null,
|
||||
@SerialName(supportStreamingField)
|
||||
val supportStreaming: Boolean? = null,
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
@SerialName(messageThreadIdField)
|
||||
@EncodeDefault
|
||||
override val threadId: MessageThreadId? = chatId.threadId,
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
@EncodeDefault
|
||||
@SerialName(directMessagesTopicIdField)
|
||||
override val directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(disableNotificationField)
|
||||
@@ -193,6 +207,8 @@ data class SendVideoData internal constructor(
|
||||
override val allowPaidBroadcast: Boolean = false,
|
||||
@SerialName(messageEffectIdField)
|
||||
override val effectId: EffectId? = null,
|
||||
@SerialName(suggestedPostParametersField)
|
||||
override val suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
@SerialName(replyParametersField)
|
||||
override val replyParameters: ReplyParameters? = null,
|
||||
@SerialName(replyMarkupField)
|
||||
|
||||
@@ -7,6 +7,7 @@ import dev.inmo.tgbotapi.requests.send.media.base.*
|
||||
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.SuggestedPostParameters
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass
|
||||
import dev.inmo.tgbotapi.types.message.content.VideoNoteContent
|
||||
@@ -21,11 +22,13 @@ fun SendVideoNote(
|
||||
duration: Long? = null,
|
||||
size: Int? = null, // in documentation - length (size of video side)
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): Request<ContentMessage<VideoNoteContent>> {
|
||||
@@ -39,11 +42,13 @@ fun SendVideoNote(
|
||||
duration = duration,
|
||||
width = size,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -74,8 +79,14 @@ data class SendVideoNoteData internal constructor(
|
||||
override val duration: Long? = null,
|
||||
@SerialName(lengthField)
|
||||
override val width: Int? = null,
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
@SerialName(messageThreadIdField)
|
||||
@EncodeDefault
|
||||
override val threadId: MessageThreadId? = chatId.threadId,
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
@EncodeDefault
|
||||
@SerialName(directMessagesTopicIdField)
|
||||
override val directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(disableNotificationField)
|
||||
@@ -86,6 +97,8 @@ data class SendVideoNoteData internal constructor(
|
||||
override val allowPaidBroadcast: Boolean = false,
|
||||
@SerialName(messageEffectIdField)
|
||||
override val effectId: EffectId? = null,
|
||||
@SerialName(suggestedPostParametersField)
|
||||
override val suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
@SerialName(replyParametersField)
|
||||
override val replyParameters: ReplyParameters? = null,
|
||||
@SerialName(replyMarkupField)
|
||||
|
||||
@@ -28,11 +28,13 @@ fun SendVoice(
|
||||
parseMode: ParseMode? = null,
|
||||
duration: Long? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): Request<ContentMessage<VoiceContent>> {
|
||||
@@ -46,11 +48,13 @@ fun SendVoice(
|
||||
rawEntities = null,
|
||||
duration = duration,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -70,12 +74,14 @@ fun SendVoice(
|
||||
voice: InputFile,
|
||||
entities: TextSourcesList,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
duration: Long? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): Request<ContentMessage<VoiceContent>> {
|
||||
@@ -89,11 +95,13 @@ fun SendVoice(
|
||||
rawEntities = entities.toRawMessageEntities(),
|
||||
duration = duration,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -126,8 +134,14 @@ data class SendVoiceData internal constructor(
|
||||
private val rawEntities: List<RawMessageEntity>? = null,
|
||||
@SerialName(durationField)
|
||||
override val duration: Long? = null,
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
@SerialName(messageThreadIdField)
|
||||
@EncodeDefault
|
||||
override val threadId: MessageThreadId? = chatId.threadId,
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
@EncodeDefault
|
||||
@SerialName(directMessagesTopicIdField)
|
||||
override val directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(disableNotificationField)
|
||||
@@ -138,6 +152,8 @@ data class SendVoiceData internal constructor(
|
||||
override val allowPaidBroadcast: Boolean = false,
|
||||
@SerialName(messageEffectIdField)
|
||||
override val effectId: EffectId? = null,
|
||||
@SerialName(suggestedPostParametersField)
|
||||
override val suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
@SerialName(replyParametersField)
|
||||
override val replyParameters: ReplyParameters? = null,
|
||||
@SerialName(replyMarkupField)
|
||||
|
||||
@@ -6,6 +6,7 @@ import dev.inmo.tgbotapi.requests.send.abstracts.OptionallyWithEffectRequest
|
||||
import dev.inmo.tgbotapi.requests.send.abstracts.SendMessageRequest
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.message.SuggestedPostParameters
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass
|
||||
import dev.inmo.tgbotapi.types.message.content.InvoiceContent
|
||||
@@ -13,6 +14,7 @@ import dev.inmo.tgbotapi.types.payments.LabeledPrice
|
||||
import dev.inmo.tgbotapi.types.payments.LabeledPricesSerializer
|
||||
import dev.inmo.tgbotapi.types.payments.abstracts.Currency
|
||||
import dev.inmo.tgbotapi.types.payments.abstracts.XTR
|
||||
import dev.inmo.tgbotapi.types.threadId
|
||||
import kotlinx.serialization.*
|
||||
|
||||
private val invoiceMessageSerializer: DeserializationStrategy<ContentMessage<InvoiceContent>>
|
||||
@@ -61,8 +63,14 @@ data class SendInvoice(
|
||||
override val shouldSendEmailToProvider: Boolean = false,
|
||||
@SerialName(priceDependOnShipAddressField)
|
||||
override val priceDependOnShipAddress: Boolean = false,
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
@SerialName(messageThreadIdField)
|
||||
@EncodeDefault
|
||||
override val threadId: MessageThreadId? = chatId.threadId,
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
@EncodeDefault
|
||||
@SerialName(directMessagesTopicIdField)
|
||||
override val directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
@SerialName(disableNotificationField)
|
||||
override val disableNotification: Boolean = false,
|
||||
@SerialName(protectContentField)
|
||||
@@ -71,6 +79,8 @@ data class SendInvoice(
|
||||
override val allowPaidBroadcast: Boolean = false,
|
||||
@SerialName(messageEffectIdField)
|
||||
override val effectId: EffectId? = null,
|
||||
@SerialName(suggestedPostParametersField)
|
||||
override val suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
@SerialName(replyParametersField)
|
||||
override val replyParameters: ReplyParameters? = null,
|
||||
@SerialName(replyMarkupField)
|
||||
@@ -111,10 +121,12 @@ data class SendInvoice(
|
||||
startParameter: StartParameter? = null,
|
||||
providerData: String? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
) : this(
|
||||
@@ -128,10 +140,12 @@ data class SendInvoice(
|
||||
startParameter = startParameter,
|
||||
providerData = providerData,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
@@ -7,6 +7,7 @@ import dev.inmo.tgbotapi.requests.send.abstracts.SendContentMessageRequest
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||
import dev.inmo.tgbotapi.types.message.SuggestedPostParameters
|
||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass
|
||||
@@ -49,24 +50,30 @@ fun SendPoll(
|
||||
isAnonymous: Boolean = true,
|
||||
isClosed: Boolean = false,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = SendRegularPoll(
|
||||
chatId,
|
||||
question,
|
||||
options,
|
||||
null,
|
||||
questionParseMode,
|
||||
isAnonymous,
|
||||
isClosed,
|
||||
false,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
disableNotification = disableNotification,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -78,23 +85,30 @@ fun SendPoll(
|
||||
isAnonymous: Boolean = true,
|
||||
isClosed: Boolean = false,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = SendRegularPoll(
|
||||
chatId = chatId,
|
||||
questionEntities = textSources,
|
||||
questionTextSources = textSources,
|
||||
options = options,
|
||||
closeInfo = null,
|
||||
isAnonymous = isAnonymous,
|
||||
isClosed = isClosed,
|
||||
allowMultipleAnswers = false,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
disableNotification = disableNotification,
|
||||
effectId = null,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -106,11 +120,13 @@ fun SendPoll(
|
||||
fun Poll.createRequest(
|
||||
chatId: ChatIdentifier,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = when (this) {
|
||||
@@ -123,11 +139,13 @@ fun Poll.createRequest(
|
||||
isClosed = isClosed,
|
||||
allowMultipleAnswers = allowMultipleAnswers,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -142,11 +160,13 @@ fun Poll.createRequest(
|
||||
isAnonymous = isAnonymous,
|
||||
isClosed = isClosed,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -159,11 +179,13 @@ fun Poll.createRequest(
|
||||
isClosed = isClosed,
|
||||
allowMultipleAnswers = false,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -176,11 +198,13 @@ fun Poll.createRequest(
|
||||
isClosed = isClosed,
|
||||
allowMultipleAnswers = false,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
@@ -5,6 +5,7 @@ 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.RawMessageEntity
|
||||
import dev.inmo.tgbotapi.types.message.SuggestedPostParameters
|
||||
import dev.inmo.tgbotapi.types.message.asTextSources
|
||||
import dev.inmo.tgbotapi.types.message.textsources.TextSource
|
||||
import dev.inmo.tgbotapi.types.message.toRawMessageEntities
|
||||
@@ -13,6 +14,8 @@ import dev.inmo.tgbotapi.types.polls.ExactScheduledCloseInfo
|
||||
import dev.inmo.tgbotapi.types.polls.InputPollOption
|
||||
import dev.inmo.tgbotapi.types.polls.ScheduledCloseInfo
|
||||
import dev.inmo.tgbotapi.utils.extensions.makeSourceString
|
||||
import kotlinx.serialization.EncodeDefault
|
||||
import kotlinx.serialization.ExperimentalSerializationApi
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
import kotlinx.serialization.SerializationStrategy
|
||||
@@ -46,8 +49,14 @@ class SendQuizPoll internal constructor(
|
||||
override val openPeriod: LongSeconds? = null,
|
||||
@SerialName(closeDateField)
|
||||
override val closeDate: LongSeconds? = null,
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
@SerialName(messageThreadIdField)
|
||||
@EncodeDefault
|
||||
override val threadId: MessageThreadId? = chatId.threadId,
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
@EncodeDefault
|
||||
@SerialName(directMessagesTopicIdField)
|
||||
override val directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(disableNotificationField)
|
||||
@@ -58,6 +67,8 @@ class SendQuizPoll internal constructor(
|
||||
override val allowPaidBroadcast: Boolean = false,
|
||||
@SerialName(messageEffectIdField)
|
||||
override val effectId: EffectId? = null,
|
||||
@SerialName(suggestedPostParametersField)
|
||||
override val suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
@SerialName(replyParametersField)
|
||||
override val replyParameters: ReplyParameters? = null,
|
||||
@SerialName(replyMarkupField)
|
||||
@@ -85,11 +96,13 @@ class SendQuizPoll internal constructor(
|
||||
openPeriod: LongSeconds? = null,
|
||||
closeDate: LongSeconds? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) : this(
|
||||
@@ -107,11 +120,13 @@ class SendQuizPoll internal constructor(
|
||||
openPeriod = openPeriod,
|
||||
closeDate = closeDate,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -128,11 +143,13 @@ class SendQuizPoll internal constructor(
|
||||
openPeriod: LongSeconds? = null,
|
||||
closeDate: LongSeconds? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) : this(
|
||||
@@ -150,11 +167,13 @@ class SendQuizPoll internal constructor(
|
||||
openPeriod = openPeriod,
|
||||
closeDate = closeDate,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -171,11 +190,13 @@ class SendQuizPoll internal constructor(
|
||||
openPeriod: LongSeconds? = null,
|
||||
closeDate: LongSeconds? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) : this(
|
||||
@@ -193,11 +214,13 @@ class SendQuizPoll internal constructor(
|
||||
openPeriod = openPeriod,
|
||||
closeDate = closeDate,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -213,11 +236,13 @@ class SendQuizPoll internal constructor(
|
||||
openPeriod: LongSeconds? = null,
|
||||
closeDate: LongSeconds? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) : this(
|
||||
@@ -235,11 +260,13 @@ class SendQuizPoll internal constructor(
|
||||
openPeriod = openPeriod,
|
||||
closeDate = closeDate,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -271,11 +298,13 @@ fun SendQuizPoll(
|
||||
isAnonymous: Boolean = true,
|
||||
isClosed: Boolean = false,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = SendQuizPoll(
|
||||
@@ -291,11 +320,13 @@ fun SendQuizPoll(
|
||||
openPeriod = (closeInfo as? ApproximateScheduledCloseInfo)?.openPeriod,
|
||||
closeDate = (closeInfo as? ExactScheduledCloseInfo)?.closeDate,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -311,11 +342,13 @@ fun SendQuizPoll(
|
||||
isAnonymous: Boolean = true,
|
||||
isClosed: Boolean = false,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = SendQuizPoll(
|
||||
@@ -330,11 +363,13 @@ fun SendQuizPoll(
|
||||
openPeriod = (closeInfo as? ApproximateScheduledCloseInfo)?.openPeriod,
|
||||
closeDate = (closeInfo as? ExactScheduledCloseInfo)?.closeDate,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -350,11 +385,13 @@ fun SendQuizPoll(
|
||||
isAnonymous: Boolean = true,
|
||||
isClosed: Boolean = false,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = SendQuizPoll(
|
||||
@@ -369,11 +406,13 @@ fun SendQuizPoll(
|
||||
openPeriod = (closeInfo as? ApproximateScheduledCloseInfo)?.openPeriod,
|
||||
closeDate = (closeInfo as? ExactScheduledCloseInfo)?.closeDate,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -388,11 +427,13 @@ fun SendQuizPoll(
|
||||
isAnonymous: Boolean = true,
|
||||
isClosed: Boolean = false,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = SendQuizPoll(
|
||||
@@ -406,11 +447,13 @@ fun SendQuizPoll(
|
||||
openPeriod = (closeInfo as? ApproximateScheduledCloseInfo)?.openPeriod,
|
||||
closeDate = (closeInfo as? ExactScheduledCloseInfo)?.closeDate,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
@@ -5,6 +5,7 @@ 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.RawMessageEntity
|
||||
import dev.inmo.tgbotapi.types.message.SuggestedPostParameters
|
||||
import dev.inmo.tgbotapi.types.message.asTextSources
|
||||
import dev.inmo.tgbotapi.types.message.textsources.TextSource
|
||||
import dev.inmo.tgbotapi.types.message.toRawMessageEntities
|
||||
@@ -15,12 +16,14 @@ import dev.inmo.tgbotapi.types.polls.ScheduledCloseInfo
|
||||
import dev.inmo.tgbotapi.utils.EntitiesBuilder
|
||||
import dev.inmo.tgbotapi.utils.EntitiesBuilderBody
|
||||
import dev.inmo.tgbotapi.utils.extensions.makeSourceString
|
||||
import kotlinx.serialization.EncodeDefault
|
||||
import kotlinx.serialization.ExperimentalSerializationApi
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
import kotlinx.serialization.SerializationStrategy
|
||||
|
||||
@Serializable
|
||||
class SendRegularPoll private constructor(
|
||||
class SendRegularPoll constructor(
|
||||
@SerialName(chatIdField)
|
||||
override val chatId: ChatIdentifier,
|
||||
@SerialName(questionField)
|
||||
@@ -41,8 +44,14 @@ class SendRegularPoll private constructor(
|
||||
override val openPeriod: LongSeconds?= null,
|
||||
@SerialName(closeDateField)
|
||||
override val closeDate: LongSeconds? = null,
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
@SerialName(messageThreadIdField)
|
||||
@EncodeDefault
|
||||
override val threadId: MessageThreadId? = chatId.threadId,
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
@EncodeDefault
|
||||
@SerialName(directMessagesTopicIdField)
|
||||
override val directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(disableNotificationField)
|
||||
@@ -53,6 +62,8 @@ class SendRegularPoll private constructor(
|
||||
override val allowPaidBroadcast: Boolean = false,
|
||||
@SerialName(messageEffectIdField)
|
||||
override val effectId: EffectId? = null,
|
||||
@SerialName(suggestedPostParametersField)
|
||||
override val suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
@SerialName(replyParametersField)
|
||||
override val replyParameters: ReplyParameters? = null,
|
||||
@SerialName(replyMarkupField)
|
||||
@@ -71,11 +82,13 @@ class SendRegularPoll private constructor(
|
||||
openPeriod: LongSeconds?= null,
|
||||
closeDate: LongSeconds? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) : this(
|
||||
@@ -90,11 +103,13 @@ class SendRegularPoll private constructor(
|
||||
openPeriod = openPeriod,
|
||||
closeDate = closeDate,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -110,11 +125,13 @@ class SendRegularPoll private constructor(
|
||||
openPeriod: LongSeconds?= null,
|
||||
closeDate: LongSeconds? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) : this(
|
||||
@@ -129,11 +146,13 @@ class SendRegularPoll private constructor(
|
||||
openPeriod = openPeriod,
|
||||
closeDate = closeDate,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -158,11 +177,13 @@ fun SendRegularPoll(
|
||||
isClosed: Boolean = false,
|
||||
allowMultipleAnswers: Boolean = false,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = SendRegularPoll(
|
||||
@@ -176,11 +197,13 @@ fun SendRegularPoll(
|
||||
openPeriod = (closeInfo as? ApproximateScheduledCloseInfo) ?.openPeriod,
|
||||
closeDate = (closeInfo as? ExactScheduledCloseInfo) ?.closeDate,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -194,11 +217,13 @@ fun SendRegularPoll(
|
||||
isClosed: Boolean = false,
|
||||
allowMultipleAnswers: Boolean = false,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = SendRegularPoll(
|
||||
@@ -211,11 +236,13 @@ fun SendRegularPoll(
|
||||
openPeriod = (closeInfo as? ApproximateScheduledCloseInfo) ?.openPeriod,
|
||||
closeDate = (closeInfo as? ExactScheduledCloseInfo) ?.closeDate,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -228,11 +255,13 @@ fun SendRegularPoll(
|
||||
isClosed: Boolean = false,
|
||||
allowMultipleAnswers: Boolean = false,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null,
|
||||
builder: EntitiesBuilderBody
|
||||
@@ -245,11 +274,13 @@ fun SendRegularPoll(
|
||||
isClosed = isClosed,
|
||||
allowMultipleAnswers = allowMultipleAnswers,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -0,0 +1,36 @@
|
||||
package dev.inmo.tgbotapi.requests.suggested
|
||||
|
||||
import dev.inmo.tgbotapi.abstracts.types.ChatRequest
|
||||
import dev.inmo.tgbotapi.requests.abstracts.SimpleRequest
|
||||
import dev.inmo.tgbotapi.types.ChatIdentifierSerializer
|
||||
import dev.inmo.tgbotapi.types.IdChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.MessageId
|
||||
import dev.inmo.tgbotapi.types.TelegramDate
|
||||
import dev.inmo.tgbotapi.types.chatIdField
|
||||
import dev.inmo.tgbotapi.types.messageIdField
|
||||
import dev.inmo.tgbotapi.types.sendDateField
|
||||
import kotlinx.serialization.DeserializationStrategy
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
import kotlinx.serialization.SerializationStrategy
|
||||
import kotlinx.serialization.builtins.serializer
|
||||
|
||||
@Serializable
|
||||
data class ApproveSuggestedPost(
|
||||
@Suppress("SERIALIZER_TYPE_INCOMPATIBLE")
|
||||
@SerialName(chatIdField)
|
||||
@Serializable(ChatIdentifierSerializer::class)
|
||||
override val chatId: IdChatIdentifier,
|
||||
@SerialName(messageIdField)
|
||||
val messageId: MessageId,
|
||||
@SerialName(sendDateField)
|
||||
val sendDate: TelegramDate? = null,
|
||||
) : SimpleRequest<Boolean>, ChatRequest {
|
||||
override val requestSerializer: SerializationStrategy<ApproveSuggestedPost>
|
||||
get() = serializer()
|
||||
|
||||
override fun method(): String = "approveSuggestedPost"
|
||||
|
||||
override val resultDeserializer: DeserializationStrategy<Boolean>
|
||||
get() = Boolean.serializer()
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package dev.inmo.tgbotapi.requests.suggested
|
||||
|
||||
import dev.inmo.tgbotapi.abstracts.types.ChatRequest
|
||||
import dev.inmo.tgbotapi.requests.abstracts.SimpleRequest
|
||||
import dev.inmo.tgbotapi.types.ChatIdentifierSerializer
|
||||
import dev.inmo.tgbotapi.types.IdChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.MessageId
|
||||
import dev.inmo.tgbotapi.types.chatIdField
|
||||
import dev.inmo.tgbotapi.types.commentField
|
||||
import dev.inmo.tgbotapi.types.messageIdField
|
||||
import kotlinx.serialization.DeserializationStrategy
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
import kotlinx.serialization.SerializationStrategy
|
||||
import kotlinx.serialization.builtins.serializer
|
||||
|
||||
@Serializable
|
||||
data class DeclineSuggestedPost(
|
||||
@Suppress("SERIALIZER_TYPE_INCOMPATIBLE")
|
||||
@SerialName(chatIdField)
|
||||
@Serializable(ChatIdentifierSerializer::class)
|
||||
override val chatId: IdChatIdentifier,
|
||||
@SerialName(messageIdField)
|
||||
val messageId: MessageId,
|
||||
@SerialName(commentField)
|
||||
val comment: String? = null,
|
||||
) : SimpleRequest<Boolean>, ChatRequest {
|
||||
override val requestSerializer: SerializationStrategy<DeclineSuggestedPost>
|
||||
get() = serializer()
|
||||
|
||||
override fun method(): String = "declineSuggestedPost"
|
||||
|
||||
override val resultDeserializer: DeserializationStrategy<Boolean>
|
||||
get() = Boolean.serializer()
|
||||
}
|
||||
@@ -36,6 +36,8 @@ sealed interface IdChatIdentifier : ChatIdentifier {
|
||||
get() = null
|
||||
val businessConnectionId: BusinessConnectionId?
|
||||
get() = null
|
||||
val directMessageThreadId: DirectMessageThreadId?
|
||||
get() = null
|
||||
|
||||
companion object {
|
||||
operator fun invoke(chatId: RawChatId, threadId: MessageThreadId? = null, businessConnectionId: BusinessConnectionId? = null) = threadId ?.let {
|
||||
@@ -64,6 +66,18 @@ value class ChatIdWithThreadId(val chatIdWithThreadId: Pair<RawChatId, MessageTh
|
||||
|
||||
constructor(chatId: RawChatId, threadId: MessageThreadId): this(chatId to threadId)
|
||||
}
|
||||
|
||||
@Suppress("SERIALIZER_TYPE_INCOMPATIBLE")
|
||||
@Serializable(ChatIdentifierSerializer::class)
|
||||
@JvmInline
|
||||
value class ChatIdWithChannelDirectMessageThreadId(val chatIdWithThreadId: Pair<RawChatId, DirectMessageThreadId>) : IdChatIdentifier {
|
||||
override val chatId: RawChatId
|
||||
get() = chatIdWithThreadId.first
|
||||
override val directMessageThreadId: DirectMessageThreadId
|
||||
get() = chatIdWithThreadId.second
|
||||
|
||||
constructor(chatId: RawChatId, threadId: DirectMessageThreadId): this(chatId to threadId)
|
||||
}
|
||||
@Suppress("SERIALIZER_TYPE_INCOMPATIBLE")
|
||||
@Serializable(ChatIdentifierSerializer::class)
|
||||
@JvmInline
|
||||
@@ -79,16 +93,21 @@ value class BusinessChatId(val chatIdWithBusinessConnectionId: Pair<RawChatId, B
|
||||
val ChatIdentifier.threadId: MessageThreadId?
|
||||
get() = (this as? IdChatIdentifier) ?.threadId
|
||||
|
||||
val ChatIdentifier.directMessageThreadId: DirectMessageThreadId?
|
||||
get() = (this as? IdChatIdentifier) ?.directMessageThreadId
|
||||
|
||||
val ChatIdentifier.businessConnectionId: BusinessConnectionId?
|
||||
get() = (this as? IdChatIdentifier) ?.businessConnectionId
|
||||
|
||||
fun IdChatIdentifier.toChatId() = when (this) {
|
||||
is ChatId -> this
|
||||
is ChatIdWithThreadId -> ChatId(chatId)
|
||||
is ChatIdWithChannelDirectMessageThreadId -> ChatId(chatId)
|
||||
is BusinessChatId -> ChatId(chatId)
|
||||
}
|
||||
|
||||
fun IdChatIdentifier.toChatWithThreadId(threadId: MessageThreadId) = IdChatIdentifier(chatId, threadId)
|
||||
fun IdChatIdentifier.toChatIdWithChannelDirectMessageThreadId(threadId: DirectMessageThreadId) = ChatIdWithChannelDirectMessageThreadId(chatId, threadId)
|
||||
fun IdChatIdentifier.toBusinessChatId(businessConnectionId: BusinessConnectionId) = IdChatIdentifier(chatId, businessConnectionId)
|
||||
|
||||
/**
|
||||
@@ -221,11 +240,20 @@ object FullChatIdentifierSerializer : KSerializer<ChatIdentifier> {
|
||||
)
|
||||
}
|
||||
3 -> {
|
||||
val (chatId, _, businessConnectionId) = splitted
|
||||
BusinessChatId(
|
||||
chatId.toLongOrNull() ?.let(::RawChatId) ?: return@let null,
|
||||
businessConnectionId.let(::BusinessConnectionId)
|
||||
)
|
||||
val (chatId, intermediateDelimiter, additionalId) = splitted
|
||||
val additionalIdAsLong by lazy {
|
||||
additionalId.toLongOrNull()
|
||||
}
|
||||
when {
|
||||
intermediateDelimiter == "cdm" && additionalIdAsLong != null -> ChatIdWithChannelDirectMessageThreadId(
|
||||
chatId.toLongOrNull() ?.let(::RawChatId) ?: return@let null,
|
||||
additionalIdAsLong ?.let(::DirectMessageThreadId) ?: return@let null
|
||||
)
|
||||
else -> BusinessChatId(
|
||||
chatId.toLongOrNull() ?.let(::RawChatId) ?: return@let null,
|
||||
additionalId.let(::BusinessConnectionId)
|
||||
)
|
||||
}
|
||||
}
|
||||
else -> null
|
||||
}
|
||||
@@ -239,6 +267,7 @@ object FullChatIdentifierSerializer : KSerializer<ChatIdentifier> {
|
||||
is ChatId -> encoder.encodeLong(value.chatId.long)
|
||||
is ChatIdWithThreadId -> encoder.encodeString("${value.chatId}/${value.threadId}")
|
||||
is BusinessChatId -> encoder.encodeString("${value.chatId}//${value.businessConnectionId}")
|
||||
is ChatIdWithChannelDirectMessageThreadId -> encoder.encodeString("${value.chatId}/cdm/${value.directMessageThreadId}")
|
||||
is Username -> encoder.encodeString(value.full)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -141,6 +141,7 @@ const val giveawayMessageIdField = "giveaway_message_id"
|
||||
const val messageIdsField = "message_ids"
|
||||
const val actorChatField = "actor_chat"
|
||||
const val messageThreadIdField = "message_thread_id"
|
||||
const val directMessagesTopicIdField = "direct_messages_topic_id"
|
||||
const val mediaGroupIdField = "media_group_id"
|
||||
const val updateIdField = "update_id"
|
||||
const val fromChatIdField = "from_chat_id"
|
||||
@@ -148,6 +149,7 @@ const val disableWebPagePreviewField = "disable_web_page_preview"
|
||||
const val linkPreviewOptionsField = "link_preview_options"
|
||||
const val disableNotificationField = "disable_notification"
|
||||
const val protectContentField = "protect_content"
|
||||
const val suggestedPostParametersField = "suggested_post_parameters"
|
||||
const val allowPaidBroadcastField = "allow_paid_broadcast"
|
||||
const val messageEffectIdField = "message_effect_id"
|
||||
const val removeCaptionField = "remove_caption"
|
||||
@@ -158,6 +160,7 @@ const val quoteField = "quote"
|
||||
const val quoteParseModeField = "quote_parse_mode"
|
||||
const val quoteEntitiesField = "quote_entities"
|
||||
const val quotePositionField = "quote_position"
|
||||
const val checklistTaskIdField = "checklist_task_id"
|
||||
const val replyMarkupField = "reply_markup"
|
||||
const val disableContentTypeDetectionField = "disable_content_type_detection"
|
||||
const val supportStreamingField = "support_streaming"
|
||||
@@ -267,6 +270,7 @@ const val canManageTopicsField = "can_manage_topics"
|
||||
const val canPostStoriesField = "can_post_stories"
|
||||
const val canEditStoriesField = "can_edit_stories"
|
||||
const val canDeleteStoriesField = "can_delete_stories"
|
||||
const val canManageDirectMessagesField = "can_manage_direct_messages"
|
||||
const val captionEntitiesField = "caption_entities"
|
||||
const val hasSpoilerField = "has_spoiler"
|
||||
const val showCaptionAboveMediaField = "show_caption_above_media"
|
||||
@@ -290,6 +294,7 @@ const val canSendPaidMediaField = "can_send_paid_media"
|
||||
const val activeUsernamesField = "active_usernames"
|
||||
const val customTitleField = "custom_title"
|
||||
const val optionIdsField = "option_ids"
|
||||
const val parentChatField = "parent_chat"
|
||||
const val voterChatField = "voter_chat"
|
||||
const val ipAddressField = "ip_address"
|
||||
const val linkedChatIdField = "linked_chat_id"
|
||||
@@ -522,6 +527,7 @@ const val creatorField = "creator"
|
||||
const val subscriptionPeriodField = "subscription_period"
|
||||
const val subscriptionPriceField = "subscription_price"
|
||||
const val copyTextField = "copy_text"
|
||||
const val topicIdField = "topic_id"
|
||||
|
||||
const val isPublicField = "is_public"
|
||||
|
||||
@@ -534,6 +540,7 @@ const val convertStarCountField = "convert_star_count"
|
||||
const val prepaidUpgradeStarCountField = "prepaid_upgrade_star_count"
|
||||
const val canBeUpgradedField = "can_be_upgraded"
|
||||
const val isPrivateField = "is_private"
|
||||
const val isDirectMessagesField = "is_direct_messages"
|
||||
const val nextTransferDateField = "next_transfer_date"
|
||||
const val transferStarCountField = "transfer_star_count"
|
||||
const val lastResaleStarCountField = "last_resale_star_count"
|
||||
@@ -642,6 +649,7 @@ const val mainFrameTimestampField = "main_frame_timestamp"
|
||||
|
||||
const val paidMessageStarCountField = "paid_message_star_count"
|
||||
const val paidStarCountField = "paid_star_count"
|
||||
const val isPaidPostField = "is_paid_post"
|
||||
|
||||
const val disableEditMessageField = "disable_edit_message"
|
||||
const val scoreField = "score"
|
||||
@@ -720,6 +728,7 @@ const val starCountField = "star_count"
|
||||
const val upgradeStarCountField = "upgrade_star_count"
|
||||
const val payToUpgradeField = "pay_for_upgrade"
|
||||
const val paidMediaField = "paid_media"
|
||||
const val publisherChatField = "publisher_chat"
|
||||
|
||||
const val centerColorField = "center_color"
|
||||
const val edgeColorField = "edge_color"
|
||||
@@ -778,6 +787,13 @@ const val rawField = "raw"
|
||||
|
||||
const val reactionTypeField = "reaction_type"
|
||||
|
||||
const val suggestedPostMessageField = "suggested_post_message"
|
||||
const val priceField = "price"
|
||||
const val sendDateField = "send_date"
|
||||
const val commentField = "comment"
|
||||
const val reasonField = "reason"
|
||||
const val starAmountField = "star_amount"
|
||||
|
||||
const val isDarkField = "is_dark"
|
||||
const val isFlippedField = "is_flipped"
|
||||
const val temperatureField = "temperature"
|
||||
|
||||
@@ -8,33 +8,33 @@ import kotlinx.serialization.encoding.Decoder
|
||||
import kotlinx.serialization.encoding.Encoder
|
||||
|
||||
@Suppress("SERIALIZER_TYPE_INCOMPATIBLE")
|
||||
@Serializable(ChannelDirectMessagesConfigurationChanged.Companion::class)
|
||||
sealed interface ChannelDirectMessagesConfigurationChanged : ChannelEvent {
|
||||
@Serializable(DirectMessagesConfigurationChanged.Companion::class)
|
||||
sealed interface DirectMessagesConfigurationChanged : ChannelEvent {
|
||||
val enabled: Boolean
|
||||
val cost: Int?
|
||||
@Serializable(ChannelDirectMessagesConfigurationChanged.Companion::class)
|
||||
data object Disabled : ChannelDirectMessagesConfigurationChanged {
|
||||
@Serializable(DirectMessagesConfigurationChanged.Companion::class)
|
||||
data object Disabled : DirectMessagesConfigurationChanged {
|
||||
override val enabled: Boolean
|
||||
get() = false
|
||||
override val cost: Int?
|
||||
get() = null
|
||||
}
|
||||
@Serializable(ChannelDirectMessagesConfigurationChanged.Companion::class)
|
||||
data object Free : ChannelDirectMessagesConfigurationChanged {
|
||||
@Serializable(DirectMessagesConfigurationChanged.Companion::class)
|
||||
data object Free : DirectMessagesConfigurationChanged {
|
||||
override val enabled: Boolean
|
||||
get() = true
|
||||
override val cost: Int
|
||||
get() = 0
|
||||
}
|
||||
@Serializable(ChannelDirectMessagesConfigurationChanged.Companion::class)
|
||||
@Serializable(DirectMessagesConfigurationChanged.Companion::class)
|
||||
data class Paid(
|
||||
override val cost: Int
|
||||
) : ChannelDirectMessagesConfigurationChanged {
|
||||
) : DirectMessagesConfigurationChanged {
|
||||
override val enabled: Boolean
|
||||
get() = true
|
||||
}
|
||||
|
||||
companion object : KSerializer<ChannelDirectMessagesConfigurationChanged> {
|
||||
companion object : KSerializer<DirectMessagesConfigurationChanged> {
|
||||
@Serializable
|
||||
private data class RawDirectMessagePriceChanged(
|
||||
val are_direct_messages_enabled: Boolean = false,
|
||||
@@ -45,7 +45,7 @@ sealed interface ChannelDirectMessagesConfigurationChanged : ChannelEvent {
|
||||
|
||||
override fun serialize(
|
||||
encoder: Encoder,
|
||||
value: ChannelDirectMessagesConfigurationChanged
|
||||
value: DirectMessagesConfigurationChanged
|
||||
) {
|
||||
RawDirectMessagePriceChanged.serializer().serialize(
|
||||
encoder,
|
||||
@@ -56,7 +56,7 @@ sealed interface ChannelDirectMessagesConfigurationChanged : ChannelEvent {
|
||||
)
|
||||
}
|
||||
|
||||
override fun deserialize(decoder: Decoder): ChannelDirectMessagesConfigurationChanged {
|
||||
override fun deserialize(decoder: Decoder): DirectMessagesConfigurationChanged {
|
||||
val raw = RawDirectMessagePriceChanged.serializer().deserialize(decoder)
|
||||
|
||||
return when {
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package dev.inmo.tgbotapi.types
|
||||
|
||||
import kotlinx.serialization.Serializable
|
||||
import kotlin.jvm.JvmInline
|
||||
|
||||
@Serializable
|
||||
@JvmInline
|
||||
value class DirectMessageThreadId(
|
||||
val long: Long
|
||||
) {
|
||||
override fun toString(): String {
|
||||
return long.toString()
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,7 @@ package dev.inmo.tgbotapi.types
|
||||
import dev.inmo.tgbotapi.abstracts.SpoilerableData
|
||||
import dev.inmo.tgbotapi.types.chat.SuperPublicChat
|
||||
import dev.inmo.tgbotapi.types.checklists.Checklist
|
||||
import dev.inmo.tgbotapi.types.checklists.ChecklistTaskId
|
||||
import dev.inmo.tgbotapi.types.dice.Dice
|
||||
import dev.inmo.tgbotapi.types.files.*
|
||||
import dev.inmo.tgbotapi.types.games.RawGame
|
||||
@@ -28,9 +29,11 @@ import kotlinx.serialization.encoding.Encoder
|
||||
@ClassCastsIncluded
|
||||
sealed interface ReplyInfo {
|
||||
val messageMeta: Message.MetaInfo?
|
||||
val checklistTaskId: ChecklistTaskId?
|
||||
|
||||
data class Internal(
|
||||
val message: Message
|
||||
val message: Message,
|
||||
override val checklistTaskId: ChecklistTaskId? = null,
|
||||
): ReplyInfo {
|
||||
override val messageMeta: Message.MetaInfo
|
||||
get() = message.metaInfo
|
||||
@@ -42,6 +45,8 @@ sealed interface ReplyInfo {
|
||||
): ReplyInfo {
|
||||
override val messageMeta: Message.MetaInfo?
|
||||
get() = null
|
||||
override val checklistTaskId: ChecklistTaskId?
|
||||
get() = null
|
||||
}
|
||||
|
||||
@Serializable(External.Companion::class)
|
||||
@@ -57,7 +62,8 @@ sealed interface ReplyInfo {
|
||||
@Suppress("SERIALIZER_TYPE_INCOMPATIBLE")
|
||||
override val chat: SuperPublicChat?,
|
||||
override val messageMeta: Message.MetaInfo?,
|
||||
val linkPreviewOptions: LinkPreviewOptions?
|
||||
val linkPreviewOptions: LinkPreviewOptions?,
|
||||
override val checklistTaskId: ChecklistTaskId? = null,
|
||||
) : External
|
||||
|
||||
@Suppress("SERIALIZER_TYPE_INCOMPATIBLE")
|
||||
@@ -72,7 +78,8 @@ sealed interface ReplyInfo {
|
||||
@Suppress("SERIALIZER_TYPE_INCOMPATIBLE")
|
||||
override val chat: SuperPublicChat?,
|
||||
override val messageMeta: Message.MetaInfo?,
|
||||
override val content: ContentVariant
|
||||
override val content: ContentVariant,
|
||||
override val checklistTaskId: ChecklistTaskId? = null,
|
||||
) : Content
|
||||
|
||||
@Serializable
|
||||
@@ -82,7 +89,8 @@ sealed interface ReplyInfo {
|
||||
override val chat: SuperPublicChat?,
|
||||
override val messageMeta: Message.MetaInfo?,
|
||||
override val spoilered: Boolean,
|
||||
override val content: MediaContentVariant
|
||||
override val content: MediaContentVariant,
|
||||
override val checklistTaskId: ChecklistTaskId? = null,
|
||||
) : Content, SpoilerableData
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package dev.inmo.tgbotapi.types
|
||||
|
||||
import dev.inmo.tgbotapi.abstracts.TextedInput
|
||||
import dev.inmo.tgbotapi.abstracts.WithMessageId
|
||||
import dev.inmo.tgbotapi.types.checklists.ChecklistTaskId
|
||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||
import dev.inmo.tgbotapi.types.message.RawMessageEntity
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
||||
@@ -29,7 +30,9 @@ data class ReplyParameters internal constructor(
|
||||
@SerialName(quoteEntitiesField)
|
||||
private val quoteEntities: List<RawMessageEntity>? = null,
|
||||
@SerialName(quotePositionField)
|
||||
val quotePosition: Int?
|
||||
val quotePosition: Int? = null,
|
||||
@SerialName(checklistTaskIdField)
|
||||
val checklistTaskId: ChecklistTaskId? = null
|
||||
) : WithMessageId, TextedInput {
|
||||
override val text: String?
|
||||
get() = quote
|
||||
@@ -42,7 +45,8 @@ data class ReplyParameters internal constructor(
|
||||
messageId: MessageId,
|
||||
entities: TextSourcesList,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
quotePosition: Int? = null
|
||||
quotePosition: Int? = null,
|
||||
checklistTaskId: ChecklistTaskId? = null,
|
||||
) : this(
|
||||
chatIdentifier,
|
||||
messageId,
|
||||
@@ -50,30 +54,35 @@ data class ReplyParameters internal constructor(
|
||||
entities.makeSourceString(),
|
||||
null,
|
||||
entities.toRawMessageEntities(),
|
||||
quotePosition
|
||||
quotePosition,
|
||||
checklistTaskId
|
||||
)
|
||||
constructor(
|
||||
metaInfo: Message.MetaInfo,
|
||||
entities: TextSourcesList,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
quotePosition: Int? = null
|
||||
quotePosition: Int? = null,
|
||||
checklistTaskId: ChecklistTaskId? = null,
|
||||
) : this(
|
||||
metaInfo.chatId,
|
||||
metaInfo.messageId,
|
||||
entities,
|
||||
allowSendingWithoutReply,
|
||||
quotePosition
|
||||
quotePosition,
|
||||
checklistTaskId
|
||||
)
|
||||
constructor(
|
||||
message: Message,
|
||||
entities: TextSourcesList,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
quotePosition: Int? = null
|
||||
quotePosition: Int? = null,
|
||||
checklistTaskId: ChecklistTaskId? = null,
|
||||
) : this(
|
||||
message.metaInfo,
|
||||
entities,
|
||||
allowSendingWithoutReply,
|
||||
quotePosition
|
||||
quotePosition,
|
||||
checklistTaskId
|
||||
)
|
||||
constructor(
|
||||
chatIdentifier: ChatIdentifier,
|
||||
@@ -81,7 +90,8 @@ data class ReplyParameters internal constructor(
|
||||
quote: String,
|
||||
quoteParseMode: ParseMode,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
quotePosition: Int? = null
|
||||
quotePosition: Int? = null,
|
||||
checklistTaskId: ChecklistTaskId? = null,
|
||||
) : this(
|
||||
chatIdentifier,
|
||||
messageId,
|
||||
@@ -89,40 +99,46 @@ data class ReplyParameters internal constructor(
|
||||
quote,
|
||||
quoteParseMode,
|
||||
null,
|
||||
quotePosition
|
||||
quotePosition,
|
||||
checklistTaskId
|
||||
)
|
||||
constructor(
|
||||
metaInfo: Message.MetaInfo,
|
||||
quote: String,
|
||||
quoteParseMode: ParseMode,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
quotePosition: Int? = null
|
||||
quotePosition: Int? = null,
|
||||
checklistTaskId: ChecklistTaskId? = null,
|
||||
) : this(
|
||||
metaInfo.chatId,
|
||||
metaInfo.messageId,
|
||||
quote,
|
||||
quoteParseMode,
|
||||
allowSendingWithoutReply,
|
||||
quotePosition
|
||||
quotePosition,
|
||||
checklistTaskId
|
||||
)
|
||||
constructor(
|
||||
message: Message,
|
||||
quote: String,
|
||||
quoteParseMode: ParseMode,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
quotePosition: Int? = null
|
||||
quotePosition: Int? = null,
|
||||
checklistTaskId: ChecklistTaskId? = null,
|
||||
) : this(
|
||||
message.metaInfo,
|
||||
quote,
|
||||
quoteParseMode,
|
||||
allowSendingWithoutReply,
|
||||
quotePosition
|
||||
quotePosition,
|
||||
checklistTaskId
|
||||
)
|
||||
constructor(
|
||||
chatIdentifier: ChatIdentifier,
|
||||
messageId: MessageId,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
quotePosition: Int? = null
|
||||
quotePosition: Int? = null,
|
||||
checklistTaskId: ChecklistTaskId? = null,
|
||||
) : this(
|
||||
chatIdentifier,
|
||||
messageId,
|
||||
@@ -130,25 +146,30 @@ data class ReplyParameters internal constructor(
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
quotePosition
|
||||
quotePosition,
|
||||
checklistTaskId
|
||||
)
|
||||
constructor(
|
||||
metaInfo: Message.MetaInfo,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
quotePosition: Int? = null
|
||||
quotePosition: Int? = null,
|
||||
checklistTaskId: ChecklistTaskId? = null,
|
||||
) : this(
|
||||
metaInfo.chatId,
|
||||
metaInfo.messageId,
|
||||
allowSendingWithoutReply,
|
||||
quotePosition
|
||||
quotePosition,
|
||||
checklistTaskId
|
||||
)
|
||||
constructor(
|
||||
message: Message,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
quotePosition: Int? = null
|
||||
quotePosition: Int? = null,
|
||||
checklistTaskId: ChecklistTaskId? = null,
|
||||
) : this(
|
||||
message.metaInfo,
|
||||
allowSendingWithoutReply,
|
||||
quotePosition
|
||||
quotePosition,
|
||||
checklistTaskId
|
||||
)
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user