mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2025-11-17 12:30:20 +00:00
Compare commits
84 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d3d8603c35 | |||
| 759650892c | |||
| b58550a9ec | |||
| e15817e7c5 | |||
| 4cd1316e27 | |||
| 3575a62f34 | |||
| 82f7d5bd4f | |||
| 7a5e6a69a1 | |||
| fd25db5633 | |||
| f539a24740 | |||
| 1d7b4ea862 | |||
| 2d6f296c20 | |||
| 0ba1aa1127 | |||
| ae8a461e9d | |||
| 99f16e33a6 | |||
| e029b29f7f | |||
| c04f795fdd | |||
| b873898100 | |||
| 61ac9df5e3 | |||
| b1931900e7 | |||
| fab3af48d6 | |||
| 8d7563b6e4 | |||
| 05112afe0c | |||
| 9ea06de27c | |||
| fff05a40d9 | |||
| 5c6428f220 | |||
| 766b7ca205 | |||
| 41e6c52369 | |||
| 06013f624f | |||
| d8bba89f3f | |||
| 141281f96d | |||
| be7aaa7845 | |||
| 78c224ffa8 | |||
| a08d07f7b3 | |||
| 69dde19543 | |||
| e8a3b93831 | |||
| e10caa3171 | |||
| d4fe4e09fc | |||
| ad453afba2 | |||
| a0daca28b1 | |||
| cd62a9ef3c | |||
| 3c084d70e5 | |||
| 2611d4ecc1 | |||
| b4d853dfa0 | |||
| 5044075adf | |||
| 5f2660b804 | |||
| c72dccc0f9 | |||
| 3fc1058491 | |||
| c3668e978b | |||
| 5a4a6d5710 | |||
| ed1d8beb2e | |||
| 881ede7d2a | |||
| 60d3d279e7 | |||
| 4b84518dbb | |||
| 8b451791dd | |||
| 771fb5c288 | |||
| d19ee74f8b | |||
| aaf489c2ed | |||
| 1b06b63703 | |||
| bf7fc25285 | |||
| 4df242747f | |||
| e831ca143e | |||
| 44838a2088 | |||
| 3823b03453 | |||
| ec48708195 | |||
| 6a06775bc4 | |||
| bbdff0b31a | |||
| cb4880bd00 | |||
| a18eda3db6 | |||
| d8f6429385 | |||
| be74249b67 | |||
| 69f658e4a8 | |||
| 8c51ca9d72 | |||
| 48c4a3156b | |||
| 92407c9010 | |||
| 86937cc096 | |||
| ea614b790b | |||
| c994332cb9 | |||
| 9d893ffa48 | |||
| 57d2fe85c5 | |||
| c68b148d5e | |||
| 0a0a7cea0e | |||
| ea981605f6 | |||
| fe1e65a83c |
88
CHANGELOG.md
88
CHANGELOG.md
@@ -1,5 +1,93 @@
|
|||||||
# TelegramBotAPI changelog
|
# TelegramBotAPI changelog
|
||||||
|
|
||||||
|
## 3.2.3
|
||||||
|
|
||||||
|
* `Core`:
|
||||||
|
* Fixes in `DeleteMyCommands`
|
||||||
|
|
||||||
|
## 3.2.2
|
||||||
|
|
||||||
|
* `Versions`:
|
||||||
|
* `MicroUtils`: `0.12.10` -> `0.12.13`
|
||||||
|
* `Core`:
|
||||||
|
* `MessageIdentifier` has been renamed to `MessageId`
|
||||||
|
* `API`:
|
||||||
|
* New `reply`'es with chats and message ids
|
||||||
|
|
||||||
|
## 3.2.1
|
||||||
|
|
||||||
|
* `Versions`:
|
||||||
|
* `Ktor`: `2.1.0` -> `2.1.1`
|
||||||
|
* `Korlibs`: `3.0.0` -> `3.1.0`
|
||||||
|
* `MicroUtils`: `0.12.4` -> `0.12.10`
|
||||||
|
|
||||||
|
## 3.2.0
|
||||||
|
|
||||||
|
**Since this update, `RequestsExecutor#execute` may throw only `BotException`. In case you wish to handle some exceptions from `execute` you must catch `BotException` and handle its `cause`**
|
||||||
|
|
||||||
|
* `Versions`:
|
||||||
|
* `Serialization`: `1.4.0-RC` -> `1.4.0`
|
||||||
|
* `MicroUtils`: `0.12.1` -> `0.12.4`
|
||||||
|
* `Core`:
|
||||||
|
* `SetWebhook#allowedUpdates` now is `ALL_UPDATES_LIST` by default instead of `null`
|
||||||
|
* `API`:
|
||||||
|
* Extension `TelegramBot#setWebhook` parameter `allowedUpdates` now is `ALL_UPDATES_LIST` by default instead of `null`
|
||||||
|
* `Utils`:
|
||||||
|
* All related to long polling extensions parameters `allowedUpdates` now are `ALL_UPDATES_LIST` by default instead of `null`
|
||||||
|
|
||||||
|
## 3.1.1
|
||||||
|
|
||||||
|
* `Common`:
|
||||||
|
* Complete Bot API 6.2 implementation
|
||||||
|
|
||||||
|
## 3.1.0
|
||||||
|
|
||||||
|
**This update contains including of Bot API 6.2**
|
||||||
|
|
||||||
|
* `Versions`:
|
||||||
|
* `Ktor`: `2.0.3` -> `2.1.0`
|
||||||
|
* `MicroUtils`: `0.12.0` -> `0.12.1`
|
||||||
|
* `Core`:
|
||||||
|
* Add support of `custom emoji`s
|
||||||
|
* Add support of `sticker_type`
|
||||||
|
|
||||||
|
## 3.0.2
|
||||||
|
|
||||||
|
**ALL OLD DEPRECATIONS HAVE BEEN REMOVED**
|
||||||
|
|
||||||
|
**`copyMessage` HAVE CHANGED THEIR SIGNATURE BY SWAPPING FROM AND TO CHAT IDS**
|
||||||
|
|
||||||
|
* `Versions`:
|
||||||
|
* `Kotlin`: `1.6.21` -> `1.7.10`
|
||||||
|
* `Serialization`: `1.3.3` -> `1.4.0-RC`
|
||||||
|
* `Korlibs`: `2.7.0` -> `3.0.0`
|
||||||
|
* `UUID`: `0.4.1` -> `0.5.0`
|
||||||
|
* `MicroUtils`: `0.11.13` -> `0.12.0`
|
||||||
|
* `Core`:
|
||||||
|
* Interface `ReplyMakrup` has been renamed to `WithReplyMarkup` to correspond its purpose
|
||||||
|
* Data class `LeftChatMember` has been renamed to `LeftChatMemberEvent` to avoid type ambiguite with the other `LeftChatMember`
|
||||||
|
* `ForwardInfo` hierarchy has been fully reworked:
|
||||||
|
* `AnonymousForwardInfo` -> `ForwardInfo.ByAnonymous`
|
||||||
|
* `UserForwardInfo` -> `ForwardInfo.ByUser`
|
||||||
|
* `ForwardFromPublicChatInfo` -> `ForwardInfo.PublicChat`
|
||||||
|
* `ForwardFromChannelInfo` -> `ForwardInfo.PublicChat.FromChannel`
|
||||||
|
* `ForwardFromSupergroupInfo` -> `ForwardInfo.PublicChat.FromSupergroup`
|
||||||
|
* `ForwardInfo.PublicChat.SentByChannel` ___has been created___
|
||||||
|
* `API`:
|
||||||
|
* Add new `Flow`-based live locations API
|
||||||
|
* Add `sendLocation` for sending live locations
|
||||||
|
* `Utils`:
|
||||||
|
* **BREAKING CHANGES** Now all new classcasts (like `Chat.ifPrivateChat` etc.) have been rewritten to be generated with `ksp` and `kotlin poet`
|
||||||
|
|
||||||
|
*Note: Versions 3.0.0 and 3.0.1 have been published with errors and didn't recommend to use*
|
||||||
|
|
||||||
|
## 2.2.2
|
||||||
|
|
||||||
|
* `Utils`:
|
||||||
|
* `buildEntities` now is inline
|
||||||
|
* `Behaviour Builder`:
|
||||||
|
* Fixes in `CallbackQuery` triggers
|
||||||
|
|
||||||
## 2.2.1
|
## 2.2.1
|
||||||
|
|
||||||
* `Versions`:
|
* `Versions`:
|
||||||
|
|||||||
20
README.md
20
README.md
@@ -1,9 +1,17 @@
|
|||||||
# TelegramBotAPI [](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi) [](https://core.telegram.org/bots/api-changelog#june-20-2022)
|
# TelegramBotAPI [](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi) [](https://core.telegram.org/bots/api-changelog#august-12-2022)
|
||||||
|
|
||||||
| [](https://github.com/KotlinBy/awesome-kotlin) [](https://github.com/InsanusMokrassar/TelegramBotAPI/actions) [](https://docs.google.com/forms/d/e/1FAIpQLSctdJHT_aEniyYT0-IUAEfo1hsIlezX2owlkEAYX4KPl2V2_A/viewform?usp=sf_link) [](https://t.me/InMoTelegramBotAPI) |
|
| Docs | [](https://tgbotapi.inmo.dev/index.html) [](https://bookstack.inmo.dev/books/telegrambotapi/chapter/introduction-tutorial) |
|
||||||
|:---:|
|
|:---:|:---:|
|
||||||
| [](https://github.com/InsanusMokrassar/TelegramBotAPI-bot_template/generate) [](https://github.com/InsanusMokrassar/TelegramBotAPI-examples/) [](https://tgbotapi.inmo.dev/index.html) [](https://bookstack.inmo.dev/books/telegrambotapi/chapter/introduction-tutorial) |
|
| Useful repos | [](https://github.com/InsanusMokrassar/TelegramBotAPI-bot_template/generate) [](https://github.com/InsanusMokrassar/TelegramBotAPI-examples/) |
|
||||||
| [](https://t.me/InMoTelegramBotAPI) |
|
| Misc | [](https://github.com/KotlinBy/awesome-kotlin) [](https://docs.google.com/forms/d/e/1FAIpQLSctdJHT_aEniyYT0-IUAEfo1hsIlezX2owlkEAYX4KPl2V2_A/viewform?usp=sf_link) |
|
||||||
|
|
||||||
|
<!--- [](https://t.me/InMoTelegramBotAPI) --->
|
||||||
|
|
||||||
|
<p align="center">
|
||||||
|
<a href="https://t.me/InMoTelegramBotAPI">
|
||||||
|
<img src="./resources/tg_channel_qr.jpg">
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
Hello! This is a set of libraries for working with Telegram Bot API.
|
Hello! This is a set of libraries for working with Telegram Bot API.
|
||||||
|
|
||||||
@@ -108,5 +116,5 @@ suspend fun main() {
|
|||||||
### More examples
|
### More examples
|
||||||
|
|
||||||
You may find examples in [this project](https://github.com/InsanusMokrassar/TelegramBotAPI-examples). Besides, you are
|
You may find examples in [this project](https://github.com/InsanusMokrassar/TelegramBotAPI-examples). Besides, you are
|
||||||
always welcome in our [wiki](https://github.com/InsanusMokrassar/TelegramBotAPI/wiki/About-this-project) and
|
always welcome in our [bookstack](https://bookstack.inmo.dev/books/telegrambotapi) and
|
||||||
[chat](https://t.me/InMoTelegramBotAPIChat).
|
[chat](https://t.me/InMoTelegramBotAPIChat).
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ buildscript {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath libs.kotlin.gradle.plugin
|
classpath libs.kotlin.gradle.plugin
|
||||||
|
classpath libs.kotlin.ksp.plugin
|
||||||
classpath libs.kotlin.serialization.plugin
|
classpath libs.kotlin.serialization.plugin
|
||||||
classpath libs.kotlin.dokka.plugin
|
classpath libs.kotlin.dokka.plugin
|
||||||
classpath libs.github.release.plugin
|
classpath libs.github.release.plugin
|
||||||
|
|||||||
@@ -30,12 +30,13 @@ kotlin {
|
|||||||
|
|
||||||
private List<SourceDirectorySet> findSourcesWithName(String... approximateNames) {
|
private List<SourceDirectorySet> findSourcesWithName(String... approximateNames) {
|
||||||
return parent.subprojects
|
return parent.subprojects
|
||||||
.findAll { it != project }
|
.findAll { it != project && it.hasProperty("kotlin") }
|
||||||
.collectMany { it.kotlin.sourceSets }
|
.collectMany { it.kotlin.sourceSets }
|
||||||
.findAll { sourceSet -> approximateNames.any {
|
.findAll { sourceSet ->
|
||||||
nameToFilter -> sourceSet.name.contains(nameToFilter)
|
approximateNames.any { nameToFilter ->
|
||||||
}
|
sourceSet.name.contains(nameToFilter)
|
||||||
}.collect { it.kotlin }
|
}
|
||||||
|
}.collect { it.kotlin }
|
||||||
}
|
}
|
||||||
|
|
||||||
Object callback = {
|
Object callback = {
|
||||||
|
|||||||
@@ -6,4 +6,4 @@ kotlin.incremental=true
|
|||||||
kotlin.incremental.js=true
|
kotlin.incremental.js=true
|
||||||
|
|
||||||
library_group=dev.inmo
|
library_group=dev.inmo
|
||||||
library_version=2.2.1
|
library_version=3.2.3
|
||||||
|
|||||||
@@ -1,17 +1,19 @@
|
|||||||
[versions]
|
[versions]
|
||||||
|
|
||||||
kotlin = "1.6.21"
|
kotlin = "1.7.10"
|
||||||
kotlin-serialization = "1.3.3"
|
kotlin-serialization = "1.4.0"
|
||||||
kotlin-coroutines = "1.6.4"
|
kotlin-coroutines = "1.6.4"
|
||||||
kotlin-gradle-plugin = "7.0.4"
|
|
||||||
|
|
||||||
javax-activation = "1.1.1"
|
javax-activation = "1.1.1"
|
||||||
|
|
||||||
korlibs = "2.7.0"
|
korlibs = "3.1.0"
|
||||||
uuid = "0.4.1"
|
uuid = "0.5.0"
|
||||||
ktor = "2.0.3"
|
ktor = "2.1.1"
|
||||||
|
|
||||||
microutils = "0.11.13"
|
ksp = "1.7.10-1.0.6"
|
||||||
|
kotlin-poet = "1.12.0"
|
||||||
|
|
||||||
|
microutils = "0.12.13"
|
||||||
|
|
||||||
github-release-plugin = "2.4.1"
|
github-release-plugin = "2.4.1"
|
||||||
|
|
||||||
@@ -46,14 +48,21 @@ microutils-languageCodes = { module = "dev.inmo:micro_utils.language_codes", ver
|
|||||||
microutils-ktor-common = { module = "dev.inmo:micro_utils.ktor.common", version.ref = "microutils" }
|
microutils-ktor-common = { module = "dev.inmo:micro_utils.ktor.common", version.ref = "microutils" }
|
||||||
microutils-fsm-common = { module = "dev.inmo:micro_utils.fsm.common", version.ref = "microutils" }
|
microutils-fsm-common = { module = "dev.inmo:micro_utils.fsm.common", version.ref = "microutils" }
|
||||||
|
|
||||||
|
# ksp dependencies
|
||||||
|
|
||||||
|
kotlin-poet = { module = "com.squareup:kotlinpoet-ksp", version.ref = "kotlin-poet" }
|
||||||
|
ksp = { module = "com.google.devtools.ksp:symbol-processing-api", version.ref = "ksp" }
|
||||||
|
|
||||||
# buildscript classpaths
|
# buildscript classpaths
|
||||||
|
|
||||||
kotlin-gradle-plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
|
kotlin-gradle-plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
|
||||||
|
kotlin-ksp-plugin = { module = "com.google.devtools.ksp:symbol-processing-gradle-plugin", version.ref = "ksp" }
|
||||||
kotlin-serialization-plugin = { module = "org.jetbrains.kotlin:kotlin-serialization", version.ref = "kotlin" }
|
kotlin-serialization-plugin = { module = "org.jetbrains.kotlin:kotlin-serialization", version.ref = "kotlin" }
|
||||||
kotlin-dokka-plugin = { module = "org.jetbrains.dokka:dokka-gradle-plugin", version.ref = "kotlin" }
|
kotlin-dokka-plugin = { module = "org.jetbrains.dokka:dokka-gradle-plugin", version.ref = "kotlin" }
|
||||||
github-release-plugin = { module = "com.github.breadmoirai:github-release", version.ref = "github-release-plugin" }
|
github-release-plugin = { module = "com.github.breadmoirai:github-release", version.ref = "github-release-plugin" }
|
||||||
|
|
||||||
[plugins]
|
[plugins]
|
||||||
|
|
||||||
|
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
|
||||||
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
|
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
|
||||||
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
|
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
|
||||||
|
|||||||
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
|
|||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ pluginManagement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
include ":tgbotapi.core"
|
include ":tgbotapi.core"
|
||||||
|
include ":tgbotapi.ksp"
|
||||||
include ":tgbotapi.api"
|
include ":tgbotapi.api"
|
||||||
include ":tgbotapi.utils"
|
include ":tgbotapi.utils"
|
||||||
include ":tgbotapi.behaviour_builder"
|
include ":tgbotapi.behaviour_builder"
|
||||||
|
|||||||
@@ -3,20 +3,20 @@ package dev.inmo.tgbotapi.extensions.api
|
|||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.DeleteMessage
|
import dev.inmo.tgbotapi.requests.DeleteMessage
|
||||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||||
import dev.inmo.tgbotapi.types.MessageIdentifier
|
import dev.inmo.tgbotapi.types.MessageId
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
||||||
|
|
||||||
suspend fun TelegramBot.deleteMessage(
|
suspend fun TelegramBot.deleteMessage(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageId: MessageIdentifier
|
messageId: MessageId
|
||||||
) = execute(
|
) = execute(
|
||||||
DeleteMessage(chatId, messageId)
|
DeleteMessage(chatId, messageId)
|
||||||
)
|
)
|
||||||
|
|
||||||
suspend fun TelegramBot.deleteMessage(
|
suspend fun TelegramBot.deleteMessage(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
messageId: MessageIdentifier
|
messageId: MessageId
|
||||||
) = deleteMessage(chat.id, messageId)
|
) = deleteMessage(chat.id, messageId)
|
||||||
|
|
||||||
suspend fun TelegramBot.deleteMessage(
|
suspend fun TelegramBot.deleteMessage(
|
||||||
@@ -25,12 +25,12 @@ suspend fun TelegramBot.deleteMessage(
|
|||||||
|
|
||||||
suspend fun TelegramBot.delete(
|
suspend fun TelegramBot.delete(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageId: MessageIdentifier
|
messageId: MessageId
|
||||||
) = deleteMessage(chatId, messageId)
|
) = deleteMessage(chatId, messageId)
|
||||||
|
|
||||||
suspend fun TelegramBot.delete(
|
suspend fun TelegramBot.delete(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
messageId: MessageIdentifier
|
messageId: MessageId
|
||||||
) = deleteMessage(chat, messageId)
|
) = deleteMessage(chat, messageId)
|
||||||
|
|
||||||
suspend fun TelegramBot.delete(
|
suspend fun TelegramBot.delete(
|
||||||
|
|||||||
@@ -3,14 +3,14 @@ package dev.inmo.tgbotapi.extensions.api
|
|||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.ForwardMessage
|
import dev.inmo.tgbotapi.requests.ForwardMessage
|
||||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||||
import dev.inmo.tgbotapi.types.MessageIdentifier
|
import dev.inmo.tgbotapi.types.MessageId
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
||||||
|
|
||||||
suspend fun TelegramBot.forwardMessage(
|
suspend fun TelegramBot.forwardMessage(
|
||||||
fromChatId: ChatIdentifier,
|
fromChatId: ChatIdentifier,
|
||||||
toChatId: ChatIdentifier,
|
toChatId: ChatIdentifier,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false
|
protectContent: Boolean = false
|
||||||
) = execute(
|
) = execute(
|
||||||
@@ -20,7 +20,7 @@ suspend fun TelegramBot.forwardMessage(
|
|||||||
suspend fun TelegramBot.forwardMessage(
|
suspend fun TelegramBot.forwardMessage(
|
||||||
fromChat: Chat,
|
fromChat: Chat,
|
||||||
toChatId: ChatIdentifier,
|
toChatId: ChatIdentifier,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false
|
protectContent: Boolean = false
|
||||||
) = forwardMessage(fromChat.id, toChatId, messageId, disableNotification, protectContent)
|
) = forwardMessage(fromChat.id, toChatId, messageId, disableNotification, protectContent)
|
||||||
@@ -28,7 +28,7 @@ suspend fun TelegramBot.forwardMessage(
|
|||||||
suspend fun TelegramBot.forwardMessage(
|
suspend fun TelegramBot.forwardMessage(
|
||||||
fromChatId: ChatIdentifier,
|
fromChatId: ChatIdentifier,
|
||||||
toChat: Chat,
|
toChat: Chat,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false
|
protectContent: Boolean = false
|
||||||
) = forwardMessage(fromChatId, toChat.id, messageId, disableNotification, protectContent)
|
) = forwardMessage(fromChatId, toChat.id, messageId, disableNotification, protectContent)
|
||||||
@@ -36,7 +36,7 @@ suspend fun TelegramBot.forwardMessage(
|
|||||||
suspend fun TelegramBot.forwardMessage(
|
suspend fun TelegramBot.forwardMessage(
|
||||||
fromChat: Chat,
|
fromChat: Chat,
|
||||||
toChat: Chat,
|
toChat: Chat,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false
|
protectContent: Boolean = false
|
||||||
) = forwardMessage(fromChat.id, toChat.id, messageId, disableNotification, protectContent)
|
) = forwardMessage(fromChat.id, toChat.id, messageId, disableNotification, protectContent)
|
||||||
|
|||||||
@@ -0,0 +1,151 @@
|
|||||||
|
package dev.inmo.tgbotapi.extensions.api
|
||||||
|
|
||||||
|
import dev.inmo.micro_utils.coroutines.LinkedSupervisorJob
|
||||||
|
import dev.inmo.micro_utils.coroutines.launchSafelyWithoutExceptions
|
||||||
|
import dev.inmo.tgbotapi.abstracts.*
|
||||||
|
import dev.inmo.tgbotapi.abstracts.types.WithReplyMarkup
|
||||||
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
|
import dev.inmo.tgbotapi.extensions.api.edit.location.live.editLiveLocation
|
||||||
|
import dev.inmo.tgbotapi.extensions.api.send.sendLiveLocation
|
||||||
|
import dev.inmo.tgbotapi.types.*
|
||||||
|
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.abstracts.ContentMessage
|
||||||
|
import dev.inmo.tgbotapi.types.message.content.LocationContent
|
||||||
|
import kotlinx.coroutines.*
|
||||||
|
import kotlinx.coroutines.flow.Flow
|
||||||
|
import kotlinx.coroutines.flow.map
|
||||||
|
import kotlinx.serialization.Serializable
|
||||||
|
import kotlin.js.JsName
|
||||||
|
import kotlin.jvm.JvmName
|
||||||
|
import kotlin.math.ceil
|
||||||
|
|
||||||
|
@Serializable
|
||||||
|
data class EditLiveLocationInfo(
|
||||||
|
override val latitude: Double,
|
||||||
|
override val longitude: Double,
|
||||||
|
override val horizontalAccuracy: Meters? = null,
|
||||||
|
override val heading: Degrees? = null,
|
||||||
|
override val proximityAlertRadius: Meters? = null,
|
||||||
|
override val replyMarkup: InlineKeyboardMarkup? = null
|
||||||
|
) : Locationed, HorizontallyAccured, ProximityAlertable, Headed, WithReplyMarkup
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Will [sendLiveLocation] with the first [EditLiveLocationInfo] data and update than. Each [liveTimeMillis] passing,
|
||||||
|
* the message will be sent again and new edits will be applied to the new message
|
||||||
|
*/
|
||||||
|
suspend fun TelegramBot.handleLiveLocation(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
locationsFlow: Flow<EditLiveLocationInfo>,
|
||||||
|
liveTimeMillis: Long = defaultLivePeriodDelayMillis,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null
|
||||||
|
) {
|
||||||
|
var currentLiveLocationMessage: ContentMessage<LocationContent>? = null
|
||||||
|
val updateMessageJob = CoroutineScope(currentCoroutineContext().LinkedSupervisorJob()).launchSafelyWithoutExceptions(start = CoroutineStart.LAZY) {
|
||||||
|
while (isActive) {
|
||||||
|
delay(liveTimeMillis)
|
||||||
|
// Remove previous location message info to resend live location message
|
||||||
|
currentLiveLocationMessage = null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
locationsFlow.collect {
|
||||||
|
val capturedLiveLocationMessage = currentLiveLocationMessage
|
||||||
|
if (capturedLiveLocationMessage == null) {
|
||||||
|
updateMessageJob.start()
|
||||||
|
currentLiveLocationMessage = sendLiveLocation(
|
||||||
|
chatId,
|
||||||
|
it.latitude,
|
||||||
|
it.longitude,
|
||||||
|
ceil(liveTimeMillis.toDouble() / 1000).toInt(),
|
||||||
|
it.horizontalAccuracy,
|
||||||
|
it.heading,
|
||||||
|
it.proximityAlertRadius,
|
||||||
|
disableNotification,
|
||||||
|
protectContent,
|
||||||
|
replyToMessageId,
|
||||||
|
allowSendingWithoutReply,
|
||||||
|
it.replyMarkup
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
editLiveLocation(
|
||||||
|
capturedLiveLocationMessage,
|
||||||
|
it.latitude,
|
||||||
|
it.longitude,
|
||||||
|
it.horizontalAccuracy,
|
||||||
|
it.heading,
|
||||||
|
it.proximityAlertRadius,
|
||||||
|
it.replyMarkup
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Will apply [Flow.map] to the [locationsFlow] to create [EditLiveLocationInfo] and pass the result flow to the
|
||||||
|
* [handleLiveLocation] with [Flow] typed by [EditLiveLocationInfo]
|
||||||
|
*/
|
||||||
|
@JvmName("handleLiveLocationWithLocation")
|
||||||
|
@JsName("handleLiveLocationWithLocation")
|
||||||
|
suspend fun TelegramBot.handleLiveLocation(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
locationsFlow: Flow<Location>,
|
||||||
|
liveTimeMillis: Long = defaultLivePeriodDelayMillis,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null
|
||||||
|
) {
|
||||||
|
handleLiveLocation(
|
||||||
|
chatId,
|
||||||
|
locationsFlow.map {
|
||||||
|
EditLiveLocationInfo(
|
||||||
|
it.latitude,
|
||||||
|
it.longitude,
|
||||||
|
it.horizontalAccuracy,
|
||||||
|
(it as? LiveLocation) ?.heading,
|
||||||
|
(it as? LiveLocation) ?.proximityAlertRadius,
|
||||||
|
(it as? WithReplyMarkup) ?.replyMarkup as? InlineKeyboardMarkup
|
||||||
|
)
|
||||||
|
},
|
||||||
|
liveTimeMillis,
|
||||||
|
disableNotification,
|
||||||
|
protectContent,
|
||||||
|
replyToMessageId,
|
||||||
|
allowSendingWithoutReply
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Will apply [Flow.map] to the [locationsFlow] to create [EditLiveLocationInfo] and pass the result flow to the
|
||||||
|
* [handleLiveLocation] with [Flow] typed by [EditLiveLocationInfo]
|
||||||
|
*/
|
||||||
|
@JvmName("handleLiveLocationWithLatLong")
|
||||||
|
@JsName("handleLiveLocationWithLatLong")
|
||||||
|
suspend fun TelegramBot.handleLiveLocation(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
locationsFlow: Flow<Pair<Double, Double>>,
|
||||||
|
liveTimeMillis: Long = defaultLivePeriodDelayMillis,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null
|
||||||
|
) {
|
||||||
|
handleLiveLocation(
|
||||||
|
chatId,
|
||||||
|
locationsFlow.map { (lat, long) ->
|
||||||
|
EditLiveLocationInfo(
|
||||||
|
lat,
|
||||||
|
long
|
||||||
|
)
|
||||||
|
},
|
||||||
|
liveTimeMillis,
|
||||||
|
disableNotification,
|
||||||
|
protectContent,
|
||||||
|
replyToMessageId,
|
||||||
|
allowSendingWithoutReply
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -92,7 +92,7 @@ suspend fun TelegramBot.startLiveLocation(
|
|||||||
initProximityAlertRadius: Meters? = null,
|
initProximityAlertRadius: Meters? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
): LiveLocationProvider {
|
): LiveLocationProvider {
|
||||||
@@ -137,7 +137,7 @@ suspend fun TelegramBot.startLiveLocation(
|
|||||||
initProximityAlertRadius: Meters? = null,
|
initProximityAlertRadius: Meters? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
): LiveLocationProvider = startLiveLocation(
|
): LiveLocationProvider = startLiveLocation(
|
||||||
@@ -170,7 +170,7 @@ suspend fun TelegramBot.startLiveLocation(
|
|||||||
initProximityAlertRadius: Meters? = null,
|
initProximityAlertRadius: Meters? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
): LiveLocationProvider = startLiveLocation(
|
): LiveLocationProvider = startLiveLocation(
|
||||||
@@ -203,7 +203,7 @@ suspend fun TelegramBot.startLiveLocation(
|
|||||||
initProximityAlertRadius: Meters? = null,
|
initProximityAlertRadius: Meters? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
): LiveLocationProvider = startLiveLocation(
|
): LiveLocationProvider = startLiveLocation(
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import dev.inmo.tgbotapi.types.message.abstracts.Message
|
|||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.stopPoll(
|
suspend fun TelegramBot.stopPoll(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageId,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
StopPoll(chatId, messageId, replyMarkup)
|
StopPoll(chatId, messageId, replyMarkup)
|
||||||
@@ -25,7 +25,7 @@ suspend fun TelegramBot.stopPoll(
|
|||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.stopPoll(
|
suspend fun TelegramBot.stopPoll(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageId,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = stopPoll(chat.id, messageId, replyMarkup)
|
) = stopPoll(chat.id, messageId, replyMarkup)
|
||||||
|
|
||||||
|
|||||||
@@ -3,19 +3,19 @@ package dev.inmo.tgbotapi.extensions.api.chat.modify
|
|||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.chat.modify.PinChatMessage
|
import dev.inmo.tgbotapi.requests.chat.modify.PinChatMessage
|
||||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||||
import dev.inmo.tgbotapi.types.MessageIdentifier
|
import dev.inmo.tgbotapi.types.MessageId
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
||||||
|
|
||||||
suspend fun TelegramBot.pinChatMessage(
|
suspend fun TelegramBot.pinChatMessage(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageId,
|
||||||
disableNotification: Boolean = false
|
disableNotification: Boolean = false
|
||||||
) = execute(PinChatMessage(chatId, messageId, disableNotification))
|
) = execute(PinChatMessage(chatId, messageId, disableNotification))
|
||||||
|
|
||||||
suspend fun TelegramBot.pinChatMessage(
|
suspend fun TelegramBot.pinChatMessage(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageId,
|
||||||
disableNotification: Boolean = false
|
disableNotification: Boolean = false
|
||||||
) = pinChatMessage(chat.id, messageId, disableNotification)
|
) = pinChatMessage(chat.id, messageId, disableNotification)
|
||||||
|
|
||||||
|
|||||||
@@ -3,18 +3,18 @@ package dev.inmo.tgbotapi.extensions.api.chat.modify
|
|||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.chat.modify.UnpinChatMessage
|
import dev.inmo.tgbotapi.requests.chat.modify.UnpinChatMessage
|
||||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||||
import dev.inmo.tgbotapi.types.MessageIdentifier
|
import dev.inmo.tgbotapi.types.MessageId
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
||||||
|
|
||||||
suspend fun TelegramBot.unpinChatMessage(
|
suspend fun TelegramBot.unpinChatMessage(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageId: MessageIdentifier? = null
|
messageId: MessageId? = null
|
||||||
) = execute(UnpinChatMessage(chatId, messageId))
|
) = execute(UnpinChatMessage(chatId, messageId))
|
||||||
|
|
||||||
suspend fun TelegramBot.unpinChatMessage(
|
suspend fun TelegramBot.unpinChatMessage(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
messageId: MessageIdentifier? = null
|
messageId: MessageId? = null
|
||||||
) = unpinChatMessage(chat.id, messageId)
|
) = unpinChatMessage(chat.id, messageId)
|
||||||
|
|
||||||
suspend fun TelegramBot.unpinChatMessage(
|
suspend fun TelegramBot.unpinChatMessage(
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ suspend fun <T> TelegramBot.edit(
|
|||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.edit(
|
suspend fun TelegramBot.edit(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageId,
|
||||||
latitude: Double,
|
latitude: Double,
|
||||||
longitude: Double,
|
longitude: Double,
|
||||||
horizontalAccuracy: Meters? = null,
|
horizontalAccuracy: Meters? = null,
|
||||||
@@ -65,7 +65,7 @@ suspend fun TelegramBot.edit(
|
|||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.edit(
|
suspend fun TelegramBot.edit(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageId,
|
||||||
latitude: Double,
|
latitude: Double,
|
||||||
longitude: Double,
|
longitude: Double,
|
||||||
horizontalAccuracy: Meters? = null,
|
horizontalAccuracy: Meters? = null,
|
||||||
@@ -94,7 +94,7 @@ suspend fun TelegramBot.edit(
|
|||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.edit(
|
suspend fun TelegramBot.edit(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageId,
|
||||||
location: LiveLocation,
|
location: LiveLocation,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editLiveLocation(
|
) = editLiveLocation(
|
||||||
@@ -107,7 +107,7 @@ suspend fun TelegramBot.edit(
|
|||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.edit(
|
suspend fun TelegramBot.edit(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageId,
|
||||||
location: LiveLocation,
|
location: LiveLocation,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editLiveLocation(chat, messageId, location, replyMarkup)
|
) = editLiveLocation(chat, messageId, location, replyMarkup)
|
||||||
@@ -128,7 +128,7 @@ suspend fun TelegramBot.edit(
|
|||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.edit(
|
suspend fun TelegramBot.edit(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageId,
|
||||||
media: TelegramMedia,
|
media: TelegramMedia,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editMessageMedia(chatId, messageId, media, replyMarkup)
|
) = editMessageMedia(chatId, messageId, media, replyMarkup)
|
||||||
@@ -139,7 +139,7 @@ suspend fun TelegramBot.edit(
|
|||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.edit(
|
suspend fun TelegramBot.edit(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageId,
|
||||||
media: TelegramMedia,
|
media: TelegramMedia,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editMessageMedia(chat, messageId, media, replyMarkup)
|
) = editMessageMedia(chat, messageId, media, replyMarkup)
|
||||||
@@ -160,7 +160,7 @@ suspend fun TelegramBot.edit(
|
|||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.edit(
|
suspend fun TelegramBot.edit(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageId,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editMessageReplyMarkup(chatId, messageId, replyMarkup)
|
) = editMessageReplyMarkup(chatId, messageId, replyMarkup)
|
||||||
|
|
||||||
@@ -170,7 +170,7 @@ suspend fun TelegramBot.edit(
|
|||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.edit(
|
suspend fun TelegramBot.edit(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageId,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editMessageReplyMarkup(chat, messageId, replyMarkup)
|
) = editMessageReplyMarkup(chat, messageId, replyMarkup)
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import dev.inmo.tgbotapi.requests.edit.caption.EditChatMessageCaption
|
|||||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||||
import dev.inmo.tgbotapi.types.message.textsources.TextSource
|
import dev.inmo.tgbotapi.types.message.textsources.TextSource
|
||||||
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
||||||
import dev.inmo.tgbotapi.types.MessageIdentifier
|
import dev.inmo.tgbotapi.types.MessageId
|
||||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
@@ -21,7 +21,7 @@ import dev.inmo.tgbotapi.utils.RiskFeature
|
|||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.editMessageCaption(
|
suspend fun TelegramBot.editMessageCaption(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageId,
|
||||||
text: String,
|
text: String,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
@@ -35,7 +35,7 @@ suspend fun TelegramBot.editMessageCaption(
|
|||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.editMessageCaption(
|
suspend fun TelegramBot.editMessageCaption(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageId,
|
||||||
text: String,
|
text: String,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
@@ -61,7 +61,7 @@ suspend fun <T> TelegramBot.editMessageCaption(
|
|||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.editMessageCaption(
|
suspend fun TelegramBot.editMessageCaption(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageId,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
@@ -74,7 +74,7 @@ suspend fun TelegramBot.editMessageCaption(
|
|||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.editMessageCaption(
|
suspend fun TelegramBot.editMessageCaption(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageId,
|
||||||
entities: List<TextSource>,
|
entities: List<TextSource>,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editMessageCaption(chat.id, messageId, entities, replyMarkup)
|
) = editMessageCaption(chat.id, messageId, entities, replyMarkup)
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import dev.inmo.tgbotapi.types.message.content.LocationContent
|
|||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.editLiveLocation(
|
suspend fun TelegramBot.editLiveLocation(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageId,
|
||||||
latitude: Double,
|
latitude: Double,
|
||||||
longitude: Double,
|
longitude: Double,
|
||||||
horizontalAccuracy: Meters? = null,
|
horizontalAccuracy: Meters? = null,
|
||||||
@@ -34,7 +34,7 @@ suspend fun TelegramBot.editLiveLocation(
|
|||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.editLiveLocation(
|
suspend fun TelegramBot.editLiveLocation(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageId,
|
||||||
latitude: Double,
|
latitude: Double,
|
||||||
longitude: Double,
|
longitude: Double,
|
||||||
horizontalAccuracy: Meters? = null,
|
horizontalAccuracy: Meters? = null,
|
||||||
@@ -63,7 +63,7 @@ suspend fun TelegramBot.editLiveLocation(
|
|||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.editLiveLocation(
|
suspend fun TelegramBot.editLiveLocation(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageId,
|
||||||
location: LiveLocation,
|
location: LiveLocation,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
@@ -78,7 +78,7 @@ suspend fun TelegramBot.editLiveLocation(
|
|||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.editLiveLocation(
|
suspend fun TelegramBot.editLiveLocation(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageId,
|
||||||
location: LiveLocation,
|
location: LiveLocation,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editLiveLocation(chat.id, messageId, location.latitude, location.longitude, location.horizontalAccuracy, location.heading, location.proximityAlertRadius, replyMarkup)
|
) = editLiveLocation(chat.id, messageId, location.latitude, location.longitude, location.horizontalAccuracy, location.heading, location.proximityAlertRadius, replyMarkup)
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package dev.inmo.tgbotapi.extensions.api.edit.location.live
|
|||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.edit.location.live.StopChatMessageLiveLocation
|
import dev.inmo.tgbotapi.requests.edit.location.live.StopChatMessageLiveLocation
|
||||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||||
import dev.inmo.tgbotapi.types.MessageIdentifier
|
import dev.inmo.tgbotapi.types.MessageId
|
||||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||||
@@ -15,7 +15,7 @@ import dev.inmo.tgbotapi.types.message.content.LocationContent
|
|||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.stopLiveLocation(
|
suspend fun TelegramBot.stopLiveLocation(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageId,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
StopChatMessageLiveLocation(
|
StopChatMessageLiveLocation(
|
||||||
@@ -29,7 +29,7 @@ suspend fun TelegramBot.stopLiveLocation(
|
|||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.stopLiveLocation(
|
suspend fun TelegramBot.stopLiveLocation(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageId,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = stopLiveLocation(chat.id, messageId, replyMarkup)
|
) = stopLiveLocation(chat.id, messageId, replyMarkup)
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import dev.inmo.tgbotapi.bot.TelegramBot
|
|||||||
import dev.inmo.tgbotapi.requests.edit.media.EditChatMessageMedia
|
import dev.inmo.tgbotapi.requests.edit.media.EditChatMessageMedia
|
||||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||||
import dev.inmo.tgbotapi.types.media.TelegramMedia
|
import dev.inmo.tgbotapi.types.media.TelegramMedia
|
||||||
import dev.inmo.tgbotapi.types.MessageIdentifier
|
import dev.inmo.tgbotapi.types.MessageId
|
||||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||||
@@ -16,7 +16,7 @@ import dev.inmo.tgbotapi.types.message.content.MediaContent
|
|||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.editMessageMedia(
|
suspend fun TelegramBot.editMessageMedia(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageId,
|
||||||
media: TelegramMedia,
|
media: TelegramMedia,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
@@ -29,7 +29,7 @@ suspend fun TelegramBot.editMessageMedia(
|
|||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.editMessageMedia(
|
suspend fun TelegramBot.editMessageMedia(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageId,
|
||||||
media: TelegramMedia,
|
media: TelegramMedia,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editMessageMedia(chat.id, messageId, media, replyMarkup)
|
) = editMessageMedia(chat.id, messageId, media, replyMarkup)
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package dev.inmo.tgbotapi.extensions.api.edit.reply_markup
|
|||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.edit.reply_markup.EditChatMessageReplyMarkup
|
import dev.inmo.tgbotapi.requests.edit.reply_markup.EditChatMessageReplyMarkup
|
||||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||||
import dev.inmo.tgbotapi.types.MessageIdentifier
|
import dev.inmo.tgbotapi.types.MessageId
|
||||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
||||||
@@ -14,7 +14,7 @@ import dev.inmo.tgbotapi.types.message.abstracts.Message
|
|||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.editMessageReplyMarkup(
|
suspend fun TelegramBot.editMessageReplyMarkup(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageId,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
EditChatMessageReplyMarkup(chatId, messageId, replyMarkup)
|
EditChatMessageReplyMarkup(chatId, messageId, replyMarkup)
|
||||||
@@ -26,7 +26,7 @@ suspend fun TelegramBot.editMessageReplyMarkup(
|
|||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.editMessageReplyMarkup(
|
suspend fun TelegramBot.editMessageReplyMarkup(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageId,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editMessageReplyMarkup(chat.id, messageId, replyMarkup)
|
) = editMessageReplyMarkup(chat.id, messageId, replyMarkup)
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import dev.inmo.tgbotapi.bot.TelegramBot
|
|||||||
import dev.inmo.tgbotapi.requests.edit.text.EditChatMessageText
|
import dev.inmo.tgbotapi.requests.edit.text.EditChatMessageText
|
||||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||||
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
||||||
import dev.inmo.tgbotapi.types.MessageIdentifier
|
import dev.inmo.tgbotapi.types.MessageId
|
||||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
@@ -19,7 +19,7 @@ import dev.inmo.tgbotapi.utils.RiskFeature
|
|||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.editMessageText(
|
suspend fun TelegramBot.editMessageText(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageId,
|
||||||
text: String,
|
text: String,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
disableWebPagePreview: Boolean? = null,
|
disableWebPagePreview: Boolean? = null,
|
||||||
@@ -34,7 +34,7 @@ suspend fun TelegramBot.editMessageText(
|
|||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.editMessageText(
|
suspend fun TelegramBot.editMessageText(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageId,
|
||||||
text: String,
|
text: String,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
disableWebPagePreview: Boolean? = null,
|
disableWebPagePreview: Boolean? = null,
|
||||||
@@ -59,7 +59,7 @@ suspend fun TelegramBot.editMessageText(
|
|||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.editMessageText(
|
suspend fun TelegramBot.editMessageText(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageId,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
disableWebPagePreview: Boolean? = null,
|
disableWebPagePreview: Boolean? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
@@ -73,7 +73,7 @@ suspend fun TelegramBot.editMessageText(
|
|||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.editMessageText(
|
suspend fun TelegramBot.editMessageText(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageId,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
disableWebPagePreview: Boolean? = null,
|
disableWebPagePreview: Boolean? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import dev.inmo.tgbotapi.types.message.content.GameContent
|
|||||||
suspend fun TelegramBot.getGameScore(
|
suspend fun TelegramBot.getGameScore(
|
||||||
userId: UserId,
|
userId: UserId,
|
||||||
chatId: ChatId,
|
chatId: ChatId,
|
||||||
messageId: MessageIdentifier
|
messageId: MessageId
|
||||||
) = execute(
|
) = execute(
|
||||||
GetGameHighScoresByChat(userId, chatId, messageId)
|
GetGameHighScoresByChat(userId, chatId, messageId)
|
||||||
)
|
)
|
||||||
@@ -19,7 +19,7 @@ suspend fun TelegramBot.getGameScore(
|
|||||||
suspend fun TelegramBot.getGameScore(
|
suspend fun TelegramBot.getGameScore(
|
||||||
user: CommonUser,
|
user: CommonUser,
|
||||||
chatId: ChatId,
|
chatId: ChatId,
|
||||||
messageId: MessageIdentifier
|
messageId: MessageId
|
||||||
) = getGameScore(
|
) = getGameScore(
|
||||||
user.id, chatId, messageId
|
user.id, chatId, messageId
|
||||||
)
|
)
|
||||||
@@ -27,7 +27,7 @@ suspend fun TelegramBot.getGameScore(
|
|||||||
suspend fun TelegramBot.getGameScore(
|
suspend fun TelegramBot.getGameScore(
|
||||||
userId: UserId,
|
userId: UserId,
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
messageId: MessageIdentifier
|
messageId: MessageId
|
||||||
) = getGameScore(
|
) = getGameScore(
|
||||||
userId, chat.id, messageId
|
userId, chat.id, messageId
|
||||||
)
|
)
|
||||||
@@ -35,7 +35,7 @@ suspend fun TelegramBot.getGameScore(
|
|||||||
suspend fun TelegramBot.getGameScore(
|
suspend fun TelegramBot.getGameScore(
|
||||||
user: CommonUser,
|
user: CommonUser,
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
messageId: MessageIdentifier
|
messageId: MessageId
|
||||||
) = getGameScore(
|
) = getGameScore(
|
||||||
user.id, chat.id, messageId
|
user.id, chat.id, messageId
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ suspend fun TelegramBot.setGameScore(
|
|||||||
userId: UserId,
|
userId: UserId,
|
||||||
score: Long,
|
score: Long,
|
||||||
chatId: ChatId,
|
chatId: ChatId,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageId,
|
||||||
force: Boolean = false,
|
force: Boolean = false,
|
||||||
disableEditMessage: Boolean = false
|
disableEditMessage: Boolean = false
|
||||||
) = execute(
|
) = execute(
|
||||||
@@ -23,7 +23,7 @@ suspend fun TelegramBot.setGameScore(
|
|||||||
user: CommonUser,
|
user: CommonUser,
|
||||||
score: Long,
|
score: Long,
|
||||||
chatId: ChatId,
|
chatId: ChatId,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageId,
|
||||||
force: Boolean = false,
|
force: Boolean = false,
|
||||||
disableEditMessage: Boolean = false
|
disableEditMessage: Boolean = false
|
||||||
) = setGameScore(
|
) = setGameScore(
|
||||||
@@ -34,7 +34,7 @@ suspend fun TelegramBot.setGameScore(
|
|||||||
userId: UserId,
|
userId: UserId,
|
||||||
score: Long,
|
score: Long,
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageId,
|
||||||
force: Boolean = false,
|
force: Boolean = false,
|
||||||
disableEditMessage: Boolean = false
|
disableEditMessage: Boolean = false
|
||||||
) = setGameScore(
|
) = setGameScore(
|
||||||
@@ -45,7 +45,7 @@ suspend fun TelegramBot.setGameScore(
|
|||||||
user: CommonUser,
|
user: CommonUser,
|
||||||
score: Long,
|
score: Long,
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageId,
|
||||||
force: Boolean = false,
|
force: Boolean = false,
|
||||||
disableEditMessage: Boolean = false
|
disableEditMessage: Boolean = false
|
||||||
) = setGameScore(
|
) = setGameScore(
|
||||||
|
|||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package dev.inmo.tgbotapi.extensions.api.get
|
||||||
|
|
||||||
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
|
import dev.inmo.tgbotapi.requests.get.GetCustomEmojiStickers
|
||||||
|
import dev.inmo.tgbotapi.requests.get.GetStickerSet
|
||||||
|
import dev.inmo.tgbotapi.types.CustomEmojiId
|
||||||
|
import dev.inmo.tgbotapi.types.files.Sticker
|
||||||
|
import kotlin.js.JsName
|
||||||
|
import kotlin.jvm.JvmName
|
||||||
|
|
||||||
|
suspend fun TelegramBot.getCustomEmojiStickers(
|
||||||
|
customEmojiIds: List<CustomEmojiId>
|
||||||
|
) = execute(
|
||||||
|
GetCustomEmojiStickers(customEmojiIds)
|
||||||
|
)
|
||||||
|
|
||||||
|
@JvmName("getCustomEmojiStickersWithStringsList")
|
||||||
|
@JsName("getCustomEmojiStickersWithStringsList")
|
||||||
|
suspend fun TelegramBot.getCustomEmojiStickers(
|
||||||
|
customEmojiIds: List<String>
|
||||||
|
) = getCustomEmojiStickers(customEmojiIds.map(::CustomEmojiId))
|
||||||
|
|
||||||
|
suspend fun TelegramBot.getCustomEmojiStickerOrNull(
|
||||||
|
customEmojiId: CustomEmojiId
|
||||||
|
) = getCustomEmojiStickers(listOf(customEmojiId)).firstOrNull()
|
||||||
|
|
||||||
|
suspend fun TelegramBot.getCustomEmojiStickerOrThrow(
|
||||||
|
customEmojiId: CustomEmojiId
|
||||||
|
) = getCustomEmojiStickers(listOf(customEmojiId)).first()
|
||||||
|
|
||||||
|
suspend fun TelegramBot.getCustomEmojiStickerOrNull(
|
||||||
|
customEmojiId: String
|
||||||
|
) = getCustomEmojiStickerOrNull(CustomEmojiId(customEmojiId))
|
||||||
|
|
||||||
|
suspend fun TelegramBot.getCustomEmojiStickerOrThrow(
|
||||||
|
customEmojiId: String
|
||||||
|
) = getCustomEmojiStickerOrThrow(CustomEmojiId(customEmojiId))
|
||||||
@@ -4,7 +4,7 @@ import dev.inmo.tgbotapi.bot.TelegramBot
|
|||||||
import dev.inmo.tgbotapi.requests.send.CopyMessage
|
import dev.inmo.tgbotapi.requests.send.CopyMessage
|
||||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||||
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
||||||
import dev.inmo.tgbotapi.types.MessageIdentifier
|
import dev.inmo.tgbotapi.types.MessageId
|
||||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
@@ -16,13 +16,13 @@ import dev.inmo.tgbotapi.types.message.abstracts.Message
|
|||||||
*/
|
*/
|
||||||
suspend inline fun TelegramBot.copyMessage(
|
suspend inline fun TelegramBot.copyMessage(
|
||||||
fromChatId: ChatIdentifier,
|
fromChatId: ChatIdentifier,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageId,
|
||||||
toChatId: ChatIdentifier,
|
toChatId: ChatIdentifier,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
@@ -46,13 +46,13 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
*/
|
*/
|
||||||
suspend inline fun TelegramBot.copyMessage(
|
suspend inline fun TelegramBot.copyMessage(
|
||||||
fromChat: Chat,
|
fromChat: Chat,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageId,
|
||||||
toChatId: ChatIdentifier,
|
toChatId: ChatIdentifier,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = copyMessage(fromChat.id, messageId, toChatId, text, parseMode, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = copyMessage(fromChat.id, messageId, toChatId, text, parseMode, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -63,13 +63,13 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
*/
|
*/
|
||||||
suspend inline fun TelegramBot.copyMessage(
|
suspend inline fun TelegramBot.copyMessage(
|
||||||
fromChatId: ChatIdentifier,
|
fromChatId: ChatIdentifier,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageId,
|
||||||
toChat: Chat,
|
toChat: Chat,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = copyMessage(fromChatId, messageId, toChat.id, text, parseMode, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = copyMessage(fromChatId, messageId, toChat.id, text, parseMode, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -80,13 +80,13 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
*/
|
*/
|
||||||
suspend inline fun TelegramBot.copyMessage(
|
suspend inline fun TelegramBot.copyMessage(
|
||||||
fromChat: Chat,
|
fromChat: Chat,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageId,
|
||||||
toChat: Chat,
|
toChat: Chat,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = copyMessage(fromChat.id, messageId, toChat.id, text, parseMode, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = copyMessage(fromChat.id, messageId, toChat.id, text, parseMode, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -98,12 +98,12 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
*/
|
*/
|
||||||
suspend inline fun TelegramBot.copyMessage(
|
suspend inline fun TelegramBot.copyMessage(
|
||||||
fromChatId: ChatIdentifier,
|
fromChatId: ChatIdentifier,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageId,
|
||||||
toChatId: ChatIdentifier,
|
toChatId: ChatIdentifier,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
@@ -126,12 +126,12 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
*/
|
*/
|
||||||
suspend inline fun TelegramBot.copyMessage(
|
suspend inline fun TelegramBot.copyMessage(
|
||||||
fromChat: Chat,
|
fromChat: Chat,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageId,
|
||||||
toChatId: ChatIdentifier,
|
toChatId: ChatIdentifier,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = copyMessage(fromChat.id, messageId, toChatId, entities, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = copyMessage(fromChat.id, messageId, toChatId, entities, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -142,12 +142,12 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
*/
|
*/
|
||||||
suspend inline fun TelegramBot.copyMessage(
|
suspend inline fun TelegramBot.copyMessage(
|
||||||
fromChatId: ChatIdentifier,
|
fromChatId: ChatIdentifier,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageId,
|
||||||
toChat: Chat,
|
toChat: Chat,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = copyMessage(fromChatId, messageId, toChat.id, entities, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = copyMessage(fromChatId, messageId, toChat.id, entities, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -158,12 +158,12 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
*/
|
*/
|
||||||
suspend inline fun TelegramBot.copyMessage(
|
suspend inline fun TelegramBot.copyMessage(
|
||||||
fromChat: Chat,
|
fromChat: Chat,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageId,
|
||||||
toChat: Chat,
|
toChat: Chat,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = copyMessage(fromChat.id, messageId, toChat.id, entities, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = copyMessage(fromChat.id, messageId, toChat.id, entities, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -179,7 +179,7 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = copyMessage(message.chat, message.messageId, toChatId, text, parseMode, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = copyMessage(message.chat, message.messageId, toChatId, text, parseMode, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -195,7 +195,7 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = copyMessage(message.chat, message.messageId, toChat, text, parseMode, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = copyMessage(message.chat, message.messageId, toChat, text, parseMode, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -210,7 +210,7 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = copyMessage(message.chat, message.messageId, toChatId, entities, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = copyMessage(message.chat, message.messageId, toChatId, entities, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -225,7 +225,228 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = copyMessage(message.chat, message.messageId, toChat, entities, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = copyMessage(message.chat, message.messageId, toChat, entities, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||||
|
*/
|
||||||
|
suspend inline fun TelegramBot.copyMessage(
|
||||||
|
toChatId: ChatIdentifier,
|
||||||
|
fromChatId: ChatIdentifier,
|
||||||
|
messageId: MessageId,
|
||||||
|
text: String? = null,
|
||||||
|
parseMode: ParseMode? = null,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null
|
||||||
|
) = execute(
|
||||||
|
CopyMessage(
|
||||||
|
fromChatId,
|
||||||
|
messageId,
|
||||||
|
toChatId,
|
||||||
|
text,
|
||||||
|
parseMode,
|
||||||
|
disableNotification,
|
||||||
|
protectContent,
|
||||||
|
replyToMessageId,
|
||||||
|
allowSendingWithoutReply,
|
||||||
|
replyMarkup
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||||
|
*/
|
||||||
|
suspend inline fun TelegramBot.copyMessage(
|
||||||
|
toChatId: ChatIdentifier,
|
||||||
|
fromChat: Chat,
|
||||||
|
messageId: MessageId,
|
||||||
|
text: String? = null,
|
||||||
|
parseMode: ParseMode? = null,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null
|
||||||
|
) = copyMessage(
|
||||||
|
toChatId,
|
||||||
|
fromChat.id,
|
||||||
|
messageId,
|
||||||
|
text,
|
||||||
|
parseMode,
|
||||||
|
disableNotification,
|
||||||
|
protectContent,
|
||||||
|
replyToMessageId,
|
||||||
|
allowSendingWithoutReply,
|
||||||
|
replyMarkup
|
||||||
|
)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||||
|
*/
|
||||||
|
suspend inline fun TelegramBot.copyMessage(
|
||||||
|
toChat: Chat,
|
||||||
|
fromChatId: ChatIdentifier,
|
||||||
|
messageId: MessageId,
|
||||||
|
text: String? = null,
|
||||||
|
parseMode: ParseMode? = null,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null
|
||||||
|
) = copyMessage(
|
||||||
|
toChat.id,
|
||||||
|
fromChatId,
|
||||||
|
messageId,
|
||||||
|
text,
|
||||||
|
parseMode,
|
||||||
|
disableNotification,
|
||||||
|
protectContent,
|
||||||
|
replyToMessageId,
|
||||||
|
allowSendingWithoutReply,
|
||||||
|
replyMarkup
|
||||||
|
)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||||
|
*/
|
||||||
|
suspend inline fun TelegramBot.copyMessage(
|
||||||
|
toChat: Chat,
|
||||||
|
fromChat: Chat,
|
||||||
|
messageId: MessageId,
|
||||||
|
text: String? = null,
|
||||||
|
parseMode: ParseMode? = null,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null
|
||||||
|
) = copyMessage(
|
||||||
|
toChat.id,
|
||||||
|
fromChat.id,
|
||||||
|
messageId,
|
||||||
|
text,
|
||||||
|
parseMode,
|
||||||
|
disableNotification,
|
||||||
|
protectContent,
|
||||||
|
replyToMessageId,
|
||||||
|
allowSendingWithoutReply,
|
||||||
|
replyMarkup
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||||
|
*/
|
||||||
|
suspend inline fun TelegramBot.copyMessage(
|
||||||
|
toChatId: ChatIdentifier,
|
||||||
|
fromChatId: ChatIdentifier,
|
||||||
|
messageId: MessageId,
|
||||||
|
entities: TextSourcesList,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null
|
||||||
|
) = execute(
|
||||||
|
CopyMessage(
|
||||||
|
fromChatId,
|
||||||
|
messageId,
|
||||||
|
toChatId,
|
||||||
|
entities,
|
||||||
|
disableNotification,
|
||||||
|
protectContent,
|
||||||
|
replyToMessageId,
|
||||||
|
allowSendingWithoutReply,
|
||||||
|
replyMarkup
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||||
|
*/
|
||||||
|
suspend inline fun TelegramBot.copyMessage(
|
||||||
|
toChatId: ChatIdentifier,
|
||||||
|
fromChat: Chat,
|
||||||
|
messageId: MessageId,
|
||||||
|
entities: TextSourcesList,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null
|
||||||
|
) = copyMessage(
|
||||||
|
toChatId,
|
||||||
|
fromChat.id,
|
||||||
|
messageId,
|
||||||
|
entities,
|
||||||
|
disableNotification,
|
||||||
|
protectContent,
|
||||||
|
replyToMessageId,
|
||||||
|
allowSendingWithoutReply,
|
||||||
|
replyMarkup
|
||||||
|
)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||||
|
*/
|
||||||
|
suspend inline fun TelegramBot.copyMessage(
|
||||||
|
toChat: Chat,
|
||||||
|
fromChatId: ChatIdentifier,
|
||||||
|
messageId: MessageId,
|
||||||
|
entities: TextSourcesList,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null
|
||||||
|
) = copyMessage(
|
||||||
|
toChat.id,
|
||||||
|
fromChatId,
|
||||||
|
messageId,
|
||||||
|
entities,
|
||||||
|
disableNotification,
|
||||||
|
protectContent,
|
||||||
|
replyToMessageId,
|
||||||
|
allowSendingWithoutReply,
|
||||||
|
replyMarkup
|
||||||
|
)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||||
|
*/
|
||||||
|
suspend inline fun TelegramBot.copyMessage(
|
||||||
|
toChat: Chat,
|
||||||
|
fromChat: Chat,
|
||||||
|
messageId: MessageId,
|
||||||
|
entities: TextSourcesList,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null
|
||||||
|
) = copyMessage(
|
||||||
|
toChat.id,
|
||||||
|
fromChat.id,
|
||||||
|
messageId,
|
||||||
|
entities,
|
||||||
|
disableNotification,
|
||||||
|
protectContent,
|
||||||
|
replyToMessageId,
|
||||||
|
allowSendingWithoutReply,
|
||||||
|
replyMarkup
|
||||||
|
)
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import dev.inmo.tgbotapi.extensions.api.send.media.sendMediaGroup
|
|||||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||||
import dev.inmo.tgbotapi.types.media.*
|
import dev.inmo.tgbotapi.types.media.*
|
||||||
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
||||||
import dev.inmo.tgbotapi.types.MessageIdentifier
|
import dev.inmo.tgbotapi.types.MessageId
|
||||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.MediaGroupMessage
|
import dev.inmo.tgbotapi.types.message.abstracts.MediaGroupMessage
|
||||||
@@ -23,7 +23,7 @@ suspend inline fun TelegramBot.copyMessages(
|
|||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null
|
allowSendingWithoutReply: Boolean? = null
|
||||||
): List<MediaGroupMessage<MediaGroupContent>> {
|
): List<MediaGroupMessage<MediaGroupContent>> {
|
||||||
val first = messages.first().content.toMediaGroupMemberTelegramMedia().let {
|
val first = messages.first().content.toMediaGroupMemberTelegramMedia().let {
|
||||||
@@ -62,7 +62,7 @@ suspend inline fun TelegramBot.copyMessages(
|
|||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null
|
allowSendingWithoutReply: Boolean? = null
|
||||||
) = copyMessages(toChat.id, messages, text, parseMode, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply)
|
) = copyMessages(toChat.id, messages, text, parseMode, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply)
|
||||||
|
|
||||||
@@ -77,7 +77,7 @@ suspend inline fun TelegramBot.copyMessages(
|
|||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null
|
allowSendingWithoutReply: Boolean? = null
|
||||||
) = copyMessages(toChat, update.data, text, parseMode, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply)
|
) = copyMessages(toChat, update.data, text, parseMode, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply)
|
||||||
|
|
||||||
@@ -92,7 +92,7 @@ suspend inline fun TelegramBot.copyMessages(
|
|||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null
|
allowSendingWithoutReply: Boolean? = null
|
||||||
) = copyMessages(toChat.id, update, text, parseMode, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply)
|
) = copyMessages(toChat.id, update, text, parseMode, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply)
|
||||||
|
|
||||||
@@ -106,7 +106,7 @@ suspend inline fun TelegramBot.copyMessages(
|
|||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null
|
allowSendingWithoutReply: Boolean? = null
|
||||||
): List<MediaGroupMessage<MediaGroupContent>> {
|
): List<MediaGroupMessage<MediaGroupContent>> {
|
||||||
val first = messages.first().content.toMediaGroupMemberTelegramMedia().let {
|
val first = messages.first().content.toMediaGroupMemberTelegramMedia().let {
|
||||||
@@ -140,7 +140,7 @@ suspend inline fun TelegramBot.copyMessages(
|
|||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null
|
allowSendingWithoutReply: Boolean? = null
|
||||||
) = copyMessages(toChat.id, messages, entities, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply)
|
) = copyMessages(toChat.id, messages, entities, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply)
|
||||||
|
|
||||||
@@ -154,7 +154,7 @@ suspend inline fun TelegramBot.copyMessages(
|
|||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null
|
allowSendingWithoutReply: Boolean? = null
|
||||||
) = copyMessages(toChat, update.data, entities, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply)
|
) = copyMessages(toChat, update.data, entities, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply)
|
||||||
|
|
||||||
@@ -168,6 +168,6 @@ suspend inline fun TelegramBot.copyMessages(
|
|||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null
|
allowSendingWithoutReply: Boolean? = null
|
||||||
) = copyMessages(toChat.id, update, entities, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply)
|
) = copyMessages(toChat.id, update, entities, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply)
|
||||||
|
|||||||
@@ -1,180 +0,0 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.api.send
|
|
||||||
|
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
|
||||||
import dev.inmo.tgbotapi.requests.send.CopyMessage
|
|
||||||
import dev.inmo.tgbotapi.requests.send.OrderChangingDeprecationWarn
|
|
||||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
|
||||||
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
|
||||||
import dev.inmo.tgbotapi.types.MessageIdentifier
|
|
||||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
|
||||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
|
||||||
|
|
||||||
// TODO:: Swap fromChatId and toChatId for more correct order of parameters
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @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
|
|
||||||
*/
|
|
||||||
@Deprecated(OrderChangingDeprecationWarn)
|
|
||||||
suspend inline fun TelegramBot.copyMessage(
|
|
||||||
fromChatId: ChatIdentifier,
|
|
||||||
toChatId: ChatIdentifier,
|
|
||||||
messageId: MessageIdentifier,
|
|
||||||
text: String? = null,
|
|
||||||
parseMode: ParseMode? = null,
|
|
||||||
disableNotification: Boolean = false,
|
|
||||||
protectContent: Boolean = false,
|
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
|
||||||
replyMarkup: KeyboardMarkup? = null
|
|
||||||
) = execute(
|
|
||||||
CopyMessage(
|
|
||||||
fromChatId,
|
|
||||||
messageId,
|
|
||||||
toChatId,
|
|
||||||
text,
|
|
||||||
parseMode,
|
|
||||||
disableNotification,
|
|
||||||
protectContent,
|
|
||||||
replyToMessageId,
|
|
||||||
allowSendingWithoutReply,
|
|
||||||
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
|
|
||||||
*/
|
|
||||||
@Deprecated(OrderChangingDeprecationWarn)
|
|
||||||
suspend inline fun TelegramBot.copyMessage(
|
|
||||||
fromChat: Chat,
|
|
||||||
toChatId: ChatIdentifier,
|
|
||||||
messageId: MessageIdentifier,
|
|
||||||
text: String? = null,
|
|
||||||
parseMode: ParseMode? = null,
|
|
||||||
disableNotification: Boolean = false,
|
|
||||||
protectContent: Boolean = false,
|
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
|
||||||
replyMarkup: KeyboardMarkup? = null
|
|
||||||
) = copyMessage(fromChat.id, toChatId, messageId, text, parseMode, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, 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
|
|
||||||
*/
|
|
||||||
@Deprecated(OrderChangingDeprecationWarn)
|
|
||||||
suspend inline fun TelegramBot.copyMessage(
|
|
||||||
fromChatId: ChatIdentifier,
|
|
||||||
toChat: Chat,
|
|
||||||
messageId: MessageIdentifier,
|
|
||||||
text: String? = null,
|
|
||||||
parseMode: ParseMode? = null,
|
|
||||||
disableNotification: Boolean = false,
|
|
||||||
protectContent: Boolean = false,
|
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
|
||||||
replyMarkup: KeyboardMarkup? = null
|
|
||||||
) = copyMessage(fromChatId, toChat.id, messageId, text, parseMode, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, 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
|
|
||||||
*/
|
|
||||||
@Deprecated(OrderChangingDeprecationWarn)
|
|
||||||
suspend inline fun TelegramBot.copyMessage(
|
|
||||||
fromChat: Chat,
|
|
||||||
toChat: Chat,
|
|
||||||
messageId: MessageIdentifier,
|
|
||||||
text: String? = null,
|
|
||||||
parseMode: ParseMode? = null,
|
|
||||||
disableNotification: Boolean = false,
|
|
||||||
protectContent: Boolean = false,
|
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
|
||||||
replyMarkup: KeyboardMarkup? = null
|
|
||||||
) = copyMessage(fromChat.id, toChat.id, messageId, text, parseMode, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, 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
|
|
||||||
*/
|
|
||||||
@Deprecated(OrderChangingDeprecationWarn)
|
|
||||||
suspend inline fun TelegramBot.copyMessage(
|
|
||||||
fromChatId: ChatIdentifier,
|
|
||||||
toChatId: ChatIdentifier,
|
|
||||||
messageId: MessageIdentifier,
|
|
||||||
entities: TextSourcesList,
|
|
||||||
disableNotification: Boolean = false,
|
|
||||||
protectContent: Boolean = false,
|
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
|
||||||
replyMarkup: KeyboardMarkup? = null
|
|
||||||
) = execute(
|
|
||||||
CopyMessage(
|
|
||||||
fromChatId,
|
|
||||||
messageId,
|
|
||||||
toChatId,
|
|
||||||
entities,
|
|
||||||
disableNotification,
|
|
||||||
protectContent,
|
|
||||||
replyToMessageId,
|
|
||||||
allowSendingWithoutReply,
|
|
||||||
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
|
|
||||||
*/
|
|
||||||
@Deprecated(OrderChangingDeprecationWarn)
|
|
||||||
suspend inline fun TelegramBot.copyMessage(
|
|
||||||
fromChat: Chat,
|
|
||||||
toChatId: ChatIdentifier,
|
|
||||||
messageId: MessageIdentifier,
|
|
||||||
entities: TextSourcesList,
|
|
||||||
disableNotification: Boolean = false,
|
|
||||||
protectContent: Boolean = false,
|
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
|
||||||
replyMarkup: KeyboardMarkup? = null
|
|
||||||
) = copyMessage(fromChat.id, toChatId, messageId, entities, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, 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
|
|
||||||
*/
|
|
||||||
@Deprecated(OrderChangingDeprecationWarn)
|
|
||||||
suspend inline fun TelegramBot.copyMessage(
|
|
||||||
fromChatId: ChatIdentifier,
|
|
||||||
toChat: Chat,
|
|
||||||
messageId: MessageIdentifier,
|
|
||||||
entities: TextSourcesList,
|
|
||||||
disableNotification: Boolean = false,
|
|
||||||
protectContent: Boolean = false,
|
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
|
||||||
replyMarkup: KeyboardMarkup? = null
|
|
||||||
) = copyMessage(fromChatId, toChat.id, messageId, entities, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, 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
|
|
||||||
*/
|
|
||||||
@Deprecated(OrderChangingDeprecationWarn)
|
|
||||||
suspend inline fun TelegramBot.copyMessage(
|
|
||||||
fromChat: Chat,
|
|
||||||
toChat: Chat,
|
|
||||||
messageId: MessageIdentifier,
|
|
||||||
entities: TextSourcesList,
|
|
||||||
disableNotification: Boolean = false,
|
|
||||||
protectContent: Boolean = false,
|
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
|
||||||
replyMarkup: KeyboardMarkup? = null
|
|
||||||
) = copyMessage(fromChat.id, toChat.id, messageId, entities, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.api.send
|
package dev.inmo.tgbotapi.extensions.api.send
|
||||||
|
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
|
import dev.inmo.tgbotapi.extensions.api.*
|
||||||
import dev.inmo.tgbotapi.extensions.api.send.games.sendGame
|
import dev.inmo.tgbotapi.extensions.api.send.games.sendGame
|
||||||
import dev.inmo.tgbotapi.extensions.api.send.media.*
|
import dev.inmo.tgbotapi.extensions.api.send.media.*
|
||||||
import dev.inmo.tgbotapi.extensions.api.send.payments.sendInvoice
|
import dev.inmo.tgbotapi.extensions.api.send.payments.sendInvoice
|
||||||
@@ -29,6 +30,9 @@ import dev.inmo.tgbotapi.types.payments.abstracts.Currency
|
|||||||
import dev.inmo.tgbotapi.types.polls.*
|
import dev.inmo.tgbotapi.types.polls.*
|
||||||
import dev.inmo.tgbotapi.types.venue.Venue
|
import dev.inmo.tgbotapi.types.venue.Venue
|
||||||
import dev.inmo.tgbotapi.utils.RiskFeature
|
import dev.inmo.tgbotapi.utils.RiskFeature
|
||||||
|
import kotlinx.coroutines.flow.Flow
|
||||||
|
import kotlin.js.JsName
|
||||||
|
import kotlin.jvm.JvmName
|
||||||
|
|
||||||
|
|
||||||
// Contact
|
// Contact
|
||||||
@@ -943,19 +947,30 @@ suspend inline fun TelegramBot.reply(
|
|||||||
suspend inline fun TelegramBot.reply(
|
suspend inline fun TelegramBot.reply(
|
||||||
to: Message,
|
to: Message,
|
||||||
fromChatId: ChatIdentifier,
|
fromChatId: ChatIdentifier,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageId,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = copyMessage(fromChatId, to.chat.id, messageId, text, parseMode, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
) = copyMessage(
|
||||||
|
to.chat.id,
|
||||||
|
fromChatId,
|
||||||
|
messageId,
|
||||||
|
text,
|
||||||
|
parseMode,
|
||||||
|
disableNotification,
|
||||||
|
protectContent,
|
||||||
|
to.messageId,
|
||||||
|
allowSendingWithoutReply,
|
||||||
|
replyMarkup
|
||||||
|
)
|
||||||
|
|
||||||
suspend inline fun TelegramBot.reply(
|
suspend inline fun TelegramBot.reply(
|
||||||
to: Message,
|
to: Message,
|
||||||
fromChat: Chat,
|
fromChat: Chat,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageId,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
@@ -995,6 +1010,80 @@ suspend fun TelegramBot.reply(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Will use [handleLiveLocation] with replying to [message] each time new message will be sent by live location update
|
||||||
|
*
|
||||||
|
* @see handleLiveLocation
|
||||||
|
*/
|
||||||
|
suspend fun TelegramBot.reply(
|
||||||
|
message: Message,
|
||||||
|
locationsFlow: Flow<EditLiveLocationInfo>,
|
||||||
|
liveTimeMillis: Long = defaultLivePeriodDelayMillis,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
allowSendingWithoutReply: Boolean? = null
|
||||||
|
) = handleLiveLocation(
|
||||||
|
message.chat.id,
|
||||||
|
locationsFlow,
|
||||||
|
liveTimeMillis,
|
||||||
|
disableNotification,
|
||||||
|
protectContent,
|
||||||
|
message.messageId,
|
||||||
|
allowSendingWithoutReply
|
||||||
|
)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Will use [handleLiveLocation] with replying to [message] each time new message will be sent by live location update
|
||||||
|
*
|
||||||
|
* @see handleLiveLocation
|
||||||
|
*/
|
||||||
|
@JvmName("replyLiveLocationWithLocation")
|
||||||
|
@JsName("replyLiveLocationWithLocation")
|
||||||
|
suspend fun TelegramBot.reply(
|
||||||
|
message: Message,
|
||||||
|
locationsFlow: Flow<Location>,
|
||||||
|
liveTimeMillis: Long = defaultLivePeriodDelayMillis,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
allowSendingWithoutReply: Boolean? = null
|
||||||
|
) {
|
||||||
|
handleLiveLocation(
|
||||||
|
message.chat.id,
|
||||||
|
locationsFlow,
|
||||||
|
liveTimeMillis,
|
||||||
|
disableNotification,
|
||||||
|
protectContent,
|
||||||
|
message.messageId,
|
||||||
|
allowSendingWithoutReply
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Will use [handleLiveLocation] with replying to [message] each time new message will be sent by live location update
|
||||||
|
*
|
||||||
|
* @see handleLiveLocation
|
||||||
|
*/
|
||||||
|
@JvmName("replyLiveLocationWithLatLong")
|
||||||
|
@JsName("replyLiveLocationWithLatLong")
|
||||||
|
suspend fun TelegramBot.reply(
|
||||||
|
message: Message,
|
||||||
|
locationsFlow: Flow<Pair<Double, Double>>,
|
||||||
|
liveTimeMillis: Long = defaultLivePeriodDelayMillis,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
allowSendingWithoutReply: Boolean? = null
|
||||||
|
) {
|
||||||
|
handleLiveLocation(
|
||||||
|
message.chat.id,
|
||||||
|
locationsFlow,
|
||||||
|
liveTimeMillis,
|
||||||
|
disableNotification,
|
||||||
|
protectContent,
|
||||||
|
message.messageId,
|
||||||
|
allowSendingWithoutReply
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
suspend fun TelegramBot.reply(
|
suspend fun TelegramBot.reply(
|
||||||
to: Message,
|
to: Message,
|
||||||
mediaFile: TelegramMediaFile,
|
mediaFile: TelegramMediaFile,
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -17,7 +17,7 @@ suspend fun TelegramBot.sendContact(
|
|||||||
lastName: String? = null,
|
lastName: String? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
@@ -35,7 +35,7 @@ suspend fun TelegramBot.sendContact(
|
|||||||
contact: Contact,
|
contact: Contact,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
@@ -55,7 +55,7 @@ suspend fun TelegramBot.sendContact(
|
|||||||
lastName: String? = null,
|
lastName: String? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendContact(
|
) = sendContact(
|
||||||
@@ -71,7 +71,7 @@ suspend fun TelegramBot.sendContact(
|
|||||||
contact: Contact,
|
contact: Contact,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendContact(
|
) = sendContact(
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package dev.inmo.tgbotapi.extensions.api.send
|
|||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.send.SendDice
|
import dev.inmo.tgbotapi.requests.send.SendDice
|
||||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||||
import dev.inmo.tgbotapi.types.MessageIdentifier
|
import dev.inmo.tgbotapi.types.MessageId
|
||||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
import dev.inmo.tgbotapi.types.dice.DiceAnimationType
|
import dev.inmo.tgbotapi.types.dice.DiceAnimationType
|
||||||
@@ -17,7 +17,7 @@ suspend fun TelegramBot.sendDice(
|
|||||||
animationType: DiceAnimationType? = null,
|
animationType: DiceAnimationType? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
@@ -33,7 +33,7 @@ suspend fun TelegramBot.sendDice(
|
|||||||
animationType: DiceAnimationType? = null,
|
animationType: DiceAnimationType? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendDice(chat.id, animationType, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendDice(chat.id, animationType, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|||||||
@@ -0,0 +1,210 @@
|
|||||||
|
package dev.inmo.tgbotapi.extensions.api.send
|
||||||
|
|
||||||
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
|
import dev.inmo.tgbotapi.requests.send.SendLiveLocation
|
||||||
|
import dev.inmo.tgbotapi.types.*
|
||||||
|
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||||
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
|
import dev.inmo.tgbotapi.types.location.Location
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||||
|
*/
|
||||||
|
suspend fun TelegramBot.sendLocation(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
latitude: Double,
|
||||||
|
longitude: Double,
|
||||||
|
livePeriod: Seconds,
|
||||||
|
horizontalAccuracy: Meters? = null,
|
||||||
|
heading: Degrees? = null,
|
||||||
|
proximityAlertRadius: Meters? = null,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null
|
||||||
|
) = execute(
|
||||||
|
SendLiveLocation(
|
||||||
|
chatId,
|
||||||
|
latitude,
|
||||||
|
longitude,
|
||||||
|
livePeriod,
|
||||||
|
horizontalAccuracy,
|
||||||
|
heading,
|
||||||
|
proximityAlertRadius,
|
||||||
|
disableNotification,
|
||||||
|
protectContent,
|
||||||
|
replyToMessageId,
|
||||||
|
allowSendingWithoutReply,
|
||||||
|
replyMarkup
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||||
|
*/
|
||||||
|
suspend fun TelegramBot.sendLocation(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
location: Location,
|
||||||
|
livePeriod: Seconds,
|
||||||
|
horizontalAccuracy: Meters? = null,
|
||||||
|
heading: Degrees? = null,
|
||||||
|
proximityAlertRadius: Meters? = null,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null
|
||||||
|
) = sendLocation(
|
||||||
|
chatId,
|
||||||
|
location.latitude,
|
||||||
|
location.longitude,
|
||||||
|
livePeriod,
|
||||||
|
horizontalAccuracy,
|
||||||
|
heading,
|
||||||
|
proximityAlertRadius,
|
||||||
|
disableNotification,
|
||||||
|
protectContent,
|
||||||
|
replyToMessageId,
|
||||||
|
allowSendingWithoutReply,
|
||||||
|
replyMarkup
|
||||||
|
)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||||
|
*/
|
||||||
|
suspend fun TelegramBot.sendLocation(
|
||||||
|
chat: Chat,
|
||||||
|
latitude: Double,
|
||||||
|
longitude: Double,
|
||||||
|
livePeriod: Seconds,
|
||||||
|
horizontalAccuracy: Meters? = null,
|
||||||
|
heading: Degrees? = null,
|
||||||
|
proximityAlertRadius: Meters? = null,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null
|
||||||
|
) = sendLocation(
|
||||||
|
chat.id,
|
||||||
|
latitude,
|
||||||
|
longitude,
|
||||||
|
livePeriod,
|
||||||
|
horizontalAccuracy,
|
||||||
|
heading,
|
||||||
|
proximityAlertRadius,
|
||||||
|
disableNotification,
|
||||||
|
protectContent,
|
||||||
|
replyToMessageId,
|
||||||
|
allowSendingWithoutReply,
|
||||||
|
replyMarkup
|
||||||
|
)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||||
|
*/
|
||||||
|
suspend fun TelegramBot.sendLocation(
|
||||||
|
chat: Chat,
|
||||||
|
location: Location,
|
||||||
|
livePeriod: Seconds,
|
||||||
|
horizontalAccuracy: Meters? = null,
|
||||||
|
heading: Degrees? = null,
|
||||||
|
proximityAlertRadius: Meters? = null,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null
|
||||||
|
) = sendLocation(
|
||||||
|
chat.id,
|
||||||
|
location.latitude,
|
||||||
|
location.longitude,
|
||||||
|
livePeriod,
|
||||||
|
horizontalAccuracy,
|
||||||
|
heading,
|
||||||
|
proximityAlertRadius,
|
||||||
|
disableNotification,
|
||||||
|
protectContent,
|
||||||
|
replyToMessageId,
|
||||||
|
allowSendingWithoutReply,
|
||||||
|
replyMarkup
|
||||||
|
)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||||
|
*/
|
||||||
|
suspend fun TelegramBot.sendLiveLocation(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
latitude: Double,
|
||||||
|
longitude: Double,
|
||||||
|
livePeriod: Seconds,
|
||||||
|
horizontalAccuracy: Meters? = null,
|
||||||
|
heading: Degrees? = null,
|
||||||
|
proximityAlertRadius: Meters? = null,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null
|
||||||
|
) = sendLocation(chatId, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||||
|
*/
|
||||||
|
suspend fun TelegramBot.sendLiveLocation(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
location: Location,
|
||||||
|
livePeriod: Seconds,
|
||||||
|
horizontalAccuracy: Meters? = null,
|
||||||
|
heading: Degrees? = null,
|
||||||
|
proximityAlertRadius: Meters? = null,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null
|
||||||
|
) = sendLocation(chatId, location.latitude, location.longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||||
|
*/
|
||||||
|
suspend fun TelegramBot.sendLiveLocation(
|
||||||
|
chat: Chat,
|
||||||
|
latitude: Double,
|
||||||
|
longitude: Double,
|
||||||
|
livePeriod: Seconds,
|
||||||
|
horizontalAccuracy: Meters? = null,
|
||||||
|
heading: Degrees? = null,
|
||||||
|
proximityAlertRadius: Meters? = null,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null
|
||||||
|
) = sendLocation(chat.id, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||||
|
*/
|
||||||
|
suspend fun TelegramBot.sendLiveLocation(
|
||||||
|
chat: Chat,
|
||||||
|
location: Location,
|
||||||
|
livePeriod: Seconds,
|
||||||
|
horizontalAccuracy: Meters? = null,
|
||||||
|
heading: Degrees? = null,
|
||||||
|
proximityAlertRadius: Meters? = null,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null
|
||||||
|
) = sendLocation(chat.id, location.latitude, location.longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -4,7 +4,7 @@ import dev.inmo.tgbotapi.bot.TelegramBot
|
|||||||
import dev.inmo.tgbotapi.requests.send.SendTextMessage
|
import dev.inmo.tgbotapi.requests.send.SendTextMessage
|
||||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||||
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
||||||
import dev.inmo.tgbotapi.types.MessageIdentifier
|
import dev.inmo.tgbotapi.types.MessageId
|
||||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
@@ -20,7 +20,7 @@ suspend fun TelegramBot.sendMessage(
|
|||||||
disableWebPagePreview: Boolean? = null,
|
disableWebPagePreview: Boolean? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
@@ -38,7 +38,7 @@ suspend fun TelegramBot.sendTextMessage(
|
|||||||
disableWebPagePreview: Boolean? = null,
|
disableWebPagePreview: Boolean? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendMessage(
|
) = sendMessage(
|
||||||
@@ -56,7 +56,7 @@ suspend fun TelegramBot.sendMessage(
|
|||||||
disableWebPagePreview: Boolean? = null,
|
disableWebPagePreview: Boolean? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendMessage(chat.id, text, parseMode, disableWebPagePreview, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendMessage(chat.id, text, parseMode, disableWebPagePreview, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -73,7 +73,7 @@ suspend fun TelegramBot.sendTextMessage(
|
|||||||
disableWebPagePreview: Boolean? = null,
|
disableWebPagePreview: Boolean? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendTextMessage(chat.id, text, parseMode, disableWebPagePreview, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendTextMessage(chat.id, text, parseMode, disableWebPagePreview, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -88,7 +88,7 @@ suspend fun TelegramBot.sendMessage(
|
|||||||
disableWebPagePreview: Boolean? = null,
|
disableWebPagePreview: Boolean? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
@@ -105,7 +105,7 @@ suspend fun TelegramBot.sendTextMessage(
|
|||||||
disableWebPagePreview: Boolean? = null,
|
disableWebPagePreview: Boolean? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendMessage(
|
) = sendMessage(
|
||||||
@@ -122,7 +122,7 @@ suspend fun TelegramBot.sendMessage(
|
|||||||
disableWebPagePreview: Boolean? = null,
|
disableWebPagePreview: Boolean? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendMessage(chat.id, entities, disableWebPagePreview, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendMessage(chat.id, entities, disableWebPagePreview, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -138,7 +138,7 @@ suspend fun TelegramBot.sendTextMessage(
|
|||||||
disableWebPagePreview: Boolean? = null,
|
disableWebPagePreview: Boolean? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendTextMessage(chat.id, entities, disableWebPagePreview, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendTextMessage(chat.id, entities, disableWebPagePreview, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|||||||
@@ -3,10 +3,10 @@ package dev.inmo.tgbotapi.extensions.api.send
|
|||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.send.SendStaticLocation
|
import dev.inmo.tgbotapi.requests.send.SendStaticLocation
|
||||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||||
import dev.inmo.tgbotapi.types.MessageIdentifier
|
import dev.inmo.tgbotapi.types.MessageId
|
||||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
import dev.inmo.tgbotapi.types.location.StaticLocation
|
import dev.inmo.tgbotapi.types.location.Location
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -19,7 +19,7 @@ suspend fun TelegramBot.sendLocation(
|
|||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
SendStaticLocation(
|
SendStaticLocation(
|
||||||
@@ -40,11 +40,11 @@ suspend fun TelegramBot.sendLocation(
|
|||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.sendLocation(
|
suspend fun TelegramBot.sendLocation(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
location: StaticLocation,
|
location: Location,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendLocation(
|
) = sendLocation(
|
||||||
chatId,
|
chatId,
|
||||||
@@ -68,7 +68,7 @@ suspend fun TelegramBot.sendLocation(
|
|||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendLocation(
|
) = sendLocation(
|
||||||
chat.id,
|
chat.id,
|
||||||
@@ -87,11 +87,11 @@ suspend fun TelegramBot.sendLocation(
|
|||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.sendLocation(
|
suspend fun TelegramBot.sendLocation(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
location: StaticLocation,
|
location: Location,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendLocation(
|
) = sendLocation(
|
||||||
chat.id,
|
chat.id,
|
||||||
@@ -115,7 +115,7 @@ suspend fun TelegramBot.sendStaticLocation(
|
|||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendLocation(chatId, latitude, longitude, disableNotification, protectContent, allowSendingWithoutReply, replyToMessageId, replyMarkup)
|
) = sendLocation(chatId, latitude, longitude, disableNotification, protectContent, allowSendingWithoutReply, replyToMessageId, replyMarkup)
|
||||||
|
|
||||||
@@ -125,11 +125,11 @@ suspend fun TelegramBot.sendStaticLocation(
|
|||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.sendStaticLocation(
|
suspend fun TelegramBot.sendStaticLocation(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
location: StaticLocation,
|
location: Location,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendLocation(chatId, location.latitude, location.longitude, disableNotification, protectContent, allowSendingWithoutReply, replyToMessageId, replyMarkup)
|
) = sendLocation(chatId, location.latitude, location.longitude, disableNotification, protectContent, allowSendingWithoutReply, replyToMessageId, replyMarkup)
|
||||||
|
|
||||||
@@ -144,7 +144,7 @@ suspend fun TelegramBot.sendStaticLocation(
|
|||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendLocation(chat.id, latitude, longitude, disableNotification, protectContent, allowSendingWithoutReply, replyToMessageId, replyMarkup)
|
) = sendLocation(chat.id, latitude, longitude, disableNotification, protectContent, allowSendingWithoutReply, replyToMessageId, replyMarkup)
|
||||||
|
|
||||||
@@ -154,10 +154,10 @@ suspend fun TelegramBot.sendStaticLocation(
|
|||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.sendStaticLocation(
|
suspend fun TelegramBot.sendStaticLocation(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
location: StaticLocation,
|
location: Location,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendLocation(chat.id, location.latitude, location.longitude, disableNotification, protectContent, allowSendingWithoutReply, replyToMessageId, replyMarkup)
|
) = sendLocation(chat.id, location.latitude, location.longitude, disableNotification, protectContent, allowSendingWithoutReply, replyToMessageId, replyMarkup)
|
||||||
@@ -24,7 +24,7 @@ suspend fun TelegramBot.sendVenue(
|
|||||||
googlePlaceType: GooglePlaceType? = null,
|
googlePlaceType: GooglePlaceType? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
@@ -62,7 +62,7 @@ suspend fun TelegramBot.sendVenue(
|
|||||||
googlePlaceType: GooglePlaceType? = null,
|
googlePlaceType: GooglePlaceType? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVenue(
|
) = sendVenue(
|
||||||
@@ -97,7 +97,7 @@ suspend fun TelegramBot.sendVenue(
|
|||||||
googlePlaceType: GooglePlaceType? = null,
|
googlePlaceType: GooglePlaceType? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVenue(
|
) = sendVenue(
|
||||||
@@ -132,7 +132,7 @@ suspend fun TelegramBot.sendVenue(
|
|||||||
googlePlaceType: GooglePlaceType? = null,
|
googlePlaceType: GooglePlaceType? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVenue(
|
) = sendVenue(
|
||||||
@@ -161,7 +161,7 @@ suspend fun TelegramBot.sendVenue(
|
|||||||
venue: Venue,
|
venue: Venue,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
@@ -185,7 +185,7 @@ suspend fun TelegramBot.sendVenue(
|
|||||||
venue: Venue,
|
venue: Venue,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVenue(
|
) = sendVenue(
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ suspend fun TelegramBot.send(
|
|||||||
height: Int? = null,
|
height: Int? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendAnimation(chatId, animation, text, parseMode, duration, width, height, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendAnimation(chatId, animation, text, parseMode, duration, width, height, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -79,7 +79,7 @@ suspend fun TelegramBot.send(
|
|||||||
height: Int? = null,
|
height: Int? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendAnimation(chat, animation, text, parseMode, duration, width, height, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendAnimation(chat, animation, text, parseMode, duration, width, height, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -98,7 +98,7 @@ suspend fun TelegramBot.send(
|
|||||||
height: Int? = null,
|
height: Int? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendAnimation(chatId, animation, entities, duration, width, height, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendAnimation(chatId, animation, entities, duration, width, height, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -117,7 +117,7 @@ suspend fun TelegramBot.send(
|
|||||||
height: Int? = null,
|
height: Int? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendAnimation(chat, animation, entities, duration, width, height, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendAnimation(chat, animation, entities, duration, width, height, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -135,7 +135,7 @@ suspend fun TelegramBot.send(
|
|||||||
title: String? = audio.title,
|
title: String? = audio.title,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendAudio(chatId, audio, text, parseMode, title, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendAudio(chatId, audio, text, parseMode, title, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -153,7 +153,7 @@ suspend fun TelegramBot.send(
|
|||||||
title: String? = audio.title,
|
title: String? = audio.title,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendAudio(chat, audio, text, parseMode, title, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendAudio(chat, audio, text, parseMode, title, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -170,7 +170,7 @@ suspend inline fun TelegramBot.send(
|
|||||||
title: String? = audio.title,
|
title: String? = audio.title,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendAudio(chatId, audio, entities, title, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendAudio(chatId, audio, entities, title, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -187,7 +187,7 @@ suspend inline fun TelegramBot.send(
|
|||||||
title: String? = audio.title,
|
title: String? = audio.title,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendAudio(chat, audio, entities, title, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendAudio(chat, audio, entities, title, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -204,7 +204,7 @@ suspend fun TelegramBot.send(
|
|||||||
lastName: String? = null,
|
lastName: String? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendContact(chatId, phoneNumber, firstName, lastName, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendContact(chatId, phoneNumber, firstName, lastName, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -219,7 +219,7 @@ suspend fun TelegramBot.send(
|
|||||||
contact: Contact,
|
contact: Contact,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendContact(chatId, contact, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendContact(chatId, contact, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -236,7 +236,7 @@ suspend fun TelegramBot.send(
|
|||||||
lastName: String? = null,
|
lastName: String? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendContact(chat, phoneNumber, firstName, lastName, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendContact(chat, phoneNumber, firstName, lastName, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -251,7 +251,7 @@ suspend fun TelegramBot.send(
|
|||||||
contact: Contact,
|
contact: Contact,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendContact(chat, contact, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendContact(chat, contact, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -266,7 +266,7 @@ suspend fun TelegramBot.send(
|
|||||||
animationType: DiceAnimationType,
|
animationType: DiceAnimationType,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendDice(chatId, animationType, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendDice(chatId, animationType, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -281,7 +281,7 @@ suspend fun TelegramBot.send(
|
|||||||
animationType: DiceAnimationType,
|
animationType: DiceAnimationType,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendDice(chat, animationType, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendDice(chat, animationType, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -298,7 +298,7 @@ suspend fun TelegramBot.send(
|
|||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null,
|
replyMarkup: KeyboardMarkup? = null,
|
||||||
disableContentTypeDetection: Boolean? = null
|
disableContentTypeDetection: Boolean? = null
|
||||||
@@ -316,7 +316,7 @@ suspend fun TelegramBot.send(
|
|||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null,
|
replyMarkup: KeyboardMarkup? = null,
|
||||||
disableContentTypeDetection: Boolean? = null
|
disableContentTypeDetection: Boolean? = null
|
||||||
@@ -333,7 +333,7 @@ suspend inline fun TelegramBot.send(
|
|||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null,
|
replyMarkup: KeyboardMarkup? = null,
|
||||||
disableContentTypeDetection: Boolean? = null
|
disableContentTypeDetection: Boolean? = null
|
||||||
@@ -350,7 +350,7 @@ suspend inline fun TelegramBot.send(
|
|||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null,
|
replyMarkup: KeyboardMarkup? = null,
|
||||||
disableContentTypeDetection: Boolean? = null
|
disableContentTypeDetection: Boolean? = null
|
||||||
@@ -366,7 +366,7 @@ suspend fun TelegramBot.send(
|
|||||||
game: Game,
|
game: Game,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendGame(chatId, game, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendGame(chatId, game, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -381,7 +381,7 @@ suspend fun TelegramBot.send(
|
|||||||
game: Game,
|
game: Game,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendGame(chat, game, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendGame(chat, game, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -412,7 +412,7 @@ suspend fun TelegramBot.send(
|
|||||||
priceDependOnShipAddress: Boolean = false,
|
priceDependOnShipAddress: Boolean = false,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = sendInvoice(chatId, title, description, payload, providerToken, currency, prices, maxTipAmount, suggestedTipAmounts, startParameter, providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendInvoice(chatId, title, description, payload, providerToken, currency, prices, maxTipAmount, suggestedTipAmounts, startParameter, providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -443,7 +443,7 @@ suspend fun TelegramBot.send(
|
|||||||
priceDependOnShipAddress: Boolean = false,
|
priceDependOnShipAddress: Boolean = false,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = sendInvoice(user, title, description, payload, providerToken, currency, prices, maxTipAmount, suggestedTipAmounts, startParameter, providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendInvoice(user, title, description, payload, providerToken, currency, prices, maxTipAmount, suggestedTipAmounts, startParameter, providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -460,7 +460,7 @@ suspend fun TelegramBot.send(
|
|||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendStaticLocation(chatId, latitude, longitude, disableNotification, protectContent, allowSendingWithoutReply, replyToMessageId, replyMarkup)
|
) = sendStaticLocation(chatId, latitude, longitude, disableNotification, protectContent, allowSendingWithoutReply, replyToMessageId, replyMarkup)
|
||||||
|
|
||||||
@@ -475,7 +475,7 @@ suspend fun TelegramBot.send(
|
|||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendStaticLocation(chatId, location, disableNotification, protectContent, allowSendingWithoutReply, replyToMessageId, replyMarkup)
|
) = sendStaticLocation(chatId, location, disableNotification, protectContent, allowSendingWithoutReply, replyToMessageId, replyMarkup)
|
||||||
|
|
||||||
@@ -491,7 +491,7 @@ suspend fun TelegramBot.send(
|
|||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendStaticLocation(chat, latitude, longitude, disableNotification, protectContent, allowSendingWithoutReply, replyToMessageId, replyMarkup)
|
) = sendStaticLocation(chat, latitude, longitude, disableNotification, protectContent, allowSendingWithoutReply, replyToMessageId, replyMarkup)
|
||||||
|
|
||||||
@@ -506,7 +506,7 @@ suspend fun TelegramBot.send(
|
|||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendStaticLocation(chat, location, disableNotification, protectContent, allowSendingWithoutReply, replyToMessageId, replyMarkup)
|
) = sendStaticLocation(chat, location, disableNotification, protectContent, allowSendingWithoutReply, replyToMessageId, replyMarkup)
|
||||||
|
|
||||||
@@ -522,7 +522,7 @@ suspend fun TelegramBot.send(
|
|||||||
disableWebPagePreview: Boolean? = null,
|
disableWebPagePreview: Boolean? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendTextMessage(chatId, text, parseMode, disableWebPagePreview, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendTextMessage(chatId, text, parseMode, disableWebPagePreview, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -539,7 +539,7 @@ suspend fun TelegramBot.send(
|
|||||||
disableWebPagePreview: Boolean? = null,
|
disableWebPagePreview: Boolean? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendTextMessage(chat, text, parseMode, disableWebPagePreview, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendTextMessage(chat, text, parseMode, disableWebPagePreview, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -555,7 +555,7 @@ suspend fun TelegramBot.send(
|
|||||||
disableWebPagePreview: Boolean? = null,
|
disableWebPagePreview: Boolean? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendTextMessage(chatId, entities, disableWebPagePreview, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendTextMessage(chatId, entities, disableWebPagePreview, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -571,7 +571,7 @@ suspend fun TelegramBot.send(
|
|||||||
disableWebPagePreview: Boolean? = null,
|
disableWebPagePreview: Boolean? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendTextMessage(chat, entities, disableWebPagePreview, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendTextMessage(chat, entities, disableWebPagePreview, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -588,7 +588,7 @@ suspend fun TelegramBot.send(
|
|||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendPhoto(chatId, photo, text, parseMode, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendPhoto(chatId, photo, text, parseMode, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -605,7 +605,7 @@ suspend fun TelegramBot.send(
|
|||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendPhoto(chat, photo, text, parseMode, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendPhoto(chat, photo, text, parseMode, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -622,7 +622,7 @@ suspend fun TelegramBot.send(
|
|||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendPhoto(chatId, photoSize, text, parseMode, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendPhoto(chatId, photoSize, text, parseMode, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -639,7 +639,7 @@ suspend fun TelegramBot.send(
|
|||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendPhoto(chat, photoSize, text, parseMode, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendPhoto(chat, photoSize, text, parseMode, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -655,7 +655,7 @@ suspend inline fun TelegramBot.send(
|
|||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendPhoto(chatId, photo, entities, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendPhoto(chatId, photo, entities, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -671,7 +671,7 @@ suspend inline fun TelegramBot.send(
|
|||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendPhoto(chat, photo, entities, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendPhoto(chat, photo, entities, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -687,7 +687,7 @@ suspend inline fun TelegramBot.send(
|
|||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendPhoto(chatId, photoSize, entities, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendPhoto(chatId, photoSize, entities, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -703,7 +703,7 @@ suspend inline fun TelegramBot.send(
|
|||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendPhoto(chat, photoSize, entities, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendPhoto(chat, photoSize, entities, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -723,7 +723,7 @@ suspend fun TelegramBot.send(
|
|||||||
closeInfo: ScheduledCloseInfo? = null,
|
closeInfo: ScheduledCloseInfo? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendRegularPoll(chatId, question, options, isAnonymous, isClosed, allowMultipleAnswers, closeInfo, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendRegularPoll(chatId, question, options, isAnonymous, isClosed, allowMultipleAnswers, closeInfo, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -744,7 +744,7 @@ suspend fun TelegramBot.send(
|
|||||||
closeInfo: ScheduledCloseInfo? = null,
|
closeInfo: ScheduledCloseInfo? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendRegularPoll(chatId, poll, isClosed, question, options, isAnonymous, allowMultipleAnswers, closeInfo, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendRegularPoll(chatId, poll, isClosed, question, options, isAnonymous, allowMultipleAnswers, closeInfo, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -764,7 +764,7 @@ suspend fun TelegramBot.send(
|
|||||||
closeInfo: ScheduledCloseInfo? = null,
|
closeInfo: ScheduledCloseInfo? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendRegularPoll(chat, question, options, isAnonymous, isClosed, allowMultipleAnswers, closeInfo, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendRegularPoll(chat, question, options, isAnonymous, isClosed, allowMultipleAnswers, closeInfo, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -785,7 +785,7 @@ suspend fun TelegramBot.send(
|
|||||||
closeInfo: ScheduledCloseInfo? = null,
|
closeInfo: ScheduledCloseInfo? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendRegularPoll(chat, poll, isClosed, question, options, isAnonymous, allowMultipleAnswers, closeInfo, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendRegularPoll(chat, poll, isClosed, question, options, isAnonymous, allowMultipleAnswers, closeInfo, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -807,7 +807,7 @@ suspend fun TelegramBot.send(
|
|||||||
closeInfo: ScheduledCloseInfo? = null,
|
closeInfo: ScheduledCloseInfo? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendQuizPoll(chatId, question, options, correctOptionId, isAnonymous, isClosed, explanation, parseMode, closeInfo, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendQuizPoll(chatId, question, options, correctOptionId, isAnonymous, isClosed, explanation, parseMode, closeInfo, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -829,7 +829,7 @@ suspend fun TelegramBot.send(
|
|||||||
closeInfo: ScheduledCloseInfo? = null,
|
closeInfo: ScheduledCloseInfo? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendQuizPoll(chat, question, options, correctOptionId, isAnonymous, isClosed, explanation, parseMode, closeInfo, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendQuizPoll(chat, question, options, correctOptionId, isAnonymous, isClosed, explanation, parseMode, closeInfo, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -852,7 +852,7 @@ suspend fun TelegramBot.send(
|
|||||||
closeInfo: ScheduledCloseInfo? = null,
|
closeInfo: ScheduledCloseInfo? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendQuizPoll(
|
) = sendQuizPoll(
|
||||||
@@ -877,7 +877,7 @@ suspend fun TelegramBot.send(
|
|||||||
closeInfo: ScheduledCloseInfo? = null,
|
closeInfo: ScheduledCloseInfo? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendQuizPoll(chat, isClosed, quizPoll, question, options, correctOptionId, isAnonymous, explanation, parseMode, closeInfo, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendQuizPoll(chat, isClosed, quizPoll, question, options, correctOptionId, isAnonymous, explanation, parseMode, closeInfo, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -898,7 +898,7 @@ suspend inline fun TelegramBot.send(
|
|||||||
closeInfo: ScheduledCloseInfo? = null,
|
closeInfo: ScheduledCloseInfo? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendQuizPoll(chatId, question, options, correctOptionId, isAnonymous, isClosed, entities, closeInfo, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendQuizPoll(chatId, question, options, correctOptionId, isAnonymous, isClosed, entities, closeInfo, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -919,7 +919,7 @@ suspend inline fun TelegramBot.send(
|
|||||||
closeInfo: ScheduledCloseInfo? = null,
|
closeInfo: ScheduledCloseInfo? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendQuizPoll(chat, question, options, correctOptionId, isAnonymous, isClosed, entities, closeInfo, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendQuizPoll(chat, question, options, correctOptionId, isAnonymous, isClosed, entities, closeInfo, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -941,7 +941,7 @@ suspend inline fun TelegramBot.send(
|
|||||||
closeInfo: ScheduledCloseInfo? = null,
|
closeInfo: ScheduledCloseInfo? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendQuizPoll(chatId, isClosed, quizPoll, question, options, correctOptionId, isAnonymous, entities, closeInfo, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendQuizPoll(chatId, isClosed, quizPoll, question, options, correctOptionId, isAnonymous, entities, closeInfo, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -963,7 +963,7 @@ suspend inline fun TelegramBot.send(
|
|||||||
closeInfo: ScheduledCloseInfo? = null,
|
closeInfo: ScheduledCloseInfo? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendQuizPoll(chat, isClosed, quizPoll, question, options, correctOptionId, isAnonymous, entities, closeInfo, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendQuizPoll(chat, isClosed, quizPoll, question, options, correctOptionId, isAnonymous, entities, closeInfo, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -978,7 +978,7 @@ suspend fun TelegramBot.send(
|
|||||||
sticker: Sticker,
|
sticker: Sticker,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendSticker(chatId, sticker, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendSticker(chatId, sticker, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -993,7 +993,7 @@ suspend fun TelegramBot.send(
|
|||||||
sticker: Sticker,
|
sticker: Sticker,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendSticker(chat, sticker, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendSticker(chat, sticker, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -1015,7 +1015,7 @@ suspend fun TelegramBot.send(
|
|||||||
googlePlaceType: GooglePlaceType? = null,
|
googlePlaceType: GooglePlaceType? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVenue(chatId, latitude, longitude, title, address, foursquareId, foursquareType, googlePlaceId, googlePlaceType, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendVenue(chatId, latitude, longitude, title, address, foursquareId, foursquareType, googlePlaceId, googlePlaceType, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -1037,7 +1037,7 @@ suspend fun TelegramBot.send(
|
|||||||
googlePlaceType: GooglePlaceType? = null,
|
googlePlaceType: GooglePlaceType? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVenue(chat, latitude, longitude, title, address, foursquareId, foursquareType, googlePlaceId, googlePlaceType, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendVenue(chat, latitude, longitude, title, address, foursquareId, foursquareType, googlePlaceId, googlePlaceType, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -1058,7 +1058,7 @@ suspend fun TelegramBot.send(
|
|||||||
googlePlaceType: GooglePlaceType? = null,
|
googlePlaceType: GooglePlaceType? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVenue(chatId, location, title, address, foursquareId, foursquareType, googlePlaceId, googlePlaceType, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendVenue(chatId, location, title, address, foursquareId, foursquareType, googlePlaceId, googlePlaceType, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -1079,7 +1079,7 @@ suspend fun TelegramBot.send(
|
|||||||
googlePlaceType: GooglePlaceType? = null,
|
googlePlaceType: GooglePlaceType? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVenue(chat, location, title, address, foursquareId, foursquareType, googlePlaceId, googlePlaceType, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendVenue(chat, location, title, address, foursquareId, foursquareType, googlePlaceId, googlePlaceType, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -1094,7 +1094,7 @@ suspend fun TelegramBot.send(
|
|||||||
venue: Venue,
|
venue: Venue,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVenue(chatId, venue, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendVenue(chatId, venue, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -1109,7 +1109,7 @@ suspend fun TelegramBot.send(
|
|||||||
venue: Venue,
|
venue: Venue,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVenue(chat, venue, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendVenue(chat, venue, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -1126,7 +1126,7 @@ suspend fun TelegramBot.send(
|
|||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVideo(chatId, video, text, parseMode, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendVideo(chatId, video, text, parseMode, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -1143,7 +1143,7 @@ suspend fun TelegramBot.send(
|
|||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVideo(chat, video, text, parseMode, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendVideo(chat, video, text, parseMode, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -1159,7 +1159,7 @@ suspend inline fun TelegramBot.send(
|
|||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVideo(chatId, video, entities, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendVideo(chatId, video, entities, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -1175,7 +1175,7 @@ suspend inline fun TelegramBot.send(
|
|||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVideo(chat, video, entities, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendVideo(chat, video, entities, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -1190,7 +1190,7 @@ suspend fun TelegramBot.send(
|
|||||||
videoNote: VideoNoteFile,
|
videoNote: VideoNoteFile,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVideoNote(chatId, videoNote, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendVideoNote(chatId, videoNote, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -1205,7 +1205,7 @@ suspend fun TelegramBot.send(
|
|||||||
videoNote: VideoNoteFile,
|
videoNote: VideoNoteFile,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVideoNote(chat, videoNote, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendVideoNote(chat, videoNote, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -1222,7 +1222,7 @@ suspend fun TelegramBot.send(
|
|||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVoice(chatId, voice, text, parseMode, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendVoice(chatId, voice, text, parseMode, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -1239,7 +1239,7 @@ suspend fun TelegramBot.send(
|
|||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVoice(chat, voice, text, parseMode, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendVoice(chat, voice, text, parseMode, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -1255,7 +1255,7 @@ suspend inline fun TelegramBot.send(
|
|||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVoice(chatId, voice, entities, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendVoice(chatId, voice, entities, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -1271,7 +1271,7 @@ suspend inline fun TelegramBot.send(
|
|||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVoice(chat, voice, entities, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendVoice(chat, voice, entities, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -1286,7 +1286,7 @@ suspend fun TelegramBot.send(
|
|||||||
media: List<MediaGroupMemberTelegramMedia>,
|
media: List<MediaGroupMemberTelegramMedia>,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null
|
allowSendingWithoutReply: Boolean? = null
|
||||||
) = sendMediaGroup(chatId, media, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply)
|
) = sendMediaGroup(chatId, media, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply)
|
||||||
|
|
||||||
@@ -1300,7 +1300,7 @@ suspend fun TelegramBot.send(
|
|||||||
media: List<MediaGroupMemberTelegramMedia>,
|
media: List<MediaGroupMemberTelegramMedia>,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null
|
allowSendingWithoutReply: Boolean? = null
|
||||||
) = sendMediaGroup(chat, media, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply)
|
) = sendMediaGroup(chat, media, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply)
|
||||||
|
|
||||||
@@ -1314,7 +1314,7 @@ suspend fun TelegramBot.send(
|
|||||||
media: List<MediaGroupContent>,
|
media: List<MediaGroupContent>,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null
|
allowSendingWithoutReply: Boolean? = null
|
||||||
) = sendMediaGroup(chatId, media, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply)
|
) = sendMediaGroup(chatId, media, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply)
|
||||||
|
|
||||||
@@ -1328,7 +1328,7 @@ suspend fun TelegramBot.send(
|
|||||||
media: List<MediaGroupContent>,
|
media: List<MediaGroupContent>,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null
|
allowSendingWithoutReply: Boolean? = null
|
||||||
) = sendMediaGroup(chat, media, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply)
|
) = sendMediaGroup(chat, media, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply)
|
||||||
|
|
||||||
@@ -1341,7 +1341,7 @@ suspend fun TelegramBot.send(
|
|||||||
media: List<AudioMediaGroupMemberTelegramMedia>,
|
media: List<AudioMediaGroupMemberTelegramMedia>,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null
|
allowSendingWithoutReply: Boolean? = null
|
||||||
) = sendPlaylist(chatId, media, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply)
|
) = sendPlaylist(chatId, media, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply)
|
||||||
|
|
||||||
@@ -1354,7 +1354,7 @@ suspend fun TelegramBot.send(
|
|||||||
media: List<AudioMediaGroupMemberTelegramMedia>,
|
media: List<AudioMediaGroupMemberTelegramMedia>,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null
|
allowSendingWithoutReply: Boolean? = null
|
||||||
) = sendPlaylist(chat, media, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply)
|
) = sendPlaylist(chat, media, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply)
|
||||||
|
|
||||||
@@ -1367,7 +1367,7 @@ suspend fun TelegramBot.send(
|
|||||||
media: List<AudioContent>,
|
media: List<AudioContent>,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null
|
allowSendingWithoutReply: Boolean? = null
|
||||||
) = sendPlaylist(chatId, media, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply)
|
) = sendPlaylist(chatId, media, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply)
|
||||||
|
|
||||||
@@ -1380,7 +1380,7 @@ suspend fun TelegramBot.send(
|
|||||||
media: List<AudioContent>,
|
media: List<AudioContent>,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null
|
allowSendingWithoutReply: Boolean? = null
|
||||||
) = sendPlaylist(chat, media, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply)
|
) = sendPlaylist(chat, media, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply)
|
||||||
|
|
||||||
@@ -1393,7 +1393,7 @@ suspend fun TelegramBot.send(
|
|||||||
media: List<DocumentMediaGroupMemberTelegramMedia>,
|
media: List<DocumentMediaGroupMemberTelegramMedia>,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null
|
allowSendingWithoutReply: Boolean? = null
|
||||||
) = sendDocumentsGroup(chatId, media, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply)
|
) = sendDocumentsGroup(chatId, media, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply)
|
||||||
|
|
||||||
@@ -1406,7 +1406,7 @@ suspend fun TelegramBot.send(
|
|||||||
media: List<DocumentMediaGroupMemberTelegramMedia>,
|
media: List<DocumentMediaGroupMemberTelegramMedia>,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null
|
allowSendingWithoutReply: Boolean? = null
|
||||||
) = sendDocumentsGroup(chat, media, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply)
|
) = sendDocumentsGroup(chat, media, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply)
|
||||||
|
|
||||||
@@ -1419,7 +1419,7 @@ suspend fun TelegramBot.send(
|
|||||||
media: List<DocumentContent>,
|
media: List<DocumentContent>,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null
|
allowSendingWithoutReply: Boolean? = null
|
||||||
) = sendDocumentsGroup(chatId, media, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply)
|
) = sendDocumentsGroup(chatId, media, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply)
|
||||||
|
|
||||||
@@ -1432,7 +1432,7 @@ suspend fun TelegramBot.send(
|
|||||||
media: List<DocumentContent>,
|
media: List<DocumentContent>,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null
|
allowSendingWithoutReply: Boolean? = null
|
||||||
) = sendDocumentsGroup(chat, media, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply)
|
) = sendDocumentsGroup(chat, media, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply)
|
||||||
|
|
||||||
@@ -1445,7 +1445,7 @@ suspend fun TelegramBot.send(
|
|||||||
media: List<VisualMediaGroupMemberTelegramMedia>,
|
media: List<VisualMediaGroupMemberTelegramMedia>,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null
|
allowSendingWithoutReply: Boolean? = null
|
||||||
) = sendVisualMediaGroup(chatId, media, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply)
|
) = sendVisualMediaGroup(chatId, media, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply)
|
||||||
|
|
||||||
@@ -1458,7 +1458,7 @@ suspend fun TelegramBot.send(
|
|||||||
media: List<VisualMediaGroupMemberTelegramMedia>,
|
media: List<VisualMediaGroupMemberTelegramMedia>,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null
|
allowSendingWithoutReply: Boolean? = null
|
||||||
) = sendVisualMediaGroup(chat, media, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply)
|
) = sendVisualMediaGroup(chat, media, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply)
|
||||||
|
|
||||||
@@ -1471,7 +1471,7 @@ suspend fun TelegramBot.send(
|
|||||||
media: List<VisualMediaGroupContent>,
|
media: List<VisualMediaGroupContent>,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null
|
allowSendingWithoutReply: Boolean? = null
|
||||||
) = sendVisualMediaGroup(chatId, media, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply)
|
) = sendVisualMediaGroup(chatId, media, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply)
|
||||||
|
|
||||||
@@ -1484,6 +1484,6 @@ suspend fun TelegramBot.send(
|
|||||||
media: List<VisualMediaGroupContent>,
|
media: List<VisualMediaGroupContent>,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null
|
allowSendingWithoutReply: Boolean? = null
|
||||||
) = sendVisualMediaGroup(chat, media, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply)
|
) = sendVisualMediaGroup(chat, media, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply)
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package dev.inmo.tgbotapi.extensions.api.send.games
|
|||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.send.games.SendGame
|
import dev.inmo.tgbotapi.requests.send.games.SendGame
|
||||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||||
import dev.inmo.tgbotapi.types.MessageIdentifier
|
import dev.inmo.tgbotapi.types.MessageId
|
||||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
import dev.inmo.tgbotapi.types.games.Game
|
import dev.inmo.tgbotapi.types.games.Game
|
||||||
@@ -17,7 +17,7 @@ suspend fun TelegramBot.sendGame(
|
|||||||
gameShortName: String,
|
gameShortName: String,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
@@ -35,7 +35,7 @@ suspend fun TelegramBot.sendGame(
|
|||||||
gameShortName: String,
|
gameShortName: String,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendGame(
|
) = sendGame(
|
||||||
@@ -51,7 +51,7 @@ suspend fun TelegramBot.sendGame(
|
|||||||
game: Game,
|
game: Game,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendGame(
|
) = sendGame(
|
||||||
@@ -67,7 +67,7 @@ suspend fun TelegramBot.sendGame(
|
|||||||
game: Game,
|
game: Game,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendGame(
|
) = sendGame(
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import dev.inmo.tgbotapi.requests.abstracts.InputFile
|
|||||||
import dev.inmo.tgbotapi.requests.send.media.SendAnimation
|
import dev.inmo.tgbotapi.requests.send.media.SendAnimation
|
||||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||||
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
||||||
import dev.inmo.tgbotapi.types.MessageIdentifier
|
import dev.inmo.tgbotapi.types.MessageId
|
||||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
@@ -26,7 +26,7 @@ suspend fun TelegramBot.sendAnimation(
|
|||||||
height: Int? = null,
|
height: Int? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
@@ -61,7 +61,7 @@ suspend fun TelegramBot.sendAnimation(
|
|||||||
height: Int? = null,
|
height: Int? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendAnimation(
|
) = sendAnimation(
|
||||||
@@ -83,7 +83,7 @@ suspend fun TelegramBot.sendAnimation(
|
|||||||
height: Int? = null,
|
height: Int? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendAnimation(chat.id, animation, thumb, text, parseMode, duration, width, height, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendAnimation(chat.id, animation, thumb, text, parseMode, duration, width, height, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -102,7 +102,7 @@ suspend fun TelegramBot.sendAnimation(
|
|||||||
height: Int? = null,
|
height: Int? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendAnimation(chat.id, animation, text, parseMode, duration, width, height, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendAnimation(chat.id, animation, text, parseMode, duration, width, height, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -122,7 +122,7 @@ suspend fun TelegramBot.sendAnimation(
|
|||||||
height: Int? = null,
|
height: Int? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
@@ -155,7 +155,7 @@ suspend fun TelegramBot.sendAnimation(
|
|||||||
height: Int? = null,
|
height: Int? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendAnimation(
|
) = sendAnimation(
|
||||||
@@ -176,7 +176,7 @@ suspend fun TelegramBot.sendAnimation(
|
|||||||
height: Int? = null,
|
height: Int? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendAnimation(chat.id, animation, thumb, entities, duration, width, height, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendAnimation(chat.id, animation, thumb, entities, duration, width, height, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -194,7 +194,7 @@ suspend fun TelegramBot.sendAnimation(
|
|||||||
height: Int? = null,
|
height: Int? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendAnimation(chat.id, animation, entities, duration, width, height, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendAnimation(chat.id, animation, entities, duration, width, height, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import dev.inmo.tgbotapi.requests.abstracts.InputFile
|
|||||||
import dev.inmo.tgbotapi.requests.send.media.SendAudio
|
import dev.inmo.tgbotapi.requests.send.media.SendAudio
|
||||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||||
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
||||||
import dev.inmo.tgbotapi.types.MessageIdentifier
|
import dev.inmo.tgbotapi.types.MessageId
|
||||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
@@ -26,7 +26,7 @@ suspend fun TelegramBot.sendAudio(
|
|||||||
title: String? = null,
|
title: String? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
@@ -62,7 +62,7 @@ suspend fun TelegramBot.sendAudio(
|
|||||||
title: String? = null,
|
title: String? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendAudio(chat.id, audio, thumb, text, parseMode, duration, performer, title, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendAudio(chat.id, audio, thumb, text, parseMode, duration, performer, title, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -79,7 +79,7 @@ suspend fun TelegramBot.sendAudio(
|
|||||||
title: String? = audio.title,
|
title: String? = audio.title,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendAudio(chatId, audio.fileId, audio.thumb ?.fileId, text, parseMode, audio.duration, audio.performer, title, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendAudio(chatId, audio.fileId, audio.thumb ?.fileId, text, parseMode, audio.duration, audio.performer, title, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -96,7 +96,7 @@ suspend fun TelegramBot.sendAudio(
|
|||||||
title: String? = audio.title,
|
title: String? = audio.title,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendAudio(chat.id, audio, text, parseMode, title, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendAudio(chat.id, audio, text, parseMode, title, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -116,7 +116,7 @@ suspend inline fun TelegramBot.sendAudio(
|
|||||||
title: String? = null,
|
title: String? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
@@ -150,7 +150,7 @@ suspend inline fun TelegramBot.sendAudio(
|
|||||||
title: String? = null,
|
title: String? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendAudio(chat.id, audio, thumb, entities, duration, performer, title, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendAudio(chat.id, audio, thumb, entities, duration, performer, title, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -166,7 +166,7 @@ suspend inline fun TelegramBot.sendAudio(
|
|||||||
title: String? = audio.title,
|
title: String? = audio.title,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendAudio(chatId, audio.fileId, audio.thumb ?.fileId, entities, audio.duration, audio.performer, title, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendAudio(chatId, audio.fileId, audio.thumb ?.fileId, entities, audio.duration, audio.performer, title, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -182,7 +182,7 @@ suspend inline fun TelegramBot.sendAudio(
|
|||||||
title: String? = audio.title,
|
title: String? = audio.title,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendAudio(chat.id, audio, entities, title, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendAudio(chat.id, audio, entities, title, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import dev.inmo.tgbotapi.requests.abstracts.InputFile
|
|||||||
import dev.inmo.tgbotapi.requests.send.media.SendDocument
|
import dev.inmo.tgbotapi.requests.send.media.SendDocument
|
||||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||||
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
||||||
import dev.inmo.tgbotapi.types.MessageIdentifier
|
import dev.inmo.tgbotapi.types.MessageId
|
||||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
@@ -23,7 +23,7 @@ suspend fun TelegramBot.sendDocument(
|
|||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null,
|
replyMarkup: KeyboardMarkup? = null,
|
||||||
disableContentTypeDetection: Boolean? = null
|
disableContentTypeDetection: Boolean? = null
|
||||||
@@ -55,7 +55,7 @@ suspend fun TelegramBot.sendDocument(
|
|||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null,
|
replyMarkup: KeyboardMarkup? = null,
|
||||||
disableContentTypeDetection: Boolean? = null
|
disableContentTypeDetection: Boolean? = null
|
||||||
@@ -72,7 +72,7 @@ suspend fun TelegramBot.sendDocument(
|
|||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null,
|
replyMarkup: KeyboardMarkup? = null,
|
||||||
disableContentTypeDetection: Boolean? = null
|
disableContentTypeDetection: Boolean? = null
|
||||||
@@ -91,7 +91,7 @@ suspend fun TelegramBot.sendDocument(
|
|||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null,
|
replyMarkup: KeyboardMarkup? = null,
|
||||||
disableContentTypeDetection: Boolean? = null
|
disableContentTypeDetection: Boolean? = null
|
||||||
@@ -108,7 +108,7 @@ suspend inline fun TelegramBot.sendDocument(
|
|||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null,
|
replyMarkup: KeyboardMarkup? = null,
|
||||||
disableContentTypeDetection: Boolean? = null
|
disableContentTypeDetection: Boolean? = null
|
||||||
@@ -138,7 +138,7 @@ suspend inline fun TelegramBot.sendDocument(
|
|||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null,
|
replyMarkup: KeyboardMarkup? = null,
|
||||||
disableContentTypeDetection: Boolean? = null
|
disableContentTypeDetection: Boolean? = null
|
||||||
@@ -154,7 +154,7 @@ suspend inline fun TelegramBot.sendDocument(
|
|||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null,
|
replyMarkup: KeyboardMarkup? = null,
|
||||||
disableContentTypeDetection: Boolean? = null
|
disableContentTypeDetection: Boolean? = null
|
||||||
@@ -172,7 +172,7 @@ suspend inline fun TelegramBot.sendDocument(
|
|||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null,
|
replyMarkup: KeyboardMarkup? = null,
|
||||||
disableContentTypeDetection: Boolean? = null
|
disableContentTypeDetection: Boolean? = null
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import dev.inmo.tgbotapi.bot.TelegramBot
|
|||||||
import dev.inmo.tgbotapi.requests.send.media.*
|
import dev.inmo.tgbotapi.requests.send.media.*
|
||||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||||
import dev.inmo.tgbotapi.types.media.*
|
import dev.inmo.tgbotapi.types.media.*
|
||||||
import dev.inmo.tgbotapi.types.MessageIdentifier
|
import dev.inmo.tgbotapi.types.MessageId
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
import dev.inmo.tgbotapi.types.message.content.MediaGroupContent
|
import dev.inmo.tgbotapi.types.message.content.MediaGroupContent
|
||||||
import dev.inmo.tgbotapi.types.message.content.VisualMediaGroupContent
|
import dev.inmo.tgbotapi.types.message.content.VisualMediaGroupContent
|
||||||
@@ -22,7 +22,7 @@ suspend fun TelegramBot.sendMediaGroup(
|
|||||||
media: List<MediaGroupMemberTelegramMedia>,
|
media: List<MediaGroupMemberTelegramMedia>,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null
|
allowSendingWithoutReply: Boolean? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
SendMediaGroup<MediaGroupContent>(
|
SendMediaGroup<MediaGroupContent>(
|
||||||
@@ -39,7 +39,7 @@ suspend fun TelegramBot.sendMediaGroup(
|
|||||||
media: List<MediaGroupMemberTelegramMedia>,
|
media: List<MediaGroupMemberTelegramMedia>,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null
|
allowSendingWithoutReply: Boolean? = null
|
||||||
) = sendMediaGroup(
|
) = sendMediaGroup(
|
||||||
chat.id, media, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
chat.id, media, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
||||||
@@ -55,7 +55,7 @@ suspend fun TelegramBot.sendMediaGroup(
|
|||||||
media: List<MediaGroupContent>,
|
media: List<MediaGroupContent>,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null
|
allowSendingWithoutReply: Boolean? = null
|
||||||
) = sendMediaGroup(
|
) = sendMediaGroup(
|
||||||
chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
||||||
@@ -71,7 +71,7 @@ suspend fun TelegramBot.sendMediaGroup(
|
|||||||
media: List<MediaGroupContent>,
|
media: List<MediaGroupContent>,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null
|
allowSendingWithoutReply: Boolean? = null
|
||||||
) = sendMediaGroup(
|
) = sendMediaGroup(
|
||||||
chat.id, media, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
chat.id, media, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
||||||
@@ -85,7 +85,7 @@ suspend fun TelegramBot.sendPlaylist(
|
|||||||
media: List<AudioMediaGroupMemberTelegramMedia>,
|
media: List<AudioMediaGroupMemberTelegramMedia>,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null
|
allowSendingWithoutReply: Boolean? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
SendPlaylist(
|
SendPlaylist(
|
||||||
@@ -101,7 +101,7 @@ suspend fun TelegramBot.sendPlaylist(
|
|||||||
media: List<AudioMediaGroupMemberTelegramMedia>,
|
media: List<AudioMediaGroupMemberTelegramMedia>,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null
|
allowSendingWithoutReply: Boolean? = null
|
||||||
) = sendPlaylist(
|
) = sendPlaylist(
|
||||||
chat.id, media, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
chat.id, media, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
||||||
@@ -116,7 +116,7 @@ suspend fun TelegramBot.sendPlaylist(
|
|||||||
media: List<AudioContent>,
|
media: List<AudioContent>,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null
|
allowSendingWithoutReply: Boolean? = null
|
||||||
) = sendPlaylist(
|
) = sendPlaylist(
|
||||||
chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
||||||
@@ -131,7 +131,7 @@ suspend fun TelegramBot.sendPlaylist(
|
|||||||
media: List<AudioContent>,
|
media: List<AudioContent>,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null
|
allowSendingWithoutReply: Boolean? = null
|
||||||
) = sendPlaylist(
|
) = sendPlaylist(
|
||||||
chat.id, media, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
chat.id, media, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
||||||
@@ -145,7 +145,7 @@ suspend fun TelegramBot.sendDocumentsGroup(
|
|||||||
media: List<DocumentMediaGroupMemberTelegramMedia>,
|
media: List<DocumentMediaGroupMemberTelegramMedia>,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null
|
allowSendingWithoutReply: Boolean? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
SendDocumentsGroup(
|
SendDocumentsGroup(
|
||||||
@@ -161,7 +161,7 @@ suspend fun TelegramBot.sendDocumentsGroup(
|
|||||||
media: List<DocumentMediaGroupMemberTelegramMedia>,
|
media: List<DocumentMediaGroupMemberTelegramMedia>,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null
|
allowSendingWithoutReply: Boolean? = null
|
||||||
) = sendDocumentsGroup(
|
) = sendDocumentsGroup(
|
||||||
chat.id, media, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
chat.id, media, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
||||||
@@ -176,7 +176,7 @@ suspend fun TelegramBot.sendDocumentsGroup(
|
|||||||
media: List<DocumentContent>,
|
media: List<DocumentContent>,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null
|
allowSendingWithoutReply: Boolean? = null
|
||||||
) = sendDocumentsGroup(
|
) = sendDocumentsGroup(
|
||||||
chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
||||||
@@ -191,7 +191,7 @@ suspend fun TelegramBot.sendDocumentsGroup(
|
|||||||
media: List<DocumentContent>,
|
media: List<DocumentContent>,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null
|
allowSendingWithoutReply: Boolean? = null
|
||||||
) = sendDocumentsGroup(
|
) = sendDocumentsGroup(
|
||||||
chat.id, media, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
chat.id, media, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
||||||
@@ -205,7 +205,7 @@ suspend fun TelegramBot.sendVisualMediaGroup(
|
|||||||
media: List<VisualMediaGroupMemberTelegramMedia>,
|
media: List<VisualMediaGroupMemberTelegramMedia>,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null
|
allowSendingWithoutReply: Boolean? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
SendVisualMediaGroup(
|
SendVisualMediaGroup(
|
||||||
@@ -221,7 +221,7 @@ suspend fun TelegramBot.sendVisualMediaGroup(
|
|||||||
media: List<VisualMediaGroupMemberTelegramMedia>,
|
media: List<VisualMediaGroupMemberTelegramMedia>,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null
|
allowSendingWithoutReply: Boolean? = null
|
||||||
) = sendVisualMediaGroup(
|
) = sendVisualMediaGroup(
|
||||||
chat.id, media, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
chat.id, media, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
||||||
@@ -236,7 +236,7 @@ suspend fun TelegramBot.sendVisualMediaGroup(
|
|||||||
media: List<VisualMediaGroupContent>,
|
media: List<VisualMediaGroupContent>,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null
|
allowSendingWithoutReply: Boolean? = null
|
||||||
) = sendVisualMediaGroup(
|
) = sendVisualMediaGroup(
|
||||||
chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
||||||
@@ -251,7 +251,7 @@ suspend fun TelegramBot.sendVisualMediaGroup(
|
|||||||
media: List<VisualMediaGroupContent>,
|
media: List<VisualMediaGroupContent>,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null
|
allowSendingWithoutReply: Boolean? = null
|
||||||
) = sendVisualMediaGroup(
|
) = sendVisualMediaGroup(
|
||||||
chat.id, media, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
chat.id, media, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import dev.inmo.tgbotapi.requests.abstracts.InputFile
|
|||||||
import dev.inmo.tgbotapi.requests.send.media.SendPhoto
|
import dev.inmo.tgbotapi.requests.send.media.SendPhoto
|
||||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||||
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
||||||
import dev.inmo.tgbotapi.types.MessageIdentifier
|
import dev.inmo.tgbotapi.types.MessageId
|
||||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
@@ -22,7 +22,7 @@ suspend fun TelegramBot.sendPhoto(
|
|||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
@@ -50,7 +50,7 @@ suspend fun TelegramBot.sendPhoto(
|
|||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendPhoto(chat.id, fileId, text, parseMode, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendPhoto(chat.id, fileId, text, parseMode, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -66,7 +66,7 @@ suspend fun TelegramBot.sendPhoto(
|
|||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendPhoto(chatId, photo.biggest() ?.fileId ?: error("Photo content must not be empty"), text, parseMode, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendPhoto(chatId, photo.biggest() ?.fileId ?: error("Photo content must not be empty"), text, parseMode, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -82,7 +82,7 @@ suspend fun TelegramBot.sendPhoto(
|
|||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendPhoto(chat.id, photo, text, parseMode, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendPhoto(chat.id, photo, text, parseMode, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -98,7 +98,7 @@ suspend fun TelegramBot.sendPhoto(
|
|||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendPhoto(chatId, photoSize.fileId, text, parseMode, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendPhoto(chatId, photoSize.fileId, text, parseMode, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -114,7 +114,7 @@ suspend fun TelegramBot.sendPhoto(
|
|||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendPhoto(chat.id, photoSize, text, parseMode, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendPhoto(chat.id, photoSize, text, parseMode, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -130,7 +130,7 @@ suspend inline fun TelegramBot.sendPhoto(
|
|||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
@@ -156,7 +156,7 @@ suspend inline fun TelegramBot.sendPhoto(
|
|||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendPhoto(chat.id, fileId, entities, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendPhoto(chat.id, fileId, entities, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -171,7 +171,7 @@ suspend inline fun TelegramBot.sendPhoto(
|
|||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendPhoto(chatId, photo.biggest() ?.fileId ?: error("Photo content must not be empty"), entities, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendPhoto(chatId, photo.biggest() ?.fileId ?: error("Photo content must not be empty"), entities, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -186,7 +186,7 @@ suspend inline fun TelegramBot.sendPhoto(
|
|||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendPhoto(chat.id, photo, entities, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendPhoto(chat.id, photo, entities, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -201,7 +201,7 @@ suspend inline fun TelegramBot.sendPhoto(
|
|||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendPhoto(chatId, photoSize.fileId, entities, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendPhoto(chatId, photoSize.fileId, entities, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -216,7 +216,7 @@ suspend inline fun TelegramBot.sendPhoto(
|
|||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendPhoto(chat.id, photoSize, entities, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendPhoto(chat.id, photoSize, entities, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import dev.inmo.tgbotapi.bot.TelegramBot
|
|||||||
import dev.inmo.tgbotapi.requests.abstracts.InputFile
|
import dev.inmo.tgbotapi.requests.abstracts.InputFile
|
||||||
import dev.inmo.tgbotapi.requests.send.media.SendSticker
|
import dev.inmo.tgbotapi.requests.send.media.SendSticker
|
||||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||||
import dev.inmo.tgbotapi.types.MessageIdentifier
|
import dev.inmo.tgbotapi.types.MessageId
|
||||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
import dev.inmo.tgbotapi.types.files.Sticker
|
import dev.inmo.tgbotapi.types.files.Sticker
|
||||||
@@ -18,7 +18,7 @@ suspend fun TelegramBot.sendSticker(
|
|||||||
sticker: InputFile,
|
sticker: InputFile,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
@@ -34,7 +34,7 @@ suspend fun TelegramBot.sendSticker(
|
|||||||
sticker: InputFile,
|
sticker: InputFile,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendSticker(chat.id, sticker, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendSticker(chat.id, sticker, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -48,7 +48,7 @@ suspend fun TelegramBot.sendSticker(
|
|||||||
sticker: Sticker,
|
sticker: Sticker,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendSticker(chatId, sticker.fileId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendSticker(chatId, sticker.fileId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -62,7 +62,7 @@ suspend fun TelegramBot.sendSticker(
|
|||||||
sticker: Sticker,
|
sticker: Sticker,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendSticker(chat, sticker.fileId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendSticker(chat, sticker.fileId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import dev.inmo.tgbotapi.requests.abstracts.InputFile
|
|||||||
import dev.inmo.tgbotapi.requests.send.media.SendVideo
|
import dev.inmo.tgbotapi.requests.send.media.SendVideo
|
||||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||||
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
||||||
import dev.inmo.tgbotapi.types.MessageIdentifier
|
import dev.inmo.tgbotapi.types.MessageId
|
||||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
@@ -26,7 +26,7 @@ suspend fun TelegramBot.sendVideo(
|
|||||||
height: Int? = null,
|
height: Int? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
@@ -59,7 +59,7 @@ suspend fun TelegramBot.sendVideo(
|
|||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVideo(chatId, video.fileId, video.thumb ?.fileId, text, parseMode, video.duration, video.width, video.height, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendVideo(chatId, video.fileId, video.thumb ?.fileId, text, parseMode, video.duration, video.width, video.height, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -79,7 +79,7 @@ suspend fun TelegramBot.sendVideo(
|
|||||||
height: Int? = null,
|
height: Int? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVideo(chat.id, video, thumb, text, parseMode, duration, width, height, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendVideo(chat.id, video, thumb, text, parseMode, duration, width, height, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -96,7 +96,7 @@ suspend fun TelegramBot.sendVideo(
|
|||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVideo(chat.id, video, text, parseMode, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendVideo(chat.id, video, text, parseMode, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -115,7 +115,7 @@ suspend inline fun TelegramBot.sendVideo(
|
|||||||
height: Int? = null,
|
height: Int? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
@@ -146,7 +146,7 @@ suspend inline fun TelegramBot.sendVideo(
|
|||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVideo(chatId, video.fileId, video.thumb ?.fileId, entities, video.duration, video.width, video.height, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendVideo(chatId, video.fileId, video.thumb ?.fileId, entities, video.duration, video.width, video.height, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -165,7 +165,7 @@ suspend inline fun TelegramBot.sendVideo(
|
|||||||
height: Int? = null,
|
height: Int? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVideo(chat.id, video, thumb, entities, duration, width, height, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendVideo(chat.id, video, thumb, entities, duration, width, height, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -181,7 +181,7 @@ suspend inline fun TelegramBot.sendVideo(
|
|||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVideo(chat.id, video, entities, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendVideo(chat.id, video, entities, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import dev.inmo.tgbotapi.bot.TelegramBot
|
|||||||
import dev.inmo.tgbotapi.requests.abstracts.InputFile
|
import dev.inmo.tgbotapi.requests.abstracts.InputFile
|
||||||
import dev.inmo.tgbotapi.requests.send.media.SendVideoNote
|
import dev.inmo.tgbotapi.requests.send.media.SendVideoNote
|
||||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||||
import dev.inmo.tgbotapi.types.MessageIdentifier
|
import dev.inmo.tgbotapi.types.MessageId
|
||||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
import dev.inmo.tgbotapi.types.files.VideoNoteFile
|
import dev.inmo.tgbotapi.types.files.VideoNoteFile
|
||||||
@@ -21,7 +21,7 @@ suspend fun TelegramBot.sendVideoNote(
|
|||||||
size: Int? = null,
|
size: Int? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
@@ -48,7 +48,7 @@ suspend fun TelegramBot.sendVideoNote(
|
|||||||
videoNote: VideoNoteFile,
|
videoNote: VideoNoteFile,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVideoNote(
|
) = sendVideoNote(
|
||||||
@@ -67,7 +67,7 @@ suspend fun TelegramBot.sendVideoNote(
|
|||||||
size: Int? = null,
|
size: Int? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVideoNote(chat.id, videoNote, thumb, duration, size, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendVideoNote(chat.id, videoNote, thumb, duration, size, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -81,7 +81,7 @@ suspend fun TelegramBot.sendVideoNote(
|
|||||||
videoNote: VideoNoteFile,
|
videoNote: VideoNoteFile,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVideoNote(chat.id, videoNote, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendVideoNote(chat.id, videoNote, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import dev.inmo.tgbotapi.requests.abstracts.InputFile
|
|||||||
import dev.inmo.tgbotapi.requests.send.media.SendVoice
|
import dev.inmo.tgbotapi.requests.send.media.SendVoice
|
||||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||||
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
||||||
import dev.inmo.tgbotapi.types.MessageIdentifier
|
import dev.inmo.tgbotapi.types.MessageId
|
||||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
@@ -23,7 +23,7 @@ suspend fun TelegramBot.sendVoice(
|
|||||||
duration: Long? = null,
|
duration: Long? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
@@ -53,7 +53,7 @@ suspend fun TelegramBot.sendVoice(
|
|||||||
duration: Long? = null,
|
duration: Long? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVoice(chat.id, voice, text, parseMode, duration, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendVoice(chat.id, voice, text, parseMode, duration, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -69,7 +69,7 @@ suspend fun TelegramBot.sendVoice(
|
|||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVoice(
|
) = sendVoice(
|
||||||
@@ -87,7 +87,7 @@ suspend fun TelegramBot.sendVoice(
|
|||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVoice(chat.id, voice, text, parseMode, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendVoice(chat.id, voice, text, parseMode, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -104,7 +104,7 @@ suspend inline fun TelegramBot.sendVoice(
|
|||||||
duration: Long? = null,
|
duration: Long? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
@@ -132,7 +132,7 @@ suspend inline fun TelegramBot.sendVoice(
|
|||||||
duration: Long? = null,
|
duration: Long? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVoice(chat.id, voice, entities, duration, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendVoice(chat.id, voice, entities, duration, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -147,7 +147,7 @@ suspend inline fun TelegramBot.sendVoice(
|
|||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVoice(
|
) = sendVoice(
|
||||||
@@ -163,7 +163,7 @@ suspend inline fun TelegramBot.sendVoice(
|
|||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVoice(chat.id, voice, entities, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendVoice(chat.id, voice, entities, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ suspend fun TelegramBot.sendInvoice(
|
|||||||
priceDependOnShipAddress: Boolean = false,
|
priceDependOnShipAddress: Boolean = false,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
@@ -65,7 +65,7 @@ suspend fun TelegramBot.sendInvoice(
|
|||||||
priceDependOnShipAddress: Boolean = false,
|
priceDependOnShipAddress: Boolean = false,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = sendInvoice(user.id, title, description, payload, providerToken, currency, prices, maxTipAmount, suggestedTipAmounts, startParameter, providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendInvoice(user.id, title, description, payload, providerToken, currency, prices, maxTipAmount, suggestedTipAmounts, startParameter, providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import dev.inmo.tgbotapi.requests.send.polls.SendQuizPoll
|
|||||||
import dev.inmo.tgbotapi.requests.send.polls.SendRegularPoll
|
import dev.inmo.tgbotapi.requests.send.polls.SendRegularPoll
|
||||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||||
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
||||||
import dev.inmo.tgbotapi.types.MessageIdentifier
|
import dev.inmo.tgbotapi.types.MessageId
|
||||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
@@ -25,7 +25,7 @@ suspend fun TelegramBot.sendRegularPoll(
|
|||||||
closeInfo: ScheduledCloseInfo? = null,
|
closeInfo: ScheduledCloseInfo? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
@@ -48,7 +48,7 @@ suspend fun TelegramBot.sendRegularPoll(
|
|||||||
closeInfo: ScheduledCloseInfo? = null,
|
closeInfo: ScheduledCloseInfo? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendRegularPoll(chatId, question, options, isAnonymous, isClosed, allowMultipleAnswers, closeInfo, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendRegularPoll(chatId, question, options, isAnonymous, isClosed, allowMultipleAnswers, closeInfo, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -67,7 +67,7 @@ suspend fun TelegramBot.sendRegularPoll(
|
|||||||
closeInfo: ScheduledCloseInfo? = null,
|
closeInfo: ScheduledCloseInfo? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendRegularPoll(
|
) = sendRegularPoll(
|
||||||
@@ -89,7 +89,7 @@ suspend fun TelegramBot.sendRegularPoll(
|
|||||||
closeInfo: ScheduledCloseInfo? = null,
|
closeInfo: ScheduledCloseInfo? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendRegularPoll(
|
) = sendRegularPoll(
|
||||||
@@ -113,7 +113,7 @@ suspend fun TelegramBot.sendQuizPoll(
|
|||||||
closeInfo: ScheduledCloseInfo? = null,
|
closeInfo: ScheduledCloseInfo? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
@@ -138,7 +138,7 @@ suspend fun TelegramBot.sendQuizPoll(
|
|||||||
closeInfo: ScheduledCloseInfo? = null,
|
closeInfo: ScheduledCloseInfo? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendQuizPoll(
|
) = sendQuizPoll(
|
||||||
@@ -162,7 +162,7 @@ suspend fun TelegramBot.sendQuizPoll(
|
|||||||
closeInfo: ScheduledCloseInfo? = null,
|
closeInfo: ScheduledCloseInfo? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendQuizPoll(
|
) = sendQuizPoll(
|
||||||
@@ -186,7 +186,7 @@ suspend fun TelegramBot.sendQuizPoll(
|
|||||||
closeInfo: ScheduledCloseInfo? = null,
|
closeInfo: ScheduledCloseInfo? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendQuizPoll(
|
) = sendQuizPoll(
|
||||||
@@ -209,7 +209,7 @@ suspend inline fun TelegramBot.sendQuizPoll(
|
|||||||
closeInfo: ScheduledCloseInfo? = null,
|
closeInfo: ScheduledCloseInfo? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
@@ -233,7 +233,7 @@ suspend inline fun TelegramBot.sendQuizPoll(
|
|||||||
closeInfo: ScheduledCloseInfo? = null,
|
closeInfo: ScheduledCloseInfo? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendQuizPoll(
|
) = sendQuizPoll(
|
||||||
@@ -256,7 +256,7 @@ suspend inline fun TelegramBot.sendQuizPoll(
|
|||||||
closeInfo: ScheduledCloseInfo? = null,
|
closeInfo: ScheduledCloseInfo? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendQuizPoll(
|
) = sendQuizPoll(
|
||||||
@@ -279,7 +279,7 @@ suspend inline fun TelegramBot.sendQuizPoll(
|
|||||||
closeInfo: ScheduledCloseInfo? = null,
|
closeInfo: ScheduledCloseInfo? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendQuizPoll(
|
) = sendQuizPoll(
|
||||||
|
|||||||
@@ -0,0 +1,54 @@
|
|||||||
|
package dev.inmo.tgbotapi.extensions.api.stickers
|
||||||
|
|
||||||
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
|
import dev.inmo.tgbotapi.requests.abstracts.FileId
|
||||||
|
import dev.inmo.tgbotapi.requests.abstracts.MultipartFile
|
||||||
|
import dev.inmo.tgbotapi.requests.stickers.*
|
||||||
|
import dev.inmo.tgbotapi.types.chat.CommonUser
|
||||||
|
import dev.inmo.tgbotapi.types.UserId
|
||||||
|
import dev.inmo.tgbotapi.types.stickers.MaskPosition
|
||||||
|
|
||||||
|
suspend fun TelegramBot.createNewMaskAnimatedStickerSet(
|
||||||
|
userId: UserId,
|
||||||
|
name: String,
|
||||||
|
title: String,
|
||||||
|
sticker: FileId,
|
||||||
|
emojis: String,
|
||||||
|
maskPosition: MaskPosition
|
||||||
|
) = execute(
|
||||||
|
CreateNewMaskAnimatedStickerSet(userId, name, title, sticker, emojis, maskPosition)
|
||||||
|
)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.createNewMaskAnimatedStickerSet(
|
||||||
|
userId: UserId,
|
||||||
|
name: String,
|
||||||
|
title: String,
|
||||||
|
sticker: MultipartFile,
|
||||||
|
emojis: String,
|
||||||
|
maskPosition: MaskPosition
|
||||||
|
) = execute(
|
||||||
|
CreateNewMaskAnimatedStickerSet(userId, name, title, sticker, emojis, maskPosition)
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
suspend fun TelegramBot.createNewMaskAnimatedStickerSet(
|
||||||
|
user: CommonUser,
|
||||||
|
name: String,
|
||||||
|
title: String,
|
||||||
|
sticker: FileId,
|
||||||
|
emojis: String,
|
||||||
|
maskPosition: MaskPosition
|
||||||
|
) = createNewMaskAnimatedStickerSet(
|
||||||
|
user.id, name, title, sticker, emojis, maskPosition
|
||||||
|
)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.createNewMaskAnimatedStickerSet(
|
||||||
|
user: CommonUser,
|
||||||
|
name: String,
|
||||||
|
title: String,
|
||||||
|
sticker: MultipartFile,
|
||||||
|
emojis: String,
|
||||||
|
maskPosition: MaskPosition
|
||||||
|
) = createNewMaskAnimatedStickerSet(
|
||||||
|
user.id, name, title, sticker, emojis, maskPosition
|
||||||
|
)
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
package dev.inmo.tgbotapi.extensions.api.stickers
|
||||||
|
|
||||||
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
|
import dev.inmo.tgbotapi.requests.abstracts.FileId
|
||||||
|
import dev.inmo.tgbotapi.requests.abstracts.MultipartFile
|
||||||
|
import dev.inmo.tgbotapi.requests.stickers.*
|
||||||
|
import dev.inmo.tgbotapi.types.chat.CommonUser
|
||||||
|
import dev.inmo.tgbotapi.types.UserId
|
||||||
|
import dev.inmo.tgbotapi.types.stickers.MaskPosition
|
||||||
|
|
||||||
|
suspend fun TelegramBot.createNewMaskStickerSet(
|
||||||
|
userId: UserId,
|
||||||
|
name: String,
|
||||||
|
title: String,
|
||||||
|
sticker: FileId,
|
||||||
|
emojis: String,
|
||||||
|
maskPosition: MaskPosition
|
||||||
|
) = execute(
|
||||||
|
CreateNewMaskStickerSet(userId, name, title, sticker, emojis, maskPosition)
|
||||||
|
)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.createNewMaskStickerSet(
|
||||||
|
userId: UserId,
|
||||||
|
name: String,
|
||||||
|
title: String,
|
||||||
|
sticker: MultipartFile,
|
||||||
|
emojis: String,
|
||||||
|
maskPosition: MaskPosition
|
||||||
|
) = execute(
|
||||||
|
CreateNewMaskStickerSet(userId, name, title, sticker, emojis, maskPosition)
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
suspend fun TelegramBot.createNewMaskStickerSet(
|
||||||
|
user: CommonUser,
|
||||||
|
name: String,
|
||||||
|
title: String,
|
||||||
|
sticker: FileId,
|
||||||
|
emojis: String,
|
||||||
|
maskPosition: MaskPosition
|
||||||
|
) = createNewMaskStickerSet(
|
||||||
|
user.id, name, title, sticker, emojis, maskPosition
|
||||||
|
)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.createNewMaskStickerSet(
|
||||||
|
user: CommonUser,
|
||||||
|
name: String,
|
||||||
|
title: String,
|
||||||
|
sticker: MultipartFile,
|
||||||
|
emojis: String,
|
||||||
|
maskPosition: MaskPosition
|
||||||
|
) = createNewMaskStickerSet(
|
||||||
|
user.id, name, title, sticker, emojis, maskPosition
|
||||||
|
)
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
package dev.inmo.tgbotapi.extensions.api.stickers
|
||||||
|
|
||||||
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
|
import dev.inmo.tgbotapi.requests.abstracts.FileId
|
||||||
|
import dev.inmo.tgbotapi.requests.abstracts.MultipartFile
|
||||||
|
import dev.inmo.tgbotapi.requests.stickers.*
|
||||||
|
import dev.inmo.tgbotapi.types.chat.CommonUser
|
||||||
|
import dev.inmo.tgbotapi.types.UserId
|
||||||
|
import dev.inmo.tgbotapi.types.stickers.MaskPosition
|
||||||
|
|
||||||
|
suspend fun TelegramBot.createNewMaskVideoStickerSet(
|
||||||
|
userId: UserId,
|
||||||
|
name: String,
|
||||||
|
title: String,
|
||||||
|
sticker: FileId,
|
||||||
|
emojis: String,
|
||||||
|
maskPosition: MaskPosition
|
||||||
|
) = execute(
|
||||||
|
CreateNewMaskVideoStickerSet(userId, name, title, sticker, emojis, maskPosition)
|
||||||
|
)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.createNewMaskVideoStickerSet(
|
||||||
|
userId: UserId,
|
||||||
|
name: String,
|
||||||
|
title: String,
|
||||||
|
sticker: MultipartFile,
|
||||||
|
emojis: String,
|
||||||
|
maskPosition: MaskPosition
|
||||||
|
) = execute(
|
||||||
|
CreateNewMaskVideoStickerSet(userId, name, title, sticker, emojis, maskPosition)
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
suspend fun TelegramBot.createNewMaskVideoStickerSet(
|
||||||
|
user: CommonUser,
|
||||||
|
name: String,
|
||||||
|
title: String,
|
||||||
|
sticker: FileId,
|
||||||
|
emojis: String,
|
||||||
|
maskPosition: MaskPosition
|
||||||
|
) = createNewMaskVideoStickerSet(
|
||||||
|
user.id, name, title, sticker, emojis, maskPosition
|
||||||
|
)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.createNewMaskVideoStickerSet(
|
||||||
|
user: CommonUser,
|
||||||
|
name: String,
|
||||||
|
title: String,
|
||||||
|
sticker: MultipartFile,
|
||||||
|
emojis: String,
|
||||||
|
maskPosition: MaskPosition
|
||||||
|
) = createNewMaskVideoStickerSet(
|
||||||
|
user.id, name, title, sticker, emojis, maskPosition
|
||||||
|
)
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
package dev.inmo.tgbotapi.extensions.api.stickers
|
||||||
|
|
||||||
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
|
import dev.inmo.tgbotapi.requests.abstracts.FileId
|
||||||
|
import dev.inmo.tgbotapi.requests.abstracts.MultipartFile
|
||||||
|
import dev.inmo.tgbotapi.requests.stickers.*
|
||||||
|
import dev.inmo.tgbotapi.types.chat.CommonUser
|
||||||
|
import dev.inmo.tgbotapi.types.UserId
|
||||||
|
import dev.inmo.tgbotapi.types.stickers.MaskPosition
|
||||||
|
|
||||||
|
suspend fun TelegramBot.createNewRegularAnimatedStickerSet(
|
||||||
|
userId: UserId,
|
||||||
|
name: String,
|
||||||
|
title: String,
|
||||||
|
sticker: FileId,
|
||||||
|
emojis: String
|
||||||
|
) = execute(
|
||||||
|
CreateNewRegularAnimatedStickerSet(userId, name, title, sticker, emojis)
|
||||||
|
)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.createNewRegularAnimatedStickerSet(
|
||||||
|
userId: UserId,
|
||||||
|
name: String,
|
||||||
|
title: String,
|
||||||
|
sticker: MultipartFile,
|
||||||
|
emojis: String
|
||||||
|
) = execute(
|
||||||
|
CreateNewRegularAnimatedStickerSet(userId, name, title, sticker, emojis)
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
suspend fun TelegramBot.createNewRegularAnimatedStickerSet(
|
||||||
|
user: CommonUser,
|
||||||
|
name: String,
|
||||||
|
title: String,
|
||||||
|
sticker: FileId,
|
||||||
|
emojis: String
|
||||||
|
) = createNewRegularAnimatedStickerSet(
|
||||||
|
user.id, name, title, sticker, emojis
|
||||||
|
)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.createNewRegularAnimatedStickerSet(
|
||||||
|
user: CommonUser,
|
||||||
|
name: String,
|
||||||
|
title: String,
|
||||||
|
sticker: MultipartFile,
|
||||||
|
emojis: String
|
||||||
|
) = createNewRegularAnimatedStickerSet(
|
||||||
|
user.id, name, title, sticker, emojis
|
||||||
|
)
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
package dev.inmo.tgbotapi.extensions.api.stickers
|
||||||
|
|
||||||
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
|
import dev.inmo.tgbotapi.requests.abstracts.FileId
|
||||||
|
import dev.inmo.tgbotapi.requests.abstracts.MultipartFile
|
||||||
|
import dev.inmo.tgbotapi.requests.stickers.*
|
||||||
|
import dev.inmo.tgbotapi.types.chat.CommonUser
|
||||||
|
import dev.inmo.tgbotapi.types.UserId
|
||||||
|
import dev.inmo.tgbotapi.types.stickers.MaskPosition
|
||||||
|
|
||||||
|
suspend fun TelegramBot.createNewRegularStickerSet(
|
||||||
|
userId: UserId,
|
||||||
|
name: String,
|
||||||
|
title: String,
|
||||||
|
sticker: FileId,
|
||||||
|
emojis: String
|
||||||
|
) = execute(
|
||||||
|
CreateNewRegularStickerSet(userId, name, title, sticker, emojis)
|
||||||
|
)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.createNewRegularStickerSet(
|
||||||
|
userId: UserId,
|
||||||
|
name: String,
|
||||||
|
title: String,
|
||||||
|
sticker: MultipartFile,
|
||||||
|
emojis: String
|
||||||
|
) = execute(
|
||||||
|
CreateNewRegularStickerSet(userId, name, title, sticker, emojis)
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
suspend fun TelegramBot.createNewRegularStickerSet(
|
||||||
|
user: CommonUser,
|
||||||
|
name: String,
|
||||||
|
title: String,
|
||||||
|
sticker: FileId,
|
||||||
|
emojis: String
|
||||||
|
) = createNewRegularStickerSet(
|
||||||
|
user.id, name, title, sticker, emojis
|
||||||
|
)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.createNewRegularStickerSet(
|
||||||
|
user: CommonUser,
|
||||||
|
name: String,
|
||||||
|
title: String,
|
||||||
|
sticker: MultipartFile,
|
||||||
|
emojis: String
|
||||||
|
) = createNewRegularStickerSet(
|
||||||
|
user.id, name, title, sticker, emojis
|
||||||
|
)
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
package dev.inmo.tgbotapi.extensions.api.stickers
|
||||||
|
|
||||||
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
|
import dev.inmo.tgbotapi.requests.abstracts.FileId
|
||||||
|
import dev.inmo.tgbotapi.requests.abstracts.MultipartFile
|
||||||
|
import dev.inmo.tgbotapi.requests.stickers.*
|
||||||
|
import dev.inmo.tgbotapi.types.chat.CommonUser
|
||||||
|
import dev.inmo.tgbotapi.types.UserId
|
||||||
|
import dev.inmo.tgbotapi.types.stickers.MaskPosition
|
||||||
|
|
||||||
|
suspend fun TelegramBot.createNewRegularVideoStickerSet(
|
||||||
|
userId: UserId,
|
||||||
|
name: String,
|
||||||
|
title: String,
|
||||||
|
sticker: FileId,
|
||||||
|
emojis: String
|
||||||
|
) = execute(
|
||||||
|
CreateNewRegularVideoStickerSet(userId, name, title, sticker, emojis)
|
||||||
|
)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.createNewRegularVideoStickerSet(
|
||||||
|
userId: UserId,
|
||||||
|
name: String,
|
||||||
|
title: String,
|
||||||
|
sticker: MultipartFile,
|
||||||
|
emojis: String
|
||||||
|
) = execute(
|
||||||
|
CreateNewRegularVideoStickerSet(userId, name, title, sticker, emojis)
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
suspend fun TelegramBot.createNewRegularVideoStickerSet(
|
||||||
|
user: CommonUser,
|
||||||
|
name: String,
|
||||||
|
title: String,
|
||||||
|
sticker: FileId,
|
||||||
|
emojis: String
|
||||||
|
) = createNewRegularVideoStickerSet(
|
||||||
|
user.id, name, title, sticker, emojis
|
||||||
|
)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.createNewRegularVideoStickerSet(
|
||||||
|
user: CommonUser,
|
||||||
|
name: String,
|
||||||
|
title: String,
|
||||||
|
sticker: MultipartFile,
|
||||||
|
emojis: String
|
||||||
|
) = createNewRegularVideoStickerSet(
|
||||||
|
user.id, name, title, sticker, emojis
|
||||||
|
)
|
||||||
@@ -4,6 +4,7 @@ import dev.inmo.tgbotapi.bot.TelegramBot
|
|||||||
import dev.inmo.tgbotapi.requests.abstracts.FileId
|
import dev.inmo.tgbotapi.requests.abstracts.FileId
|
||||||
import dev.inmo.tgbotapi.requests.abstracts.MultipartFile
|
import dev.inmo.tgbotapi.requests.abstracts.MultipartFile
|
||||||
import dev.inmo.tgbotapi.requests.webhook.SetWebhook
|
import dev.inmo.tgbotapi.requests.webhook.SetWebhook
|
||||||
|
import dev.inmo.tgbotapi.types.ALL_UPDATES_LIST
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Use this method to send information about webhook (like [url])
|
* Use this method to send information about webhook (like [url])
|
||||||
@@ -12,7 +13,7 @@ suspend fun TelegramBot.setWebhookInfo(
|
|||||||
url: String,
|
url: String,
|
||||||
ipAddress: String? = null,
|
ipAddress: String? = null,
|
||||||
maxAllowedConnections: Int? = null,
|
maxAllowedConnections: Int? = null,
|
||||||
allowedUpdates: List<String>? = null,
|
allowedUpdates: List<String>? = ALL_UPDATES_LIST,
|
||||||
dropPendingUpdates: Boolean? = null,
|
dropPendingUpdates: Boolean? = null,
|
||||||
secretToken: String? = null
|
secretToken: String? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
@@ -29,7 +30,7 @@ suspend fun TelegramBot.setWebhookInfo(
|
|||||||
certificate: FileId,
|
certificate: FileId,
|
||||||
ipAddress: String? = null,
|
ipAddress: String? = null,
|
||||||
maxAllowedConnections: Int? = null,
|
maxAllowedConnections: Int? = null,
|
||||||
allowedUpdates: List<String>? = null,
|
allowedUpdates: List<String>? = ALL_UPDATES_LIST,
|
||||||
dropPendingUpdates: Boolean? = null,
|
dropPendingUpdates: Boolean? = null,
|
||||||
secretToken: String? = null
|
secretToken: String? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
@@ -46,7 +47,7 @@ suspend fun TelegramBot.setWebhookInfo(
|
|||||||
certificate: MultipartFile,
|
certificate: MultipartFile,
|
||||||
ipAddress: String? = null,
|
ipAddress: String? = null,
|
||||||
maxAllowedConnections: Int? = null,
|
maxAllowedConnections: Int? = null,
|
||||||
allowedUpdates: List<String>? = null,
|
allowedUpdates: List<String>? = ALL_UPDATES_LIST,
|
||||||
dropPendingUpdates: Boolean? = null,
|
dropPendingUpdates: Boolean? = null,
|
||||||
secretToken: String? = null
|
secretToken: String? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import dev.inmo.tgbotapi.bot.TelegramBot
|
|||||||
import dev.inmo.tgbotapi.extensions.utils.updates.retrieving.longPolling
|
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.startGettingOfUpdatesByLongPolling
|
||||||
import dev.inmo.tgbotapi.updateshandlers.FlowsUpdatesFilter
|
import dev.inmo.tgbotapi.updateshandlers.FlowsUpdatesFilter
|
||||||
import dev.inmo.tgbotapi.utils.PreviewFeature
|
|
||||||
import kotlinx.coroutines.*
|
import kotlinx.coroutines.*
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -57,20 +57,6 @@ interface BehaviourContext : FlowsUpdatesFilter, TelegramBot, CoroutineScope {
|
|||||||
upstreamUpdatesFlow: Flow<Update>? = null,
|
upstreamUpdatesFlow: Flow<Update>? = null,
|
||||||
triggersHolder: TriggersHolder = TriggersHolder()
|
triggersHolder: TriggersHolder = TriggersHolder()
|
||||||
): BehaviourContext
|
): BehaviourContext
|
||||||
|
|
||||||
/**
|
|
||||||
* @param updatesFilter unused
|
|
||||||
*/
|
|
||||||
@Deprecated("Do not use this method")
|
|
||||||
fun copy(
|
|
||||||
bot: TelegramBot = this.bot,
|
|
||||||
scope: CoroutineScope = this.scope,
|
|
||||||
broadcastChannelsSize: Int = 100,
|
|
||||||
onBufferOverflow: BufferOverflow = BufferOverflow.SUSPEND,
|
|
||||||
upstreamUpdatesFlow: Flow<Update>? = null,
|
|
||||||
triggersHolder: TriggersHolder = TriggersHolder(),
|
|
||||||
updatesFilter: BehaviourContextAndTypeReceiver<Boolean, Update>? = null
|
|
||||||
): BehaviourContext = copy(bot, scope, broadcastChannelsSize, onBufferOverflow, upstreamUpdatesFlow, triggersHolder)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class DefaultBehaviourContext(
|
class DefaultBehaviourContext(
|
||||||
@@ -79,9 +65,7 @@ class DefaultBehaviourContext(
|
|||||||
broadcastChannelsSize: Int = 100,
|
broadcastChannelsSize: Int = 100,
|
||||||
onBufferOverflow: BufferOverflow = BufferOverflow.SUSPEND,
|
onBufferOverflow: BufferOverflow = BufferOverflow.SUSPEND,
|
||||||
private val upstreamUpdatesFlow: Flow<Update>? = null,
|
private val upstreamUpdatesFlow: Flow<Update>? = null,
|
||||||
override val triggersHolder: TriggersHolder = TriggersHolder(),
|
override val triggersHolder: TriggersHolder = TriggersHolder()
|
||||||
@Deprecated("This parameter is not used anymore")
|
|
||||||
private val updatesFilter: BehaviourContextAndTypeReceiver<Boolean, Update>? = null
|
|
||||||
) : AbstractFlowsUpdatesFilter(), TelegramBot by bot, CoroutineScope by scope, BehaviourContext {
|
) : AbstractFlowsUpdatesFilter(), TelegramBot by bot, CoroutineScope by scope, BehaviourContext {
|
||||||
|
|
||||||
private val additionalUpdatesSharedFlow = MutableSharedFlow<Update>(0, broadcastChannelsSize, onBufferOverflow)
|
private val additionalUpdatesSharedFlow = MutableSharedFlow<Update>(0, broadcastChannelsSize, onBufferOverflow)
|
||||||
@@ -137,19 +121,6 @@ fun <BC : BehaviourContext> BC.createSubContext(
|
|||||||
triggersHolder = triggersHolder
|
triggersHolder = triggersHolder
|
||||||
) as BC
|
) as BC
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates new [BehaviourContext] using its [BehaviourContext.copy] method
|
|
||||||
*
|
|
||||||
* @param updatesFilter This param will not be used anymore
|
|
||||||
*/
|
|
||||||
@Deprecated("It is not recommended to use updates filter anymore")
|
|
||||||
fun <BC : BehaviourContext> BC.createSubContext(
|
|
||||||
scope: CoroutineScope = LinkedSupervisorScope(),
|
|
||||||
triggersHolder: TriggersHolder = this.triggersHolder,
|
|
||||||
updatesUpstreamFlow: Flow<Update> = allUpdatesFlow,
|
|
||||||
updatesFilter: CustomBehaviourContextAndTypeReceiver<BC, Boolean, Update>?,
|
|
||||||
) = createSubContext(scope, triggersHolder, updatesUpstreamFlow)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Launch [behaviourContextReceiver] in context of [this] as [BehaviourContext] and as [kotlin.coroutines.CoroutineContext]
|
* Launch [behaviourContextReceiver] in context of [this] as [BehaviourContext] and as [kotlin.coroutines.CoroutineContext]
|
||||||
*
|
*
|
||||||
@@ -187,27 +158,6 @@ suspend fun <T, BC : BehaviourContext> BC.createSubContextAndDoWithUpdatesFilter
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates new one [BehaviourContext] using [createSubContext] and launches [behaviourContextReceiver] in a new context
|
|
||||||
* using [doInContext]
|
|
||||||
*
|
|
||||||
* @param stopOnCompletion ___TRUE BY DEFAULT___
|
|
||||||
* @param updatesFilter Is not used anymore
|
|
||||||
*/
|
|
||||||
@Deprecated("It is not recommended to use updates filter anymore")
|
|
||||||
suspend fun <T, BC : BehaviourContext> BC.createSubContextAndDoWithUpdatesFilter(
|
|
||||||
scope: CoroutineScope = LinkedSupervisorScope(),
|
|
||||||
triggersHolder: TriggersHolder = this.triggersHolder,
|
|
||||||
updatesUpstreamFlow: Flow<Update> = allUpdatesFlow,
|
|
||||||
updatesFilter: CustomBehaviourContextAndTypeReceiver<BC, Boolean, Update>?,
|
|
||||||
stopOnCompletion: Boolean = true,
|
|
||||||
behaviourContextReceiver: CustomBehaviourContextReceiver<BC, T>
|
|
||||||
): T {
|
|
||||||
return createSubContextAndDoWithUpdatesFilter(
|
|
||||||
scope, triggersHolder, updatesUpstreamFlow, stopOnCompletion, behaviourContextReceiver
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method will cancel ALL subsequent contexts, expectations and waiters
|
* This method will cancel ALL subsequent contexts, expectations and waiters
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.behaviour_builder
|
package dev.inmo.tgbotapi.extensions.behaviour_builder
|
||||||
|
|
||||||
import dev.inmo.micro_utils.coroutines.ExceptionHandler
|
import dev.inmo.micro_utils.coroutines.ExceptionHandler
|
||||||
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.bot.ktor.KtorRequestsExecutorBuilder
|
import dev.inmo.tgbotapi.bot.ktor.KtorRequestsExecutorBuilder
|
||||||
import dev.inmo.tgbotapi.bot.ktor.telegramBot
|
import dev.inmo.tgbotapi.bot.ktor.telegramBot
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
|
||||||
import dev.inmo.tgbotapi.extensions.utils.updates.retrieving.startGettingOfUpdatesByLongPolling
|
import dev.inmo.tgbotapi.extensions.utils.updates.retrieving.startGettingOfUpdatesByLongPolling
|
||||||
import dev.inmo.tgbotapi.updateshandlers.FlowsUpdatesFilter
|
import dev.inmo.tgbotapi.updateshandlers.FlowsUpdatesFilter
|
||||||
import dev.inmo.tgbotapi.utils.telegramBotAPIDefaultUrl
|
import dev.inmo.tgbotapi.utils.telegramBotAPIDefaultUrl
|
||||||
|
|||||||
@@ -3,14 +3,12 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations
|
package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations
|
||||||
|
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter
|
import dev.inmo.tgbotapi.extensions.utils.callbackQueryUpdateOrNull
|
||||||
import dev.inmo.tgbotapi.extensions.utils.asCallbackQueryUpdate
|
|
||||||
import dev.inmo.tgbotapi.requests.abstracts.Request
|
import dev.inmo.tgbotapi.requests.abstracts.Request
|
||||||
import dev.inmo.tgbotapi.types.queries.callback.*
|
import dev.inmo.tgbotapi.types.queries.callback.*
|
||||||
import dev.inmo.tgbotapi.utils.RiskFeature
|
import dev.inmo.tgbotapi.utils.RiskFeature
|
||||||
import dev.inmo.tgbotapi.utils.lowLevelRiskFeatureMessage
|
import dev.inmo.tgbotapi.utils.lowLevelRiskFeatureMessage
|
||||||
import kotlinx.coroutines.flow.Flow
|
import kotlinx.coroutines.flow.Flow
|
||||||
import kotlinx.coroutines.flow.toList
|
|
||||||
|
|
||||||
typealias CallbackQueryMapper<T> = suspend T.() -> T?
|
typealias CallbackQueryMapper<T> = suspend T.() -> T?
|
||||||
|
|
||||||
@@ -22,7 +20,7 @@ suspend inline fun <reified O> BehaviourContext.waitCallbackQueries(
|
|||||||
initRequest,
|
initRequest,
|
||||||
errorFactory
|
errorFactory
|
||||||
) {
|
) {
|
||||||
(it.asCallbackQueryUpdate() ?.data as O).let(::listOfNotNull)
|
(it.callbackQueryUpdateOrNull() ?.data as O).let(::listOfNotNull)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,12 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations
|
package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations
|
||||||
|
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter
|
import dev.inmo.tgbotapi.extensions.utils.chatJoinRequestUpdateOrNull
|
||||||
import dev.inmo.tgbotapi.extensions.utils.asChatJoinRequestUpdate
|
|
||||||
import dev.inmo.tgbotapi.requests.abstracts.Request
|
import dev.inmo.tgbotapi.requests.abstracts.Request
|
||||||
import dev.inmo.tgbotapi.types.chat.ChatJoinRequest
|
import dev.inmo.tgbotapi.types.chat.ChatJoinRequest
|
||||||
import dev.inmo.tgbotapi.utils.RiskFeature
|
import dev.inmo.tgbotapi.utils.RiskFeature
|
||||||
import dev.inmo.tgbotapi.utils.lowLevelRiskFeatureMessage
|
import dev.inmo.tgbotapi.utils.lowLevelRiskFeatureMessage
|
||||||
import kotlinx.coroutines.flow.Flow
|
import kotlinx.coroutines.flow.Flow
|
||||||
import kotlinx.coroutines.flow.toList
|
|
||||||
|
|
||||||
typealias ChatJoinRequestsMapper = suspend ChatJoinRequest.() -> ChatJoinRequest?
|
typealias ChatJoinRequestsMapper = suspend ChatJoinRequest.() -> ChatJoinRequest?
|
||||||
|
|
||||||
@@ -20,7 +18,7 @@ suspend inline fun <reified O> BehaviourContext.internalWaitChatJoinRequests(
|
|||||||
initRequest,
|
initRequest,
|
||||||
errorFactory
|
errorFactory
|
||||||
) {
|
) {
|
||||||
(it.asChatJoinRequestUpdate() ?.data as? O).let(::listOfNotNull)
|
(it.chatJoinRequestUpdateOrNull() ?.data as? O).let(::listOfNotNull)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations
|
package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations
|
||||||
|
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter
|
|
||||||
import dev.inmo.tgbotapi.requests.abstracts.Request
|
import dev.inmo.tgbotapi.requests.abstracts.Request
|
||||||
import dev.inmo.tgbotapi.types.chat.member.ChatMemberUpdated
|
import dev.inmo.tgbotapi.types.chat.member.ChatMemberUpdated
|
||||||
import dev.inmo.tgbotapi.types.update.CommonChatMemberUpdatedUpdate
|
import dev.inmo.tgbotapi.types.update.CommonChatMemberUpdatedUpdate
|
||||||
@@ -10,7 +9,6 @@ import dev.inmo.tgbotapi.types.update.abstracts.ChatMemberUpdatedUpdate
|
|||||||
import dev.inmo.tgbotapi.utils.RiskFeature
|
import dev.inmo.tgbotapi.utils.RiskFeature
|
||||||
import dev.inmo.tgbotapi.utils.lowLevelRiskFeatureMessage
|
import dev.inmo.tgbotapi.utils.lowLevelRiskFeatureMessage
|
||||||
import kotlinx.coroutines.flow.Flow
|
import kotlinx.coroutines.flow.Flow
|
||||||
import kotlinx.coroutines.flow.toList
|
|
||||||
|
|
||||||
typealias ChatMemberUpdatedMapper<T> = suspend T.() -> T?
|
typealias ChatMemberUpdatedMapper<T> = suspend T.() -> T?
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,12 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations
|
package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations
|
||||||
|
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter
|
import dev.inmo.tgbotapi.extensions.utils.chosenInlineResultUpdateOrNull
|
||||||
import dev.inmo.tgbotapi.extensions.utils.asChosenInlineResultUpdate
|
|
||||||
import dev.inmo.tgbotapi.requests.abstracts.Request
|
import dev.inmo.tgbotapi.requests.abstracts.Request
|
||||||
import dev.inmo.tgbotapi.types.InlineQueries.ChosenInlineResult.*
|
import dev.inmo.tgbotapi.types.InlineQueries.ChosenInlineResult.*
|
||||||
import dev.inmo.tgbotapi.utils.RiskFeature
|
import dev.inmo.tgbotapi.utils.RiskFeature
|
||||||
import dev.inmo.tgbotapi.utils.lowLevelRiskFeatureMessage
|
import dev.inmo.tgbotapi.utils.lowLevelRiskFeatureMessage
|
||||||
import kotlinx.coroutines.flow.Flow
|
import kotlinx.coroutines.flow.Flow
|
||||||
import kotlinx.coroutines.flow.toList
|
|
||||||
|
|
||||||
typealias ChosenInlineResultMapper<T> = suspend T.() -> T?
|
typealias ChosenInlineResultMapper<T> = suspend T.() -> T?
|
||||||
|
|
||||||
@@ -20,7 +18,7 @@ suspend inline fun <reified O> BehaviourContext.waitChosenInlineResults(
|
|||||||
initRequest,
|
initRequest,
|
||||||
errorFactory
|
errorFactory
|
||||||
) {
|
) {
|
||||||
(it.asChosenInlineResultUpdate() ?.data as? O).let(::listOfNotNull)
|
(it.chosenInlineResultUpdateOrNull() ?.data as? O).let(::listOfNotNull)
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun BehaviourContext.waitChosenInlineResult(
|
suspend fun BehaviourContext.waitChosenInlineResult(
|
||||||
|
|||||||
@@ -0,0 +1,119 @@
|
|||||||
|
package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations
|
||||||
|
|
||||||
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
|
||||||
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.handlers_registrar.doWithRegistration
|
||||||
|
import dev.inmo.tgbotapi.extensions.utils.*
|
||||||
|
import dev.inmo.tgbotapi.requests.abstracts.Request
|
||||||
|
import dev.inmo.tgbotapi.types.message.abstracts.CommonMessage
|
||||||
|
import dev.inmo.tgbotapi.types.message.content.TextContent
|
||||||
|
import dev.inmo.tgbotapi.types.message.textsources.BotCommandTextSource
|
||||||
|
import dev.inmo.tgbotapi.types.message.textsources.TextSource
|
||||||
|
import kotlinx.coroutines.flow.*
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Will filter all the messages and include required commands with [commandRegex].
|
||||||
|
*
|
||||||
|
* * In case you wish to get only the commands at the start of message, use [requireCommandAtStart]
|
||||||
|
* * In case you wish to exclude messages with more than one command, you may use [requireSingleCommand]
|
||||||
|
* * In case you wish to exclude messages with commands params, you may use [requireCommandsWithoutParams]
|
||||||
|
*/
|
||||||
|
suspend fun BehaviourContext.waitCommandMessage(
|
||||||
|
commandRegex: Regex,
|
||||||
|
initRequest: Request<*>? = null,
|
||||||
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
|
) = channelFlow {
|
||||||
|
triggersHolder.handleableCommandsHolder.doWithRegistration(
|
||||||
|
commandRegex
|
||||||
|
) {
|
||||||
|
waitTextMessage(initRequest, errorFactory).filter {
|
||||||
|
it.content.textSources.any { it.botCommandTextSourceOrNull() ?.command ?.matches(commandRegex) == true }
|
||||||
|
}.collect {
|
||||||
|
send(it)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
suspend fun BehaviourContext.waitCommandMessage(
|
||||||
|
command: String,
|
||||||
|
initRequest: Request<*>? = null,
|
||||||
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
|
) = waitCommandMessage(Regex(command), initRequest, errorFactory)
|
||||||
|
|
||||||
|
fun Flow<CommonMessage<TextContent>>.requireCommandAtStart() = filter {
|
||||||
|
it.content.textSources.firstOrNull() is BotCommandTextSource
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Subsequent [Flow] will retrieve only messages with ONE [BotCommandTextSource]. It does not guarantee that this
|
||||||
|
* [BotCommandTextSource] will be at the start of the message
|
||||||
|
*
|
||||||
|
* @see requireCommandAtStart
|
||||||
|
*/
|
||||||
|
fun Flow<CommonMessage<TextContent>>.requireSingleCommand() = filter {
|
||||||
|
var count = 0
|
||||||
|
|
||||||
|
it.content.textSources.forEach {
|
||||||
|
if (it is BotCommandTextSource) {
|
||||||
|
count++
|
||||||
|
if (count > 1) {
|
||||||
|
return@filter false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
count == 1
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Subsequent [Flow] will retrieve only messages without [TextContent.textSources] which are not [BotCommandTextSource]
|
||||||
|
*/
|
||||||
|
fun Flow<CommonMessage<TextContent>>.requireCommandsWithoutParams() = filter {
|
||||||
|
it.content.textSources.none { it !is BotCommandTextSource }
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Map the commands with their arguments and source messages
|
||||||
|
*/
|
||||||
|
fun Flow<CommonMessage<TextContent>>.commandsWithParams(): Flow<Pair<CommonMessage<TextContent>, List<Pair<BotCommandTextSource, Array<TextSource>>>>> = mapNotNull {
|
||||||
|
var currentCommandTextSource: BotCommandTextSource? = null
|
||||||
|
val currentArgs = mutableListOf<TextSource>()
|
||||||
|
val result = mutableListOf<Pair<BotCommandTextSource, Array<TextSource>>>()
|
||||||
|
|
||||||
|
fun addCurrentCommandToResult() {
|
||||||
|
currentCommandTextSource ?.let {
|
||||||
|
result.add(it to currentArgs.toTypedArray())
|
||||||
|
currentArgs.clear()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
it.content.textSources.forEach {
|
||||||
|
it.ifBotCommandTextSource {
|
||||||
|
addCurrentCommandToResult()
|
||||||
|
currentCommandTextSource = it
|
||||||
|
return@forEach
|
||||||
|
}
|
||||||
|
currentArgs.add(it)
|
||||||
|
}
|
||||||
|
addCurrentCommandToResult()
|
||||||
|
|
||||||
|
result.toList().takeIf { it.isNotEmpty() } ?.let { result ->
|
||||||
|
it to result
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Flat [commandsWithParams]. Each [Pair] of [BotCommandTextSource] and its [Array] of arg text sources will
|
||||||
|
* be associated with its source message
|
||||||
|
*/
|
||||||
|
fun Flow<CommonMessage<TextContent>>.flattenCommandsWithParams() = commandsWithParams().flatMapConcat { (message, commandsWithParams) ->
|
||||||
|
commandsWithParams.map {
|
||||||
|
message to it
|
||||||
|
}.asFlow()
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Use [flattenCommandsWithParams] and filter out the commands which do not [matches] to [commandRegex]
|
||||||
|
*/
|
||||||
|
fun Flow<CommonMessage<TextContent>>.commandParams(commandRegex: Regex) = flattenCommandsWithParams().filter { (_, commandWithParams) ->
|
||||||
|
commandWithParams.first.command.matches(commandRegex)
|
||||||
|
}
|
||||||
@@ -3,18 +3,9 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations
|
package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations
|
||||||
|
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter
|
|
||||||
import dev.inmo.tgbotapi.extensions.utils.withContent
|
|
||||||
import dev.inmo.tgbotapi.requests.abstracts.Request
|
import dev.inmo.tgbotapi.requests.abstracts.Request
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.CommonMessage
|
import dev.inmo.tgbotapi.types.message.abstracts.CommonMessage
|
||||||
import dev.inmo.tgbotapi.types.message.content.*
|
import dev.inmo.tgbotapi.types.message.content.*
|
||||||
import dev.inmo.tgbotapi.types.message.content.AudioMediaGroupContent
|
|
||||||
import dev.inmo.tgbotapi.types.message.content.DocumentMediaGroupContent
|
|
||||||
import dev.inmo.tgbotapi.types.message.content.MediaGroupContent
|
|
||||||
import dev.inmo.tgbotapi.types.message.content.VisualMediaGroupContent
|
|
||||||
import dev.inmo.tgbotapi.types.message.content.InvoiceContent
|
|
||||||
import dev.inmo.tgbotapi.types.update.media_group.SentMediaGroupUpdate
|
|
||||||
import dev.inmo.tgbotapi.types.update.abstracts.BaseSentMessageUpdate
|
|
||||||
import dev.inmo.tgbotapi.utils.RiskFeature
|
import dev.inmo.tgbotapi.utils.RiskFeature
|
||||||
import dev.inmo.tgbotapi.utils.lowLevelRiskFeatureMessage
|
import dev.inmo.tgbotapi.utils.lowLevelRiskFeatureMessage
|
||||||
import kotlinx.coroutines.flow.Flow
|
import kotlinx.coroutines.flow.Flow
|
||||||
|
|||||||
@@ -4,18 +4,12 @@ package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations
|
|||||||
|
|
||||||
import dev.inmo.micro_utils.coroutines.safelyWithoutExceptions
|
import dev.inmo.micro_utils.coroutines.safelyWithoutExceptions
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter
|
|
||||||
import dev.inmo.tgbotapi.extensions.utils.withContent
|
import dev.inmo.tgbotapi.extensions.utils.withContent
|
||||||
import dev.inmo.tgbotapi.requests.abstracts.Request
|
import dev.inmo.tgbotapi.requests.abstracts.Request
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.CommonMessage
|
import dev.inmo.tgbotapi.types.message.abstracts.CommonMessage
|
||||||
import dev.inmo.tgbotapi.types.message.content.*
|
import dev.inmo.tgbotapi.types.message.content.*
|
||||||
import dev.inmo.tgbotapi.types.message.content.AudioMediaGroupContent
|
|
||||||
import dev.inmo.tgbotapi.types.message.content.DocumentMediaGroupContent
|
|
||||||
import dev.inmo.tgbotapi.types.message.content.MediaGroupContent
|
|
||||||
import dev.inmo.tgbotapi.types.message.content.VisualMediaGroupContent
|
|
||||||
import dev.inmo.tgbotapi.types.message.content.InvoiceContent
|
|
||||||
import dev.inmo.tgbotapi.types.update.media_group.SentMediaGroupUpdate
|
|
||||||
import dev.inmo.tgbotapi.types.update.abstracts.BaseSentMessageUpdate
|
import dev.inmo.tgbotapi.types.update.abstracts.BaseSentMessageUpdate
|
||||||
|
import dev.inmo.tgbotapi.types.update.media_group.SentMediaGroupUpdate
|
||||||
import dev.inmo.tgbotapi.utils.RiskFeature
|
import dev.inmo.tgbotapi.utils.RiskFeature
|
||||||
import dev.inmo.tgbotapi.utils.lowLevelRiskFeatureMessage
|
import dev.inmo.tgbotapi.utils.lowLevelRiskFeatureMessage
|
||||||
import kotlinx.coroutines.flow.Flow
|
import kotlinx.coroutines.flow.Flow
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations
|
||||||
|
|
||||||
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
|
||||||
|
import dev.inmo.tgbotapi.extensions.utils.regularTextSourceOrNull
|
||||||
|
import dev.inmo.tgbotapi.requests.abstracts.Request
|
||||||
|
import dev.inmo.tgbotapi.types.message.abstracts.CommonMessage
|
||||||
|
import dev.inmo.tgbotapi.types.message.content.TextContent
|
||||||
|
import dev.inmo.tgbotapi.types.message.textsources.RegularTextSource
|
||||||
|
import kotlinx.coroutines.flow.*
|
||||||
|
|
||||||
|
suspend fun BehaviourContext.waitDeepLinks(
|
||||||
|
initRequest: Request<*>? = null,
|
||||||
|
errorFactory: NullableRequestBuilder<*> = { null },
|
||||||
|
): Flow<Pair<CommonMessage<TextContent>, String>> = waitCommandMessage(
|
||||||
|
"start",
|
||||||
|
initRequest,
|
||||||
|
errorFactory
|
||||||
|
)
|
||||||
|
.requireSingleCommand()
|
||||||
|
.requireCommandAtStart()
|
||||||
|
.flattenCommandsWithParams().mapNotNull {
|
||||||
|
it.first to (it.second.second.singleOrNull() ?.regularTextSourceOrNull() ?.source ?.removePrefix(" ") ?: return@mapNotNull null)
|
||||||
|
}
|
||||||
@@ -3,22 +3,12 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations
|
package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations
|
||||||
|
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter
|
|
||||||
import dev.inmo.tgbotapi.extensions.utils.asCommonMessage
|
|
||||||
import dev.inmo.tgbotapi.extensions.utils.withContent
|
|
||||||
import dev.inmo.tgbotapi.requests.abstracts.Request
|
import dev.inmo.tgbotapi.requests.abstracts.Request
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.CommonMessage
|
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.MediaGroupMessage
|
|
||||||
import dev.inmo.tgbotapi.types.message.content.*
|
import dev.inmo.tgbotapi.types.message.content.*
|
||||||
import dev.inmo.tgbotapi.types.message.content.AudioMediaGroupContent
|
|
||||||
import dev.inmo.tgbotapi.types.message.content.DocumentMediaGroupContent
|
|
||||||
import dev.inmo.tgbotapi.types.message.content.MediaGroupContent
|
|
||||||
import dev.inmo.tgbotapi.types.message.content.VisualMediaGroupContent
|
|
||||||
import dev.inmo.tgbotapi.types.message.content.InvoiceContent
|
|
||||||
import dev.inmo.tgbotapi.types.update.abstracts.BaseEditMessageUpdate
|
|
||||||
import dev.inmo.tgbotapi.utils.RiskFeature
|
import dev.inmo.tgbotapi.utils.RiskFeature
|
||||||
import dev.inmo.tgbotapi.utils.lowLevelRiskFeatureMessage
|
import dev.inmo.tgbotapi.utils.lowLevelRiskFeatureMessage
|
||||||
import kotlinx.coroutines.flow.*
|
import kotlinx.coroutines.flow.Flow
|
||||||
|
import kotlinx.coroutines.flow.map
|
||||||
|
|
||||||
@RiskFeature(lowLevelRiskFeatureMessage)
|
@RiskFeature(lowLevelRiskFeatureMessage)
|
||||||
suspend inline fun <reified O : MessageContent> BehaviourContext.waitEditedContent(
|
suspend inline fun <reified O : MessageContent> BehaviourContext.waitEditedContent(
|
||||||
|
|||||||
@@ -3,23 +3,16 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations
|
package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations
|
||||||
|
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter
|
import dev.inmo.tgbotapi.extensions.utils.commonMessageOrNull
|
||||||
import dev.inmo.tgbotapi.extensions.utils.asCommonMessage
|
|
||||||
import dev.inmo.tgbotapi.extensions.utils.withContent
|
import dev.inmo.tgbotapi.extensions.utils.withContent
|
||||||
import dev.inmo.tgbotapi.requests.abstracts.Request
|
import dev.inmo.tgbotapi.requests.abstracts.Request
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.CommonMessage
|
import dev.inmo.tgbotapi.types.message.abstracts.CommonMessage
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.MediaGroupMessage
|
import dev.inmo.tgbotapi.types.message.abstracts.MediaGroupMessage
|
||||||
import dev.inmo.tgbotapi.types.message.content.*
|
import dev.inmo.tgbotapi.types.message.content.*
|
||||||
import dev.inmo.tgbotapi.types.message.content.AudioMediaGroupContent
|
|
||||||
import dev.inmo.tgbotapi.types.message.content.DocumentMediaGroupContent
|
|
||||||
import dev.inmo.tgbotapi.types.message.content.MediaGroupContent
|
|
||||||
import dev.inmo.tgbotapi.types.message.content.VisualMediaGroupContent
|
|
||||||
import dev.inmo.tgbotapi.types.message.content.InvoiceContent
|
|
||||||
import dev.inmo.tgbotapi.types.update.abstracts.BaseEditMessageUpdate
|
import dev.inmo.tgbotapi.types.update.abstracts.BaseEditMessageUpdate
|
||||||
import dev.inmo.tgbotapi.utils.RiskFeature
|
import dev.inmo.tgbotapi.utils.RiskFeature
|
||||||
import dev.inmo.tgbotapi.utils.lowLevelRiskFeatureMessage
|
import dev.inmo.tgbotapi.utils.lowLevelRiskFeatureMessage
|
||||||
import kotlinx.coroutines.flow.Flow
|
import kotlinx.coroutines.flow.Flow
|
||||||
import kotlinx.coroutines.flow.toList
|
|
||||||
|
|
||||||
@RiskFeature(lowLevelRiskFeatureMessage)
|
@RiskFeature(lowLevelRiskFeatureMessage)
|
||||||
suspend inline fun <reified O : MessageContent> BehaviourContext.waitEditedContentMessage(
|
suspend inline fun <reified O : MessageContent> BehaviourContext.waitEditedContentMessage(
|
||||||
@@ -32,7 +25,7 @@ suspend inline fun <reified O : MessageContent> BehaviourContext.waitEditedConte
|
|||||||
) {
|
) {
|
||||||
val messages = when (it) {
|
val messages = when (it) {
|
||||||
is BaseEditMessageUpdate -> {
|
is BaseEditMessageUpdate -> {
|
||||||
val commonMessage = it.data.asCommonMessage() ?: return@expectFlow emptyList()
|
val commonMessage = it.data.commonMessageOrNull() ?: return@expectFlow emptyList()
|
||||||
if (commonMessage !is MediaGroupMessage<*> || includeMediaGroups) {
|
if (commonMessage !is MediaGroupMessage<*> || includeMediaGroups) {
|
||||||
listOf(commonMessage)
|
listOf(commonMessage)
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -3,19 +3,16 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations
|
package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations
|
||||||
|
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter
|
|
||||||
import dev.inmo.tgbotapi.extensions.utils.*
|
import dev.inmo.tgbotapi.extensions.utils.*
|
||||||
import dev.inmo.tgbotapi.requests.abstracts.Request
|
import dev.inmo.tgbotapi.requests.abstracts.Request
|
||||||
import dev.inmo.tgbotapi.types.message.ChatEvents.*
|
import dev.inmo.tgbotapi.types.message.ChatEvents.*
|
||||||
import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.*
|
import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.*
|
||||||
import dev.inmo.tgbotapi.types.message.ChatEvents.voice.*
|
import dev.inmo.tgbotapi.types.message.ChatEvents.voice.*
|
||||||
import dev.inmo.tgbotapi.types.message.PrivateEventMessage
|
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.ChatEventMessage
|
import dev.inmo.tgbotapi.types.message.abstracts.ChatEventMessage
|
||||||
import dev.inmo.tgbotapi.types.message.payments.SuccessfulPaymentEvent
|
import dev.inmo.tgbotapi.types.message.payments.SuccessfulPaymentEvent
|
||||||
import dev.inmo.tgbotapi.utils.RiskFeature
|
import dev.inmo.tgbotapi.utils.RiskFeature
|
||||||
import dev.inmo.tgbotapi.utils.lowLevelRiskFeatureMessage
|
import dev.inmo.tgbotapi.utils.lowLevelRiskFeatureMessage
|
||||||
import kotlinx.coroutines.flow.Flow
|
import kotlinx.coroutines.flow.Flow
|
||||||
import kotlinx.coroutines.flow.toList
|
|
||||||
|
|
||||||
typealias EventMessageToEventMapper<T> = suspend ChatEventMessage<T>.() -> T?
|
typealias EventMessageToEventMapper<T> = suspend ChatEventMessage<T>.() -> T?
|
||||||
|
|
||||||
@@ -27,7 +24,7 @@ suspend inline fun <reified O : ChatEvent> BehaviourContext.waitEvents(
|
|||||||
initRequest,
|
initRequest,
|
||||||
errorFactory
|
errorFactory
|
||||||
) {
|
) {
|
||||||
it.asBaseSentMessageUpdate() ?.data ?.asChatEventMessage() ?.withEvent<O>() ?.chatEvent.let(::listOfNotNull)
|
it.baseSentMessageUpdateOrNull() ?.data ?.chatEventMessageOrNull() ?.withEvent<O>() ?.chatEvent.let(::listOfNotNull)
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun BehaviourContext.waitChannelEvents(
|
suspend fun BehaviourContext.waitChannelEvents(
|
||||||
|
|||||||
@@ -3,19 +3,16 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations
|
package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations
|
||||||
|
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter
|
|
||||||
import dev.inmo.tgbotapi.extensions.utils.*
|
import dev.inmo.tgbotapi.extensions.utils.*
|
||||||
import dev.inmo.tgbotapi.requests.abstracts.Request
|
import dev.inmo.tgbotapi.requests.abstracts.Request
|
||||||
import dev.inmo.tgbotapi.types.message.ChannelEventMessage
|
|
||||||
import dev.inmo.tgbotapi.types.message.ChatEvents.*
|
import dev.inmo.tgbotapi.types.message.ChatEvents.*
|
||||||
import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.*
|
import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.*
|
||||||
import dev.inmo.tgbotapi.types.message.ChatEvents.voice.*
|
import dev.inmo.tgbotapi.types.message.ChatEvents.voice.*
|
||||||
import dev.inmo.tgbotapi.types.message.PrivateEventMessage
|
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.ChatEventMessage
|
import dev.inmo.tgbotapi.types.message.abstracts.ChatEventMessage
|
||||||
import dev.inmo.tgbotapi.types.message.payments.SuccessfulPaymentEvent
|
import dev.inmo.tgbotapi.types.message.payments.SuccessfulPaymentEvent
|
||||||
import dev.inmo.tgbotapi.utils.RiskFeature
|
import dev.inmo.tgbotapi.utils.RiskFeature
|
||||||
import dev.inmo.tgbotapi.utils.lowLevelRiskFeatureMessage
|
import dev.inmo.tgbotapi.utils.lowLevelRiskFeatureMessage
|
||||||
import kotlinx.coroutines.flow.*
|
import kotlinx.coroutines.flow.Flow
|
||||||
|
|
||||||
@RiskFeature(lowLevelRiskFeatureMessage)
|
@RiskFeature(lowLevelRiskFeatureMessage)
|
||||||
suspend inline fun <reified O : ChatEvent> BehaviourContext.waitEventsMessages(
|
suspend inline fun <reified O : ChatEvent> BehaviourContext.waitEventsMessages(
|
||||||
@@ -25,7 +22,7 @@ suspend inline fun <reified O : ChatEvent> BehaviourContext.waitEventsMessages(
|
|||||||
initRequest,
|
initRequest,
|
||||||
errorFactory
|
errorFactory
|
||||||
) {
|
) {
|
||||||
it.asBaseSentMessageUpdate() ?.data ?.asChatEventMessage() ?.withEvent<O>().let(::listOfNotNull)
|
it.baseSentMessageUpdateOrNull() ?.data ?.chatEventMessageOrNull() ?.withEvent<O>().let(::listOfNotNull)
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun BehaviourContext.waitChannelEventsMessages(
|
suspend fun BehaviourContext.waitChannelEventsMessages(
|
||||||
|
|||||||
@@ -1,14 +1,12 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations
|
package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations
|
||||||
|
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter
|
import dev.inmo.tgbotapi.extensions.utils.inlineQueryUpdateOrNull
|
||||||
import dev.inmo.tgbotapi.extensions.utils.asInlineQueryUpdate
|
|
||||||
import dev.inmo.tgbotapi.requests.abstracts.Request
|
import dev.inmo.tgbotapi.requests.abstracts.Request
|
||||||
import dev.inmo.tgbotapi.types.InlineQueries.query.*
|
import dev.inmo.tgbotapi.types.InlineQueries.query.*
|
||||||
import dev.inmo.tgbotapi.utils.RiskFeature
|
import dev.inmo.tgbotapi.utils.RiskFeature
|
||||||
import dev.inmo.tgbotapi.utils.lowLevelRiskFeatureMessage
|
import dev.inmo.tgbotapi.utils.lowLevelRiskFeatureMessage
|
||||||
import kotlinx.coroutines.flow.Flow
|
import kotlinx.coroutines.flow.Flow
|
||||||
import kotlinx.coroutines.flow.toList
|
|
||||||
|
|
||||||
typealias InlineQueryMapper<T> = suspend T.() -> T?
|
typealias InlineQueryMapper<T> = suspend T.() -> T?
|
||||||
|
|
||||||
@@ -20,7 +18,7 @@ suspend inline fun <reified O : InlineQuery> BehaviourContext.waitInlineQueries(
|
|||||||
initRequest,
|
initRequest,
|
||||||
errorFactory
|
errorFactory
|
||||||
) {
|
) {
|
||||||
(it.asInlineQueryUpdate() ?.data as? O).let(::listOfNotNull)
|
(it.inlineQueryUpdateOrNull() ?.data as? O).let(::listOfNotNull)
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun BehaviourContext.waitAnyInlineQuery(
|
suspend fun BehaviourContext.waitAnyInlineQuery(
|
||||||
|
|||||||
@@ -2,15 +2,9 @@ package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations
|
|||||||
|
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter
|
||||||
import dev.inmo.tgbotapi.extensions.utils.asSentMediaGroupUpdate
|
|
||||||
import dev.inmo.tgbotapi.extensions.utils.withContent
|
|
||||||
import dev.inmo.tgbotapi.requests.abstracts.Request
|
import dev.inmo.tgbotapi.requests.abstracts.Request
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.MediaGroupMessage
|
import dev.inmo.tgbotapi.types.message.abstracts.MediaGroupMessage
|
||||||
import dev.inmo.tgbotapi.types.message.content.*
|
import dev.inmo.tgbotapi.types.message.content.*
|
||||||
import dev.inmo.tgbotapi.types.message.content.AudioMediaGroupContent
|
|
||||||
import dev.inmo.tgbotapi.types.message.content.DocumentMediaGroupContent
|
|
||||||
import dev.inmo.tgbotapi.types.message.content.MediaGroupContent
|
|
||||||
import dev.inmo.tgbotapi.types.message.content.VisualMediaGroupContent
|
|
||||||
import dev.inmo.tgbotapi.utils.RiskFeature
|
import dev.inmo.tgbotapi.utils.RiskFeature
|
||||||
import dev.inmo.tgbotapi.utils.lowLevelRiskFeatureMessage
|
import dev.inmo.tgbotapi.utils.lowLevelRiskFeatureMessage
|
||||||
import kotlinx.coroutines.flow.Flow
|
import kotlinx.coroutines.flow.Flow
|
||||||
|
|||||||
@@ -1,16 +1,11 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations
|
package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations
|
||||||
|
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter
|
import dev.inmo.tgbotapi.extensions.utils.sentMediaGroupUpdateOrNull
|
||||||
import dev.inmo.tgbotapi.extensions.utils.asSentMediaGroupUpdate
|
|
||||||
import dev.inmo.tgbotapi.extensions.utils.withContent
|
import dev.inmo.tgbotapi.extensions.utils.withContent
|
||||||
import dev.inmo.tgbotapi.requests.abstracts.Request
|
import dev.inmo.tgbotapi.requests.abstracts.Request
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.MediaGroupMessage
|
import dev.inmo.tgbotapi.types.message.abstracts.MediaGroupMessage
|
||||||
import dev.inmo.tgbotapi.types.message.content.*
|
import dev.inmo.tgbotapi.types.message.content.*
|
||||||
import dev.inmo.tgbotapi.types.message.content.AudioMediaGroupContent
|
|
||||||
import dev.inmo.tgbotapi.types.message.content.DocumentMediaGroupContent
|
|
||||||
import dev.inmo.tgbotapi.types.message.content.MediaGroupContent
|
|
||||||
import dev.inmo.tgbotapi.types.message.content.VisualMediaGroupContent
|
|
||||||
import dev.inmo.tgbotapi.utils.RiskFeature
|
import dev.inmo.tgbotapi.utils.RiskFeature
|
||||||
import dev.inmo.tgbotapi.utils.lowLevelRiskFeatureMessage
|
import dev.inmo.tgbotapi.utils.lowLevelRiskFeatureMessage
|
||||||
import kotlinx.coroutines.flow.Flow
|
import kotlinx.coroutines.flow.Flow
|
||||||
@@ -20,7 +15,7 @@ suspend inline fun <reified T : MediaGroupContent> BehaviourContext.buildMediaGr
|
|||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
noinline errorFactory: NullableRequestBuilder<*> = { null }
|
noinline errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
): Flow<List<MediaGroupMessage<T>>> = flowsUpdatesFilter.expectFlow(bot, initRequest, errorFactory) { update ->
|
): Flow<List<MediaGroupMessage<T>>> = flowsUpdatesFilter.expectFlow(bot, initRequest, errorFactory) { update ->
|
||||||
update.asSentMediaGroupUpdate() ?.data ?.let { mediaGroup ->
|
update.sentMediaGroupUpdateOrNull() ?.data ?.let { mediaGroup ->
|
||||||
val mapped = mediaGroup.mapNotNull { it.withContent<T>() }
|
val mapped = mediaGroup.mapNotNull { it.withContent<T>() }
|
||||||
listOf(
|
listOf(
|
||||||
mapped
|
mapped
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations
|
package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations
|
||||||
|
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter
|
import dev.inmo.tgbotapi.extensions.utils.messageUpdateOrNull
|
||||||
import dev.inmo.tgbotapi.extensions.utils.asMessageUpdate
|
import dev.inmo.tgbotapi.extensions.utils.passportMessageOrNull
|
||||||
import dev.inmo.tgbotapi.extensions.utils.asPassportMessage
|
|
||||||
import dev.inmo.tgbotapi.requests.abstracts.Request
|
import dev.inmo.tgbotapi.requests.abstracts.Request
|
||||||
import dev.inmo.tgbotapi.types.message.PassportMessage
|
import dev.inmo.tgbotapi.types.message.PassportMessage
|
||||||
import dev.inmo.tgbotapi.types.passport.PassportData
|
import dev.inmo.tgbotapi.types.passport.PassportData
|
||||||
@@ -11,7 +10,6 @@ import dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportEle
|
|||||||
import dev.inmo.tgbotapi.utils.RiskFeature
|
import dev.inmo.tgbotapi.utils.RiskFeature
|
||||||
import dev.inmo.tgbotapi.utils.lowLevelRiskFeatureMessage
|
import dev.inmo.tgbotapi.utils.lowLevelRiskFeatureMessage
|
||||||
import kotlinx.coroutines.flow.Flow
|
import kotlinx.coroutines.flow.Flow
|
||||||
import kotlinx.coroutines.flow.toList
|
|
||||||
|
|
||||||
typealias PassportMessageMapper = suspend PassportMessage.() -> PassportData
|
typealias PassportMessageMapper = suspend PassportMessage.() -> PassportData
|
||||||
|
|
||||||
@@ -23,7 +21,7 @@ suspend inline fun <reified O : EncryptedPassportElement> BehaviourContext.waitP
|
|||||||
initRequest,
|
initRequest,
|
||||||
errorFactory
|
errorFactory
|
||||||
) {
|
) {
|
||||||
it.asMessageUpdate() ?.data ?.asPassportMessage() ?.passportData ?.data ?.filterIsInstance<O>() ?: emptyList()
|
it.messageUpdateOrNull() ?.data ?.passportMessageOrNull() ?.passportData ?.data ?.filterIsInstance<O>() ?: emptyList()
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun BehaviourContext.waitAnyPassportMessages(
|
suspend fun BehaviourContext.waitAnyPassportMessages(
|
||||||
|
|||||||
@@ -1,14 +1,10 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations
|
package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations
|
||||||
|
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter
|
import dev.inmo.tgbotapi.extensions.utils.pollAnswerUpdateOrNull
|
||||||
import dev.inmo.tgbotapi.extensions.utils.asPollAnswerUpdate
|
|
||||||
import dev.inmo.tgbotapi.requests.abstracts.Request
|
import dev.inmo.tgbotapi.requests.abstracts.Request
|
||||||
import dev.inmo.tgbotapi.types.polls.PollAnswer
|
import dev.inmo.tgbotapi.types.polls.PollAnswer
|
||||||
import dev.inmo.tgbotapi.utils.RiskFeature
|
|
||||||
import dev.inmo.tgbotapi.utils.lowLevelRiskFeatureMessage
|
|
||||||
import kotlinx.coroutines.flow.Flow
|
import kotlinx.coroutines.flow.Flow
|
||||||
import kotlinx.coroutines.flow.toList
|
|
||||||
|
|
||||||
typealias PollAnswerMapper = suspend PollAnswer.() -> PollAnswer?
|
typealias PollAnswerMapper = suspend PollAnswer.() -> PollAnswer?
|
||||||
|
|
||||||
@@ -19,5 +15,5 @@ suspend fun BehaviourContext.waitPollAnswers(
|
|||||||
initRequest,
|
initRequest,
|
||||||
errorFactory
|
errorFactory
|
||||||
) {
|
) {
|
||||||
it.asPollAnswerUpdate() ?.data.let(::listOfNotNull)
|
it.pollAnswerUpdateOrNull() ?.data.let(::listOfNotNull)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +1,12 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations
|
package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations
|
||||||
|
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter
|
import dev.inmo.tgbotapi.extensions.utils.pollUpdateOrNull
|
||||||
import dev.inmo.tgbotapi.extensions.utils.asPollUpdate
|
|
||||||
import dev.inmo.tgbotapi.requests.abstracts.Request
|
import dev.inmo.tgbotapi.requests.abstracts.Request
|
||||||
import dev.inmo.tgbotapi.types.polls.*
|
import dev.inmo.tgbotapi.types.polls.*
|
||||||
import dev.inmo.tgbotapi.utils.RiskFeature
|
import dev.inmo.tgbotapi.utils.RiskFeature
|
||||||
import dev.inmo.tgbotapi.utils.lowLevelRiskFeatureMessage
|
import dev.inmo.tgbotapi.utils.lowLevelRiskFeatureMessage
|
||||||
import kotlinx.coroutines.flow.Flow
|
import kotlinx.coroutines.flow.Flow
|
||||||
import kotlinx.coroutines.flow.toList
|
|
||||||
|
|
||||||
typealias PollMapper<T> = suspend T.() -> T?
|
typealias PollMapper<T> = suspend T.() -> T?
|
||||||
|
|
||||||
@@ -20,7 +18,7 @@ suspend inline fun <reified O : Poll> BehaviourContext.waitPolls(
|
|||||||
initRequest,
|
initRequest,
|
||||||
errorFactory
|
errorFactory
|
||||||
) {
|
) {
|
||||||
(it.asPollUpdate() ?.data as? O).let(::listOfNotNull)
|
(it.pollUpdateOrNull() ?.data as? O).let(::listOfNotNull)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,14 +1,10 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations
|
package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations
|
||||||
|
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter
|
import dev.inmo.tgbotapi.extensions.utils.preCheckoutQueryUpdateOrNull
|
||||||
import dev.inmo.tgbotapi.extensions.utils.asPreCheckoutQueryUpdate
|
|
||||||
import dev.inmo.tgbotapi.requests.abstracts.Request
|
import dev.inmo.tgbotapi.requests.abstracts.Request
|
||||||
import dev.inmo.tgbotapi.types.payments.PreCheckoutQuery
|
import dev.inmo.tgbotapi.types.payments.PreCheckoutQuery
|
||||||
import dev.inmo.tgbotapi.utils.RiskFeature
|
|
||||||
import dev.inmo.tgbotapi.utils.lowLevelRiskFeatureMessage
|
|
||||||
import kotlinx.coroutines.flow.Flow
|
import kotlinx.coroutines.flow.Flow
|
||||||
import kotlinx.coroutines.flow.toList
|
|
||||||
|
|
||||||
typealias PreCheckoutQueryMapper = suspend PreCheckoutQuery.() -> PreCheckoutQuery?
|
typealias PreCheckoutQueryMapper = suspend PreCheckoutQuery.() -> PreCheckoutQuery?
|
||||||
|
|
||||||
@@ -19,5 +15,5 @@ suspend fun BehaviourContext.waitPreCheckoutQueries(
|
|||||||
initRequest,
|
initRequest,
|
||||||
errorFactory
|
errorFactory
|
||||||
) {
|
) {
|
||||||
it.asPreCheckoutQueryUpdate() ?.data.let(::listOfNotNull)
|
it.preCheckoutQueryUpdateOrNull() ?.data.let(::listOfNotNull)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,10 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations
|
package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations
|
||||||
|
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter
|
import dev.inmo.tgbotapi.extensions.utils.shippingQueryUpdateOrNull
|
||||||
import dev.inmo.tgbotapi.extensions.utils.asShippingQueryUpdate
|
|
||||||
import dev.inmo.tgbotapi.requests.abstracts.Request
|
import dev.inmo.tgbotapi.requests.abstracts.Request
|
||||||
import dev.inmo.tgbotapi.types.payments.ShippingQuery
|
import dev.inmo.tgbotapi.types.payments.ShippingQuery
|
||||||
import kotlinx.coroutines.flow.Flow
|
import kotlinx.coroutines.flow.Flow
|
||||||
import kotlinx.coroutines.flow.toList
|
|
||||||
|
|
||||||
typealias ShippingQueryMapper = suspend ShippingQuery.() -> ShippingQuery?
|
typealias ShippingQueryMapper = suspend ShippingQuery.() -> ShippingQuery?
|
||||||
|
|
||||||
@@ -17,5 +15,5 @@ suspend fun BehaviourContext.waitShippingQueries(
|
|||||||
initRequest,
|
initRequest,
|
||||||
errorFactory
|
errorFactory
|
||||||
) {
|
) {
|
||||||
(it.asShippingQueryUpdate() ?.data).let(::listOfNotNull)
|
(it.shippingQueryUpdateOrNull() ?.data).let(::listOfNotNull)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,13 +2,13 @@ package dev.inmo.tgbotapi.extensions.behaviour_builder.filters
|
|||||||
|
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver
|
||||||
import dev.inmo.tgbotapi.extensions.utils.extensions.sourceChat
|
import dev.inmo.tgbotapi.extensions.utils.extensions.sourceChat
|
||||||
import dev.inmo.tgbotapi.types.queries.callback.CallbackQuery
|
import dev.inmo.tgbotapi.types.InlineQueries.query.InlineQuery
|
||||||
import dev.inmo.tgbotapi.types.chat.ChatJoinRequest
|
import dev.inmo.tgbotapi.types.chat.ChatJoinRequest
|
||||||
import dev.inmo.tgbotapi.types.chat.member.ChatMemberUpdated
|
import dev.inmo.tgbotapi.types.chat.member.ChatMemberUpdated
|
||||||
import dev.inmo.tgbotapi.types.InlineQueries.query.InlineQuery
|
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
||||||
import dev.inmo.tgbotapi.types.payments.PreCheckoutQuery
|
import dev.inmo.tgbotapi.types.payments.PreCheckoutQuery
|
||||||
import dev.inmo.tgbotapi.types.payments.ShippingQuery
|
import dev.inmo.tgbotapi.types.payments.ShippingQuery
|
||||||
|
import dev.inmo.tgbotapi.types.queries.callback.CallbackQuery
|
||||||
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ import dev.inmo.tgbotapi.extensions.behaviour_builder.filters.CallbackQueryFilte
|
|||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.ByUserCallbackQueryMarkerFactory
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.ByUserCallbackQueryMarkerFactory
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times
|
||||||
import dev.inmo.tgbotapi.extensions.utils.asCallbackQueryUpdate
|
import dev.inmo.tgbotapi.extensions.utils.callbackQueryUpdateOrNull
|
||||||
import dev.inmo.tgbotapi.types.queries.callback.*
|
import dev.inmo.tgbotapi.types.queries.callback.*
|
||||||
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
||||||
import kotlinx.coroutines.Job
|
import kotlinx.coroutines.Job
|
||||||
@@ -21,7 +21,7 @@ internal suspend inline fun <BC : BehaviourContext, reified T : CallbackQuery> B
|
|||||||
markerFactory: MarkerFactory<in T, Any> = ByUserCallbackQueryMarkerFactory,
|
markerFactory: MarkerFactory<in T, Any> = ByUserCallbackQueryMarkerFactory,
|
||||||
noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, T>
|
noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, T>
|
||||||
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
|
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
|
||||||
(it.asCallbackQueryUpdate() ?.data as? T) ?.let(::listOfNotNull)
|
(it.callbackQueryUpdateOrNull() ?.data as? T) ?.let(::listOfNotNull)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -111,7 +111,7 @@ suspend fun <BC : BehaviourContext> BC.onDataCallbackQuery(
|
|||||||
markerFactory: MarkerFactory<in DataCallbackQuery, Any> = ByUserCallbackQueryMarkerFactory,
|
markerFactory: MarkerFactory<in DataCallbackQuery, Any> = ByUserCallbackQueryMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, DataCallbackQuery>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, DataCallbackQuery>
|
||||||
) = onDataCallbackQuery(
|
) = onDataCallbackQuery(
|
||||||
initialFilter = initialFilter + {
|
initialFilter = initialFilter * {
|
||||||
it.data.matches(dataRegex)
|
it.data.matches(dataRegex)
|
||||||
},
|
},
|
||||||
subcontextUpdatesFilter,
|
subcontextUpdatesFilter,
|
||||||
@@ -239,7 +239,7 @@ suspend fun <BC : BehaviourContext> BC.onInlineMessageIdDataCallbackQuery(
|
|||||||
markerFactory: MarkerFactory<in InlineMessageIdDataCallbackQuery, Any> = ByUserCallbackQueryMarkerFactory,
|
markerFactory: MarkerFactory<in InlineMessageIdDataCallbackQuery, Any> = ByUserCallbackQueryMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, InlineMessageIdDataCallbackQuery>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, InlineMessageIdDataCallbackQuery>
|
||||||
) = onInlineMessageIdDataCallbackQuery(
|
) = onInlineMessageIdDataCallbackQuery(
|
||||||
initialFilter = initialFilter + {
|
initialFilter = initialFilter * {
|
||||||
it.data.matches(dataRegex)
|
it.data.matches(dataRegex)
|
||||||
},
|
},
|
||||||
subcontextUpdatesFilter,
|
subcontextUpdatesFilter,
|
||||||
@@ -367,7 +367,7 @@ suspend fun <BC : BehaviourContext> BC.onMessageDataCallbackQuery(
|
|||||||
markerFactory: MarkerFactory<in MessageDataCallbackQuery, Any> = ByUserCallbackQueryMarkerFactory,
|
markerFactory: MarkerFactory<in MessageDataCallbackQuery, Any> = ByUserCallbackQueryMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MessageDataCallbackQuery>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MessageDataCallbackQuery>
|
||||||
) = onMessageDataCallbackQuery(
|
) = onMessageDataCallbackQuery(
|
||||||
initialFilter = initialFilter + {
|
initialFilter = initialFilter * {
|
||||||
it.data.matches(dataRegex)
|
it.data.matches(dataRegex)
|
||||||
},
|
},
|
||||||
subcontextUpdatesFilter,
|
subcontextUpdatesFilter,
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import dev.inmo.tgbotapi.extensions.behaviour_builder.filters.ChatJoinRequestFil
|
|||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.ByChatChatJoinRequestMarkerFactory
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.ByChatChatJoinRequestMarkerFactory
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory
|
||||||
import dev.inmo.tgbotapi.extensions.utils.asChatJoinRequestUpdate
|
import dev.inmo.tgbotapi.extensions.utils.chatJoinRequestUpdateOrNull
|
||||||
import dev.inmo.tgbotapi.types.chat.ChatJoinRequest
|
import dev.inmo.tgbotapi.types.chat.ChatJoinRequest
|
||||||
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
||||||
|
|
||||||
@@ -29,5 +29,5 @@ suspend fun <BC : BehaviourContext> BC.onChatJoinRequest(
|
|||||||
markerFactory: MarkerFactory<in ChatJoinRequest, Any> = ByChatChatJoinRequestMarkerFactory,
|
markerFactory: MarkerFactory<in ChatJoinRequest, Any> = ByChatChatJoinRequestMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatJoinRequest>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatJoinRequest>
|
||||||
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
|
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
|
||||||
(it.asChatJoinRequestUpdate() ?.data) ?.let(::listOfNotNull)
|
(it.chatJoinRequestUpdateOrNull() ?.data) ?.let(::listOfNotNull)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import dev.inmo.tgbotapi.extensions.behaviour_builder.*
|
|||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.ByUserIdChosenInlineResultMarkerFactory
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.ByUserIdChosenInlineResultMarkerFactory
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory
|
||||||
import dev.inmo.tgbotapi.extensions.utils.asChosenInlineResultUpdate
|
import dev.inmo.tgbotapi.extensions.utils.chosenInlineResultUpdateOrNull
|
||||||
import dev.inmo.tgbotapi.types.InlineQueries.ChosenInlineResult.*
|
import dev.inmo.tgbotapi.types.InlineQueries.ChosenInlineResult.*
|
||||||
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
||||||
|
|
||||||
@@ -16,7 +16,7 @@ internal suspend inline fun <BC : BehaviourContext, reified T : ChosenInlineResu
|
|||||||
markerFactory: MarkerFactory<in T, Any> = ByUserIdChosenInlineResultMarkerFactory,
|
markerFactory: MarkerFactory<in T, Any> = ByUserIdChosenInlineResultMarkerFactory,
|
||||||
noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, T>
|
noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, T>
|
||||||
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
|
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
|
||||||
(it.asChosenInlineResultUpdate() ?.data as? T) ?.let(::listOfNotNull)
|
(it.chosenInlineResultUpdateOrNull() ?.data as? T) ?.let(::listOfNotNull)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -10,9 +10,8 @@ import dev.inmo.tgbotapi.extensions.behaviour_builder.filters.MessageFilterByCha
|
|||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.ByChatMessageMarkerFactory
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.ByChatMessageMarkerFactory
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times
|
||||||
import dev.inmo.tgbotapi.extensions.utils.asBotCommandTextSource
|
import dev.inmo.tgbotapi.extensions.utils.botCommandTextSourceOrNull
|
||||||
import dev.inmo.tgbotapi.extensions.utils.extensions.parseCommandsWithParams
|
import dev.inmo.tgbotapi.extensions.utils.extensions.parseCommandsWithParams
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.CommonMessage
|
|
||||||
import dev.inmo.tgbotapi.types.message.content.TextContent
|
import dev.inmo.tgbotapi.types.message.content.TextContent
|
||||||
import dev.inmo.tgbotapi.types.message.content.TextMessage
|
import dev.inmo.tgbotapi.types.message.content.TextMessage
|
||||||
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
||||||
@@ -35,7 +34,7 @@ internal suspend fun <BC : BehaviourContext> BC.commandUncounted(
|
|||||||
true
|
true
|
||||||
}
|
}
|
||||||
sizeRequirement && textSources.any {
|
sizeRequirement && textSources.any {
|
||||||
commandRegex.matches(it.asBotCommandTextSource() ?.command ?: return@any false)
|
commandRegex.matches(it.botCommandTextSourceOrNull() ?.command ?: return@any false)
|
||||||
}
|
}
|
||||||
}.let {
|
}.let {
|
||||||
initialFilter ?.times(it) ?: it
|
initialFilter ?.times(it) ?: it
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import dev.inmo.tgbotapi.extensions.behaviour_builder.filters.MessageFilterByCha
|
|||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.ByChatMessageMarkerFactory
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.ByChatMessageMarkerFactory
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times
|
||||||
import dev.inmo.tgbotapi.extensions.utils.asBotCommandTextSource
|
import dev.inmo.tgbotapi.extensions.utils.botCommandTextSourceOrNull
|
||||||
import dev.inmo.tgbotapi.extensions.utils.extensions.parseCommandsWithParams
|
import dev.inmo.tgbotapi.extensions.utils.extensions.parseCommandsWithParams
|
||||||
import dev.inmo.tgbotapi.types.message.content.TextContent
|
import dev.inmo.tgbotapi.types.message.content.TextContent
|
||||||
import dev.inmo.tgbotapi.types.message.content.TextMessage
|
import dev.inmo.tgbotapi.types.message.content.TextMessage
|
||||||
@@ -33,7 +33,7 @@ suspend fun <BC : BehaviourContext> BC.unhandledCommand(
|
|||||||
true
|
true
|
||||||
}
|
}
|
||||||
sizeRequirement && textSources.any {
|
sizeRequirement && textSources.any {
|
||||||
val command = it.asBotCommandTextSource() ?.command ?: return@any false
|
val command = it.botCommandTextSourceOrNull() ?.command ?: return@any false
|
||||||
!triggersHolder.handleableCommandsHolder.isHandled(command)
|
!triggersHolder.handleableCommandsHolder.isHandled(command)
|
||||||
}
|
}
|
||||||
}.let {
|
}.let {
|
||||||
|
|||||||
@@ -12,12 +12,9 @@ import dev.inmo.tgbotapi.extensions.utils.whenCommonMessage
|
|||||||
import dev.inmo.tgbotapi.types.files.TelegramMediaFile
|
import dev.inmo.tgbotapi.types.files.TelegramMediaFile
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.CommonMessage
|
import dev.inmo.tgbotapi.types.message.abstracts.CommonMessage
|
||||||
import dev.inmo.tgbotapi.types.message.content.*
|
import dev.inmo.tgbotapi.types.message.content.*
|
||||||
import dev.inmo.tgbotapi.types.message.content.AudioMediaGroupContent
|
|
||||||
import dev.inmo.tgbotapi.types.message.content.DocumentMediaGroupContent
|
|
||||||
import dev.inmo.tgbotapi.types.message.content.InvoiceContent
|
|
||||||
import dev.inmo.tgbotapi.types.update.media_group.SentMediaGroupUpdate
|
|
||||||
import dev.inmo.tgbotapi.types.update.abstracts.BaseSentMessageUpdate
|
import dev.inmo.tgbotapi.types.update.abstracts.BaseSentMessageUpdate
|
||||||
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
||||||
|
import dev.inmo.tgbotapi.types.update.media_group.SentMediaGroupUpdate
|
||||||
|
|
||||||
typealias CommonMessageFilter<T> = SimpleFilter<CommonMessage<T>>
|
typealias CommonMessageFilter<T> = SimpleFilter<CommonMessage<T>>
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,48 @@
|
|||||||
|
@file:Suppress("unused")
|
||||||
|
|
||||||
|
package dev.inmo.tgbotapi.extensions.behaviour_builder.triggers_handling
|
||||||
|
|
||||||
|
import dev.inmo.micro_utils.coroutines.*
|
||||||
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.*
|
||||||
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.waitDeepLinks
|
||||||
|
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.SimpleFilter
|
||||||
|
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
|
||||||
|
import dev.inmo.tgbotapi.extensions.utils.*
|
||||||
|
import dev.inmo.tgbotapi.extensions.utils.extensions.parseCommandsWithParams
|
||||||
|
import dev.inmo.tgbotapi.types.message.content.TextContent
|
||||||
|
import dev.inmo.tgbotapi.types.message.content.TextMessage
|
||||||
|
import dev.inmo.tgbotapi.types.message.textsources.RegularTextSource
|
||||||
|
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
||||||
|
import io.ktor.http.decodeURLQueryComponent
|
||||||
|
import kotlinx.coroutines.Job
|
||||||
|
import kotlinx.coroutines.flow.filter
|
||||||
|
|
||||||
|
private val startRegex = Regex("start")
|
||||||
|
suspend fun <BC : BehaviourContext> BC.onDeepLink(
|
||||||
|
initialFilter: SimpleFilter<Pair<TextMessage, String>>? = null,
|
||||||
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, Pair<TextMessage, String>, Update> = { (message, _), update -> MessageFilterByChat(this, message, update) },
|
||||||
|
markerFactory: MarkerFactory<Pair<TextMessage, String>, Any> = MarkerFactory { (message, _) -> ByChatMessageMarkerFactory(message) },
|
||||||
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, Pair<TextMessage, String>>
|
||||||
|
): Job = on(
|
||||||
|
markerFactory,
|
||||||
|
SimpleFilter<Pair<TextMessage, String>> { (message, _) ->
|
||||||
|
message.content.textSources.size == 2
|
||||||
|
&& message.content.textSources.firstOrNull() ?.asBotCommandTextSource() ?.command == "start"
|
||||||
|
&& message.content.textSources.getOrNull(1) is RegularTextSource
|
||||||
|
} * initialFilter,
|
||||||
|
subcontextUpdatesFilter,
|
||||||
|
scenarioReceiver,
|
||||||
|
) {
|
||||||
|
(it.messageUpdateOrNull()) ?.data ?.commonMessageOrNull() ?.withContentOrNull<TextContent>() ?.let { message ->
|
||||||
|
message to message.content.textSources[1].source.removePrefix(" ").decodeURLQueryComponent()
|
||||||
|
} ?.let(::listOfNotNull)
|
||||||
|
}.also {
|
||||||
|
triggersHolder.handleableCommandsHolder.registerHandleable(startRegex)
|
||||||
|
it.invokeOnCompletion {
|
||||||
|
this@onDeepLink.launchSafelyWithoutExceptions { triggersHolder.handleableCommandsHolder.unregisterHandleable(startRegex) }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -20,17 +20,11 @@ import dev.inmo.tgbotapi.extensions.behaviour_builder.filters.CommonMessageFilte
|
|||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.filters.MessageFilterByChat
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.filters.MessageFilterByChat
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.ByChatMessageMarkerFactory
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.ByChatMessageMarkerFactory
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory
|
||||||
import dev.inmo.tgbotapi.extensions.utils.asEditMessageUpdate
|
import dev.inmo.tgbotapi.extensions.utils.editMessageUpdateOrNull
|
||||||
import dev.inmo.tgbotapi.extensions.utils.withContent
|
import dev.inmo.tgbotapi.extensions.utils.withContent
|
||||||
import dev.inmo.tgbotapi.types.files.TelegramMediaFile
|
import dev.inmo.tgbotapi.types.files.TelegramMediaFile
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.CommonMessage
|
import dev.inmo.tgbotapi.types.message.abstracts.CommonMessage
|
||||||
import dev.inmo.tgbotapi.types.message.content.*
|
import dev.inmo.tgbotapi.types.message.content.*
|
||||||
import dev.inmo.tgbotapi.types.message.content.AudioMediaGroupContent
|
|
||||||
import dev.inmo.tgbotapi.types.message.content.DocumentMediaGroupContent
|
|
||||||
import dev.inmo.tgbotapi.types.message.content.InvoiceContent
|
|
||||||
import dev.inmo.tgbotapi.types.message.content.MediaCollectionContent
|
|
||||||
import dev.inmo.tgbotapi.types.message.content.MediaContent
|
|
||||||
import dev.inmo.tgbotapi.types.message.content.MessageContent
|
|
||||||
import dev.inmo.tgbotapi.types.update.abstracts.BaseEditMessageUpdate
|
import dev.inmo.tgbotapi.types.update.abstracts.BaseEditMessageUpdate
|
||||||
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
||||||
|
|
||||||
@@ -41,7 +35,7 @@ internal suspend inline fun <BC : BehaviourContext, reified T : MessageContent>
|
|||||||
noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<T>>
|
noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<T>>
|
||||||
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
|
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
|
||||||
when (it) {
|
when (it) {
|
||||||
is BaseEditMessageUpdate -> (it.asEditMessageUpdate() ?.data ?.withContent<T>())
|
is BaseEditMessageUpdate -> (it.editMessageUpdateOrNull() ?.data ?.withContent<T>())
|
||||||
else -> null
|
else -> null
|
||||||
} ?.let(::listOfNotNull)
|
} ?.let(::listOfNotNull)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ import dev.inmo.tgbotapi.extensions.behaviour_builder.filters.MessageFilterByCha
|
|||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.ByChatMessageMarkerFactory
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.ByChatMessageMarkerFactory
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory
|
||||||
import dev.inmo.tgbotapi.extensions.utils.asBaseSentMessageUpdate
|
import dev.inmo.tgbotapi.extensions.utils.baseSentMessageUpdateOrNull
|
||||||
import dev.inmo.tgbotapi.extensions.utils.asChatEventMessage
|
import dev.inmo.tgbotapi.extensions.utils.chatEventMessageOrNull
|
||||||
import dev.inmo.tgbotapi.types.message.ChatEvents.*
|
import dev.inmo.tgbotapi.types.message.ChatEvents.*
|
||||||
import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.*
|
import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.*
|
||||||
import dev.inmo.tgbotapi.types.message.ChatEvents.voice.*
|
import dev.inmo.tgbotapi.types.message.ChatEvents.voice.*
|
||||||
@@ -24,7 +24,7 @@ internal suspend inline fun <BC : BehaviourContext, reified T : ChatEvent> BC.on
|
|||||||
noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<T>>
|
noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<T>>
|
||||||
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
|
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
|
||||||
@Suppress("UNCHECKED_CAST")
|
@Suppress("UNCHECKED_CAST")
|
||||||
(it.asBaseSentMessageUpdate() ?.data ?.asChatEventMessage() ?.takeIf { it.chatEvent is T } as? ChatEventMessage<T>) ?.let(::listOfNotNull)
|
(it.baseSentMessageUpdateOrNull() ?.data ?.chatEventMessageOrNull() ?.takeIf { it.chatEvent is T } as? ChatEventMessage<T>) ?.let(::listOfNotNull)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import dev.inmo.tgbotapi.extensions.behaviour_builder.filters.InlineQueryFilterB
|
|||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.ByUserInlineQueryMarkerFactory
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.ByUserInlineQueryMarkerFactory
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory
|
||||||
import dev.inmo.tgbotapi.extensions.utils.asInlineQueryUpdate
|
import dev.inmo.tgbotapi.extensions.utils.inlineQueryUpdateOrNull
|
||||||
import dev.inmo.tgbotapi.types.InlineQueries.query.*
|
import dev.inmo.tgbotapi.types.InlineQueries.query.*
|
||||||
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
||||||
|
|
||||||
@@ -15,7 +15,7 @@ internal suspend inline fun <BC : BehaviourContext, reified T : InlineQuery> BC.
|
|||||||
markerFactory: MarkerFactory<in T, Any> = ByUserInlineQueryMarkerFactory,
|
markerFactory: MarkerFactory<in T, Any> = ByUserInlineQueryMarkerFactory,
|
||||||
noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, T>
|
noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, T>
|
||||||
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
|
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
|
||||||
(it.asInlineQueryUpdate() ?.data as? T) ?.let(::listOfNotNull)
|
(it.inlineQueryUpdateOrNull() ?.data as? T) ?.let(::listOfNotNull)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.behaviour_builder.triggers_handling
|
package dev.inmo.tgbotapi.extensions.behaviour_builder.triggers_handling
|
||||||
|
|
||||||
import dev.inmo.micro_utils.coroutines.*
|
import dev.inmo.micro_utils.coroutines.subscribeSafelyWithoutExceptionsAsync
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.*
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.*
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.expectFlow
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.expectFlow
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import dev.inmo.tgbotapi.extensions.behaviour_builder.filters.MessagesFilterByCh
|
|||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.ByChatMediaGroupMarkerFactory
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.ByChatMediaGroupMarkerFactory
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory
|
||||||
import dev.inmo.tgbotapi.extensions.utils.asSentMediaGroupUpdate
|
import dev.inmo.tgbotapi.extensions.utils.sentMediaGroupUpdateOrNull
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.MediaGroupMessage
|
import dev.inmo.tgbotapi.types.message.abstracts.MediaGroupMessage
|
||||||
import dev.inmo.tgbotapi.types.message.content.*
|
import dev.inmo.tgbotapi.types.message.content.*
|
||||||
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
||||||
@@ -20,7 +20,7 @@ internal suspend inline fun <BC : BehaviourContext, reified T : MediaGroupConten
|
|||||||
markerFactory: MarkerFactory<in List<MediaGroupMessage<T>>, Any> = ByChatMediaGroupMarkerFactory,
|
markerFactory: MarkerFactory<in List<MediaGroupMessage<T>>, Any> = ByChatMediaGroupMarkerFactory,
|
||||||
noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, List<MediaGroupMessage<T>>>
|
noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, List<MediaGroupMessage<T>>>
|
||||||
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
|
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
|
||||||
(it.asSentMediaGroupUpdate() ?.data ?.takeIf { messages ->
|
(it.sentMediaGroupUpdateOrNull() ?.data ?.takeIf { messages ->
|
||||||
messages.all { message ->
|
messages.all { message ->
|
||||||
message.content is T
|
message.content is T
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ import dev.inmo.tgbotapi.extensions.behaviour_builder.filters.MessageFilterByCha
|
|||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.ByChatMessageMarkerFactory
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.ByChatMessageMarkerFactory
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory
|
||||||
import dev.inmo.tgbotapi.extensions.utils.asMessageUpdate
|
import dev.inmo.tgbotapi.extensions.utils.messageUpdateOrNull
|
||||||
import dev.inmo.tgbotapi.extensions.utils.asPassportMessage
|
import dev.inmo.tgbotapi.extensions.utils.passportMessageOrNull
|
||||||
import dev.inmo.tgbotapi.types.message.PassportMessage
|
import dev.inmo.tgbotapi.types.message.PassportMessage
|
||||||
import dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElement
|
import dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElement
|
||||||
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
||||||
@@ -17,7 +17,7 @@ internal suspend inline fun <BC : BehaviourContext, reified T : EncryptedPasspor
|
|||||||
markerFactory: MarkerFactory<in PassportMessage, Any> = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in PassportMessage, Any> = ByChatMessageMarkerFactory,
|
||||||
noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, PassportMessage>
|
noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, PassportMessage>
|
||||||
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
|
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
|
||||||
(it.asMessageUpdate() ?.data ?.asPassportMessage() ?.takeIf { it.passportData.data.any { it is T } }) ?.let(::listOfNotNull)
|
(it.messageUpdateOrNull() ?.data ?.passportMessageOrNull() ?.takeIf { it.passportData.data.any { it is T } }) ?.let(::listOfNotNull)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import dev.inmo.tgbotapi.extensions.behaviour_builder.*
|
|||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.ByIdPollAnswerMarkerFactory
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.ByIdPollAnswerMarkerFactory
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory
|
||||||
import dev.inmo.tgbotapi.extensions.utils.asPollAnswerUpdate
|
import dev.inmo.tgbotapi.extensions.utils.pollAnswerUpdateOrNull
|
||||||
import dev.inmo.tgbotapi.types.polls.PollAnswer
|
import dev.inmo.tgbotapi.types.polls.PollAnswer
|
||||||
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
||||||
|
|
||||||
@@ -16,7 +16,7 @@ internal suspend inline fun <BC : BehaviourContext> BC.onPollAnswered(
|
|||||||
markerFactory: MarkerFactory<in PollAnswer, Any> = ByIdPollAnswerMarkerFactory,
|
markerFactory: MarkerFactory<in PollAnswer, Any> = ByIdPollAnswerMarkerFactory,
|
||||||
noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, PollAnswer>
|
noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, PollAnswer>
|
||||||
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
|
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
|
||||||
(it.asPollAnswerUpdate() ?.data) ?.let(::listOfNotNull)
|
(it.pollAnswerUpdateOrNull() ?.data) ?.let(::listOfNotNull)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import dev.inmo.tgbotapi.extensions.behaviour_builder.*
|
|||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.ByIdPollMarkerFactory
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.ByIdPollMarkerFactory
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory
|
||||||
import dev.inmo.tgbotapi.extensions.utils.asPollUpdate
|
import dev.inmo.tgbotapi.extensions.utils.pollUpdateOrNull
|
||||||
import dev.inmo.tgbotapi.types.polls.*
|
import dev.inmo.tgbotapi.types.polls.*
|
||||||
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
||||||
|
|
||||||
@@ -16,7 +16,7 @@ internal suspend inline fun <BC : BehaviourContext, reified T : Poll> BC.onPollU
|
|||||||
markerFactory: MarkerFactory<in T, Any> = ByIdPollMarkerFactory,
|
markerFactory: MarkerFactory<in T, Any> = ByIdPollMarkerFactory,
|
||||||
noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, T>
|
noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, T>
|
||||||
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
|
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
|
||||||
(it.asPollUpdate() ?.data as? T) ?.let(::listOfNotNull)
|
(it.pollUpdateOrNull() ?.data as? T) ?.let(::listOfNotNull)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import dev.inmo.tgbotapi.extensions.behaviour_builder.filters.PreCheckoutQueryFi
|
|||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.ByUserPreCheckoutQueryMarkerFactory
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.ByUserPreCheckoutQueryMarkerFactory
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory
|
||||||
import dev.inmo.tgbotapi.extensions.utils.asPreCheckoutQueryUpdate
|
import dev.inmo.tgbotapi.extensions.utils.preCheckoutQueryUpdateOrNull
|
||||||
import dev.inmo.tgbotapi.types.payments.PreCheckoutQuery
|
import dev.inmo.tgbotapi.types.payments.PreCheckoutQuery
|
||||||
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
||||||
|
|
||||||
@@ -31,5 +31,5 @@ suspend fun <BC : BehaviourContext> BC.onPreCheckoutQuery(
|
|||||||
markerFactory: MarkerFactory<in PreCheckoutQuery, Any> = ByUserPreCheckoutQueryMarkerFactory,
|
markerFactory: MarkerFactory<in PreCheckoutQuery, Any> = ByUserPreCheckoutQueryMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, PreCheckoutQuery>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, PreCheckoutQuery>
|
||||||
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
|
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
|
||||||
(it.asPreCheckoutQueryUpdate() ?.data) ?.let(::listOfNotNull)
|
(it.preCheckoutQueryUpdateOrNull() ?.data) ?.let(::listOfNotNull)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import dev.inmo.tgbotapi.extensions.behaviour_builder.filters.ShippingQueryFilte
|
|||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.ByUserShippingQueryMarkerFactory
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.ByUserShippingQueryMarkerFactory
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory
|
||||||
import dev.inmo.tgbotapi.extensions.utils.asShippingQueryUpdate
|
import dev.inmo.tgbotapi.extensions.utils.shippingQueryUpdateOrNull
|
||||||
import dev.inmo.tgbotapi.types.payments.ShippingQuery
|
import dev.inmo.tgbotapi.types.payments.ShippingQuery
|
||||||
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
||||||
|
|
||||||
@@ -31,5 +31,5 @@ suspend fun <BC : BehaviourContext> BC.onShippingQuery(
|
|||||||
markerFactory: MarkerFactory<in ShippingQuery, Any> = ByUserShippingQueryMarkerFactory,
|
markerFactory: MarkerFactory<in ShippingQuery, Any> = ByUserShippingQueryMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ShippingQuery>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ShippingQuery>
|
||||||
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
|
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
|
||||||
(it.asShippingQueryUpdate() ?.data) ?.let(::listOfNotNull)
|
(it.shippingQueryUpdateOrNull() ?.data) ?.let(::listOfNotNull)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package dev.inmo.tgbotapi.extensions.behaviour_builder.utils
|
|||||||
|
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTypeReceiver
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTypeReceiver
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.waitEditedLocation
|
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.waitEditedLocationMessage
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.waitEditedLocationMessage
|
||||||
import dev.inmo.tgbotapi.types.location.*
|
import dev.inmo.tgbotapi.types.location.*
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ fun interface SimpleFilter<in T> {
|
|||||||
suspend operator fun invoke(o: T): Boolean
|
suspend operator fun invoke(o: T): Boolean
|
||||||
}
|
}
|
||||||
val TrueSimpleFilter = SimpleFilter<Any?> { true }
|
val TrueSimpleFilter = SimpleFilter<Any?> { true }
|
||||||
|
val FalseSimpleFilter = SimpleFilter<Any?> { false }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return [SimpleFilter] which will return true in case when all the items in incoming data passed [this] filter
|
* @return [SimpleFilter] which will return true in case when all the items in incoming data passed [this] filter
|
||||||
@@ -28,21 +29,29 @@ fun <T> SimpleFilter<T>.listNone() = SimpleFilter<Iterable<T>> {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Makes an AND (&&) operation between [this] and [other]
|
* Makes an AND (&&) operation between [this] and [other]
|
||||||
|
*
|
||||||
|
* * When both arguments are null, [TrueSimpleFilter] will be returned
|
||||||
*/
|
*/
|
||||||
operator fun <T> SimpleFilter<T>?.times(other: SimpleFilter<T>): SimpleFilter<T> = this ?.let {
|
infix operator fun <T> SimpleFilter<T>?.times(other: SimpleFilter<T>?): SimpleFilter<T> = this ?.let {
|
||||||
SimpleFilter {
|
other ?.let {
|
||||||
this(it) && other(it)
|
SimpleFilter {
|
||||||
}
|
this(it) && other(it)
|
||||||
} ?: other
|
}
|
||||||
|
} ?: it
|
||||||
|
} ?: other ?: TrueSimpleFilter
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Makes an OR (||) operation between [this] and [other]
|
* Makes an OR (||) operation between [this] and [other]
|
||||||
|
*
|
||||||
|
* * When both arguments are null, [TrueSimpleFilter] will be returned
|
||||||
*/
|
*/
|
||||||
operator fun <T> SimpleFilter<T>?.plus(other: SimpleFilter<T>): SimpleFilter<T> = this ?.let {
|
infix operator fun <T> SimpleFilter<T>?.plus(other: SimpleFilter<T>?): SimpleFilter<T> = this ?.let {
|
||||||
SimpleFilter {
|
other ?.let {
|
||||||
this(it) || other(it)
|
SimpleFilter {
|
||||||
}
|
this(it) || other(it)
|
||||||
} ?: other
|
}
|
||||||
|
} ?: it
|
||||||
|
} ?: other ?: TrueSimpleFilter
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reverse results of [this]
|
* Reverse results of [this]
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.behaviour_builder.utils.handlers_registrar
|
package dev.inmo.tgbotapi.extensions.behaviour_builder.utils.handlers_registrar
|
||||||
|
|
||||||
|
import dev.inmo.micro_utils.coroutines.runCatchingSafely
|
||||||
import kotlinx.coroutines.sync.Mutex
|
import kotlinx.coroutines.sync.Mutex
|
||||||
import kotlinx.coroutines.sync.withLock
|
import kotlinx.coroutines.sync.withLock
|
||||||
|
|
||||||
@@ -7,6 +8,7 @@ open class HandleableTriggersHolder<T>(
|
|||||||
preset: List<T> = emptyList()
|
preset: List<T> = emptyList()
|
||||||
) {
|
) {
|
||||||
protected val commandsMutex = Mutex()
|
protected val commandsMutex = Mutex()
|
||||||
|
protected val handleableCounts = mutableMapOf<T, Int>()
|
||||||
protected val _handleable = mutableListOf<T>().also {
|
protected val _handleable = mutableListOf<T>().also {
|
||||||
it.addAll(preset)
|
it.addAll(preset)
|
||||||
}
|
}
|
||||||
@@ -16,12 +18,31 @@ open class HandleableTriggersHolder<T>(
|
|||||||
suspend fun registerHandleable(data: T) {
|
suspend fun registerHandleable(data: T) {
|
||||||
commandsMutex.withLock {
|
commandsMutex.withLock {
|
||||||
_handleable.add(data)
|
_handleable.add(data)
|
||||||
|
handleableCounts[data] = (handleableCounts[data] ?: 0) + 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun unregisterHandleable(data: T) {
|
suspend fun unregisterHandleable(data: T) {
|
||||||
commandsMutex.withLock {
|
commandsMutex.withLock {
|
||||||
_handleable.remove(data)
|
val newHandleableCount = (handleableCounts[data] ?: 0) - 1
|
||||||
|
if (newHandleableCount > 0) {
|
||||||
|
handleableCounts[data] = newHandleableCount
|
||||||
|
} else {
|
||||||
|
handleableCounts.remove(data)
|
||||||
|
_handleable.remove(data)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
suspend fun <T, R> HandleableTriggersHolder<T>.doWithRegistration(
|
||||||
|
data: T,
|
||||||
|
block: suspend () -> R
|
||||||
|
): R {
|
||||||
|
registerHandleable(data)
|
||||||
|
val result = runCatchingSafely {
|
||||||
|
block()
|
||||||
|
}
|
||||||
|
unregisterHandleable(data)
|
||||||
|
return result.getOrThrow()
|
||||||
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user