mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2025-11-16 12:00:18 +00:00
Compare commits
142 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| fbe8c9419d | |||
| aba5810319 | |||
| 7d7658c64f | |||
| c4fdc350ce | |||
| f700fab33f | |||
| f078041dec | |||
| dd6b688ae4 | |||
| 0d37147a36 | |||
| ee0c017a79 | |||
| b5d5eeb62d | |||
| d715bc0a9e | |||
| 113621f619 | |||
| 6a899f1217 | |||
| 6bc96162a8 | |||
| 4736610aa8 | |||
| f6f07a5e8a | |||
| b32ce88a97 | |||
| 47f514a635 | |||
| a80ed2ec57 | |||
| b1bba43f29 | |||
| 9df258805d | |||
| 8654437293 | |||
| bdbca92fe5 | |||
| aca4d90608 | |||
| ad75aef64f | |||
| 5bf30bc6c6 | |||
| acd3298d4d | |||
| 3f6f04d00f | |||
| c7f372c1e3 | |||
| 1ed620df85 | |||
| 541e00fa03 | |||
| 867a46d397 | |||
| 8f4eb74e39 | |||
| 16cc49e412 | |||
| f58614e5be | |||
|
|
c3a09b53fc | ||
| c8413e1d18 | |||
| 8b15296ee7 | |||
| 0fcc717269 | |||
| 2ce26b4f1e | |||
| b5d499b623 | |||
| 102515dc8a | |||
| 777a58ce9a | |||
| 7471da4ff0 | |||
| e753db0e71 | |||
| 70984424e3 | |||
| c8354a330e | |||
| 037ad8b87c | |||
|
|
89550107d6 | ||
|
|
86cc7cfb3d | ||
|
|
858586e608 | ||
| d9846f27c9 | |||
| c10da2a10a | |||
| 8ed216619d | |||
| 62a9c687d5 | |||
| c2918c308f | |||
|
|
81fbff0bf5 | ||
| 54fb58de81 | |||
| 94ed4fed10 | |||
| 63ceec70ca | |||
| 636382fc8f | |||
| ac7bf60182 | |||
| bd91d4a0c0 | |||
|
|
7488eb9d4b | ||
| 6fcd248aff | |||
| 5fa1804003 | |||
|
|
0c9919e9e7 | ||
|
|
9405aa4467 | ||
| 4f75bc792d | |||
| fda53cf171 | |||
| b588622c3d | |||
| 8b64a0c94e | |||
| 959f0dffba | |||
| 8fc9185884 | |||
| 3a9cf03958 | |||
| 7cd97ac779 | |||
| c460b4eacc | |||
| 0aa58bd9f6 | |||
| a4a82f69c6 | |||
| d450ed9126 | |||
| 69c5f1ae7d | |||
| e4e8eadfb5 | |||
| c1374c118d | |||
| 6004b159ec | |||
| 67f95682d5 | |||
| 5aa5460a43 | |||
| e937845fc7 | |||
| 96f40e55bc | |||
| 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 |
125
CHANGELOG.md
125
CHANGELOG.md
@@ -1,5 +1,130 @@
|
|||||||
# TelegramBotAPI changelog
|
# TelegramBotAPI changelog
|
||||||
|
|
||||||
|
## 4.0.0
|
||||||
|
|
||||||
|
**!!! THIS UPDATE CONTAINS FULL REWORK OF MEDIA GROUPS FUNCTIONALITY !!!**
|
||||||
|
|
||||||
|
**THIS UPDATE CONTAINS BREAKING CHANGES**
|
||||||
|
|
||||||
|
* `Common`:
|
||||||
|
* All the media groups have been rewritten. Since this update, there are no separated messages types for media groups,
|
||||||
|
but new type of content (`MediaGroupContent`) has been introduced
|
||||||
|
* [Bot API 6.3](https://core.telegram.org/bots/api-changelog#november-5-2022) support
|
||||||
|
* `Versions`:
|
||||||
|
* `MicroUtils`: `0.13.2` -> `0.14.0`
|
||||||
|
* `Core`:
|
||||||
|
* New requests
|
||||||
|
|
||||||
|
## 3.3.1
|
||||||
|
|
||||||
|
* `Versions`:
|
||||||
|
* `Ktor`: `2.1.2` -> `2.1.3`
|
||||||
|
* `Klock`: `3.2.0` -> `3.3.1`
|
||||||
|
* `MicroUtils`: `0.13.1` -> `0.13.2`
|
||||||
|
* `Utils`:
|
||||||
|
* New extensions on `CommonMessage`: `hasCommands` and `hasNoCommands`. Useful for the `initialFilter` parameter in behaviour builder triggers.
|
||||||
|
|
||||||
|
## 3.3.0
|
||||||
|
|
||||||
|
**THIS VERSION CONTAINS UPGRADE KOTLIN (AND ALL RELATED LIBRARIES) UP TO 1.7.20**
|
||||||
|
|
||||||
|
* `Versions`:
|
||||||
|
* `Kotlin`: `1.7.10` -> `1.7.20`
|
||||||
|
* `Kotlin Serialization`: `1.4.0` -> `1.4.1`
|
||||||
|
* `Korlibs`: `3.1.0` -> `3.2.0`
|
||||||
|
* `MicroUtils`: `0.12.17` -> `0.13.1`
|
||||||
|
* `Core`:
|
||||||
|
* Add opportunity to create command text source and add command in entities builder
|
||||||
|
via `BotCommamd` (thanks to [d1shin](https://github.com/InsanusMokrassar/TelegramBotAPI/pull/664))
|
||||||
|
* `API`:
|
||||||
|
* New extensions `TelegramBot#getStickerSetOrNull` and `TelegramBot#getStickerSetOrThrow`
|
||||||
|
* Old `TelegramBot#getStickerSet` has been deprecated
|
||||||
|
* `Behaviour Builder`:
|
||||||
|
* Add opportunity to use triggers and waiters with `BotCommand` (thanks to [d1shin](https://github.com/InsanusMokrassar/TelegramBotAPI/pull/664))
|
||||||
|
|
||||||
|
## 3.2.7
|
||||||
|
|
||||||
|
* `Versions`:
|
||||||
|
* `MicroUtils`: `0.12.13` -> `0.12.17`
|
||||||
|
* `Ktor`: `2.1.1` -> `2.1.2`
|
||||||
|
* `Utils`:
|
||||||
|
* Next classes become typealiases instead of classes:
|
||||||
|
* `ReplyKeyboardBuilder`
|
||||||
|
* `ReplyKeyboardRowBuilder`
|
||||||
|
* `InlineKeyboardBuilder`
|
||||||
|
* `InlineKeyboardRowBuilder`
|
||||||
|
|
||||||
|
## 3.2.6
|
||||||
|
|
||||||
|
* `Core`:
|
||||||
|
* Fixes in `ChatMemberSerializer#serialize` method
|
||||||
|
* Migration of `EntitiesBuilder` from `Utils` to `Core`
|
||||||
|
* `API`:
|
||||||
|
* All the extensions related to text messages (replies, sending, editing) got their duplicates with `buildEntities` lambda and separator
|
||||||
|
* `Utils`:
|
||||||
|
* Migration of `EntitiesBuilder` from `Utils` to `Core`
|
||||||
|
|
||||||
|
## 3.2.5
|
||||||
|
|
||||||
|
* `Common`:
|
||||||
|
* Improve support of new exceptions recovering mechanism
|
||||||
|
|
||||||
|
## 3.2.4
|
||||||
|
|
||||||
|
* `API`:
|
||||||
|
* New `edit`'s with chats and message ids
|
||||||
|
|
||||||
|
## 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
|
## 3.0.2
|
||||||
|
|
||||||
**ALL OLD DEPRECATIONS HAVE BEEN REMOVED**
|
**ALL OLD DEPRECATIONS HAVE BEEN REMOVED**
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# 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#november-5-2022)
|
||||||
|
|
||||||
| Docs | [](https://tgbotapi.inmo.dev/index.html) [](https://bookstack.inmo.dev/books/telegrambotapi/chapter/introduction-tutorial) |
|
| Docs | [](https://tgbotapi.inmo.dev/index.html) [](https://bookstack.inmo.dev/books/telegrambotapi/chapter/introduction-tutorial) |
|
||||||
|:---:|:---:|
|
|:---:|:---:|
|
||||||
@@ -116,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).
|
||||||
|
|||||||
@@ -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=3.0.2
|
library_version=4.0.0
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
[versions]
|
[versions]
|
||||||
|
|
||||||
kotlin = "1.7.10"
|
kotlin = "1.7.20"
|
||||||
kotlin-serialization = "1.4.0-RC"
|
kotlin-serialization = "1.4.1"
|
||||||
kotlin-coroutines = "1.6.4"
|
kotlin-coroutines = "1.6.4"
|
||||||
|
|
||||||
javax-activation = "1.1.1"
|
javax-activation = "1.1.1"
|
||||||
|
|
||||||
korlibs = "3.0.0"
|
korlibs = "3.3.1"
|
||||||
uuid = "0.5.0"
|
uuid = "0.5.0"
|
||||||
ktor = "2.0.3"
|
ktor = "2.1.3"
|
||||||
|
|
||||||
ksp = "1.7.10-1.0.6"
|
ksp = "1.7.20-1.0.8"
|
||||||
kotlin-poet = "1.12.0"
|
kotlin-poet = "1.12.0"
|
||||||
|
|
||||||
microutils = "0.12.0"
|
microutils = "0.14.0"
|
||||||
|
|
||||||
github-release-plugin = "2.4.1"
|
github-release-plugin = "2.4.1"
|
||||||
|
|
||||||
|
|||||||
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
|
||||||
|
|||||||
@@ -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,54 +3,61 @@ 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.MessageThreadId
|
||||||
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,
|
||||||
|
threadId: MessageThreadId? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false
|
protectContent: Boolean = false
|
||||||
) = execute(
|
) = execute(
|
||||||
ForwardMessage(fromChatId, toChatId, messageId, disableNotification, protectContent)
|
ForwardMessage(fromChatId, toChatId, messageId, threadId, disableNotification, protectContent)
|
||||||
)
|
)
|
||||||
|
|
||||||
suspend fun TelegramBot.forwardMessage(
|
suspend fun TelegramBot.forwardMessage(
|
||||||
fromChat: Chat,
|
fromChat: Chat,
|
||||||
toChatId: ChatIdentifier,
|
toChatId: ChatIdentifier,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageId,
|
||||||
|
threadId: MessageThreadId? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false
|
protectContent: Boolean = false
|
||||||
) = forwardMessage(fromChat.id, toChatId, messageId, disableNotification, protectContent)
|
) = forwardMessage(fromChat.id, toChatId, messageId, threadId, disableNotification, protectContent)
|
||||||
|
|
||||||
suspend fun TelegramBot.forwardMessage(
|
suspend fun TelegramBot.forwardMessage(
|
||||||
fromChatId: ChatIdentifier,
|
fromChatId: ChatIdentifier,
|
||||||
toChat: Chat,
|
toChat: Chat,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageId,
|
||||||
|
threadId: MessageThreadId? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false
|
protectContent: Boolean = false
|
||||||
) = forwardMessage(fromChatId, toChat.id, messageId, disableNotification, protectContent)
|
) = forwardMessage(fromChatId, toChat.id, messageId, threadId, disableNotification, protectContent)
|
||||||
|
|
||||||
suspend fun TelegramBot.forwardMessage(
|
suspend fun TelegramBot.forwardMessage(
|
||||||
fromChat: Chat,
|
fromChat: Chat,
|
||||||
toChat: Chat,
|
toChat: Chat,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageId,
|
||||||
|
threadId: MessageThreadId? = null,
|
||||||
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, threadId, disableNotification, protectContent)
|
||||||
|
|
||||||
suspend fun TelegramBot.forwardMessage(
|
suspend fun TelegramBot.forwardMessage(
|
||||||
toChatId: ChatIdentifier,
|
toChatId: ChatIdentifier,
|
||||||
message: Message,
|
message: Message,
|
||||||
|
threadId: MessageThreadId? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false
|
protectContent: Boolean = false
|
||||||
) = forwardMessage(message.chat, toChatId, message.messageId, disableNotification, protectContent)
|
) = forwardMessage(message.chat, toChatId, message.messageId, threadId, disableNotification, protectContent)
|
||||||
|
|
||||||
suspend fun TelegramBot.forwardMessage(
|
suspend fun TelegramBot.forwardMessage(
|
||||||
toChat: Chat,
|
toChat: Chat,
|
||||||
message: Message,
|
message: Message,
|
||||||
|
threadId: MessageThreadId? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false
|
protectContent: Boolean = false
|
||||||
) = forwardMessage(message.chat, toChat, message.messageId, disableNotification, protectContent)
|
) = forwardMessage(message.chat, toChat, message.messageId, threadId, disableNotification, protectContent)
|
||||||
|
|||||||
@@ -1,70 +1,57 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.api.InternalUtils
|
package dev.inmo.tgbotapi.extensions.api.InternalUtils
|
||||||
|
|
||||||
import dev.inmo.tgbotapi.types.MediaGroupIdentifier
|
import dev.inmo.tgbotapi.types.MediaGroupIdentifier
|
||||||
import dev.inmo.tgbotapi.types.UpdateIdentifier
|
import dev.inmo.tgbotapi.types.message.abstracts.PossiblySentViaBotCommonMessage
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.MediaGroupMessage
|
import dev.inmo.tgbotapi.types.message.content.MediaGroupPartContent
|
||||||
import dev.inmo.tgbotapi.types.update.*
|
import dev.inmo.tgbotapi.types.update.*
|
||||||
import dev.inmo.tgbotapi.types.update.abstracts.*
|
import dev.inmo.tgbotapi.types.update.abstracts.*
|
||||||
import dev.inmo.tgbotapi.types.update.media_group.*
|
import dev.inmo.tgbotapi.utils.extensions.asMediaGroupMessage
|
||||||
|
|
||||||
internal fun Update.lastUpdateIdentifier(): UpdateIdentifier {
|
|
||||||
return if (this is SentMediaGroupUpdate) {
|
|
||||||
origins.last().updateId
|
|
||||||
} else {
|
|
||||||
updateId
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
internal fun List<Update>.lastUpdateIdentifier(): UpdateIdentifier? {
|
|
||||||
return maxByOrNull { it.updateId } ?.lastUpdateIdentifier()
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Will convert incoming list of updates to list with [MediaGroupUpdate]s
|
||||||
|
*/
|
||||||
internal fun List<Update>.convertWithMediaGroupUpdates(): List<Update> {
|
internal fun List<Update>.convertWithMediaGroupUpdates(): List<Update> {
|
||||||
val resultUpdates = mutableListOf<Update>()
|
val resultUpdates = mutableListOf<Update>()
|
||||||
val mediaGroups = mutableMapOf<MediaGroupIdentifier, MutableList<BaseSentMessageUpdate>>()
|
val mediaGroups = mutableMapOf<MediaGroupIdentifier, MutableList<Pair<BaseSentMessageUpdate, PossiblySentViaBotCommonMessage<MediaGroupPartContent>>>>()
|
||||||
|
|
||||||
for (update in this) {
|
for (update in this) {
|
||||||
val data = (update.data as? MediaGroupMessage<*>)
|
val message = (update.data as? PossiblySentViaBotCommonMessage<*>) ?.let {
|
||||||
if (data == null) {
|
if (it.content is MediaGroupPartContent) {
|
||||||
|
it as PossiblySentViaBotCommonMessage<MediaGroupPartContent>
|
||||||
|
} else {
|
||||||
|
null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
val mediaGroupId = message ?.mediaGroupId
|
||||||
|
if (message == null || mediaGroupId == null) {
|
||||||
resultUpdates.add(update)
|
resultUpdates.add(update)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
when (update) {
|
when (update) {
|
||||||
is BaseEditMessageUpdate -> resultUpdates.add(
|
|
||||||
update.toEditMediaGroupUpdate()
|
|
||||||
)
|
|
||||||
is BaseSentMessageUpdate -> {
|
is BaseSentMessageUpdate -> {
|
||||||
mediaGroups.getOrPut(data.mediaGroupId) {
|
mediaGroups.getOrPut(mediaGroupId) {
|
||||||
mutableListOf()
|
mutableListOf()
|
||||||
}.add(update)
|
}.add(update to message)
|
||||||
}
|
}
|
||||||
else -> resultUpdates.add(update)
|
else -> resultUpdates.add(update)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mediaGroups.values.map {
|
|
||||||
it.toSentMediaGroupUpdate() ?.let { mediaGroupUpdate ->
|
mediaGroups.map { (_, updatesWithMessages) ->
|
||||||
resultUpdates.add(mediaGroupUpdate)
|
val update = updatesWithMessages.maxBy { it.first.updateId }.first
|
||||||
}
|
resultUpdates.add(
|
||||||
|
update.copy(updatesWithMessages.map { it.second }.asMediaGroupMessage())
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
resultUpdates.sortBy { it.updateId }
|
resultUpdates.sortBy { it.updateId }
|
||||||
return resultUpdates
|
return resultUpdates
|
||||||
}
|
}
|
||||||
|
|
||||||
internal fun List<BaseSentMessageUpdate>.toSentMediaGroupUpdate(): SentMediaGroupUpdate? = (this as? SentMediaGroupUpdate) ?: let {
|
/**
|
||||||
if (isEmpty()) {
|
* @return [EditMessageMediaGroupUpdate] in case if [this] is [EditMessageUpdate]. When [this] object is
|
||||||
return@let null
|
* [EditChannelPostUpdate] instance - will return [EditChannelPostMediaGroupUpdate]
|
||||||
}
|
*
|
||||||
val resultList = sortedBy { it.updateId }
|
* @throws IllegalStateException
|
||||||
when (first()) {
|
*/
|
||||||
is MessageUpdate -> MessageMediaGroupUpdate(resultList)
|
internal fun BaseEditMessageUpdate.toEditMediaGroupUpdate() = this
|
||||||
is ChannelPostUpdate -> ChannelPostMediaGroupUpdate(resultList)
|
|
||||||
else -> null
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
internal fun BaseEditMessageUpdate.toEditMediaGroupUpdate(): EditMediaGroupUpdate = (this as? EditMediaGroupUpdate) ?: let {
|
|
||||||
when (this) {
|
|
||||||
is EditMessageUpdate -> EditMessageMediaGroupUpdate(this)
|
|
||||||
is EditChannelPostUpdate -> EditChannelPostMediaGroupUpdate(this)
|
|
||||||
else -> error("Unsupported type of ${BaseEditMessageUpdate::class.simpleName}")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -5,7 +5,9 @@ import dev.inmo.micro_utils.coroutines.launchSafelyWithoutExceptions
|
|||||||
import dev.inmo.tgbotapi.abstracts.*
|
import dev.inmo.tgbotapi.abstracts.*
|
||||||
import dev.inmo.tgbotapi.abstracts.types.WithReplyMarkup
|
import dev.inmo.tgbotapi.abstracts.types.WithReplyMarkup
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
|
import dev.inmo.tgbotapi.extensions.api.edit.edit
|
||||||
import dev.inmo.tgbotapi.extensions.api.edit.location.live.editLiveLocation
|
import dev.inmo.tgbotapi.extensions.api.edit.location.live.editLiveLocation
|
||||||
|
import dev.inmo.tgbotapi.extensions.api.send.send
|
||||||
import dev.inmo.tgbotapi.extensions.api.send.sendLiveLocation
|
import dev.inmo.tgbotapi.extensions.api.send.sendLiveLocation
|
||||||
import dev.inmo.tgbotapi.types.*
|
import dev.inmo.tgbotapi.types.*
|
||||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||||
@@ -39,9 +41,10 @@ suspend fun TelegramBot.handleLiveLocation(
|
|||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
locationsFlow: Flow<EditLiveLocationInfo>,
|
locationsFlow: Flow<EditLiveLocationInfo>,
|
||||||
liveTimeMillis: Long = defaultLivePeriodDelayMillis,
|
liveTimeMillis: Long = defaultLivePeriodDelayMillis,
|
||||||
|
threadId: MessageThreadId? = 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
|
||||||
) {
|
) {
|
||||||
var currentLiveLocationMessage: ContentMessage<LocationContent>? = null
|
var currentLiveLocationMessage: ContentMessage<LocationContent>? = null
|
||||||
@@ -56,7 +59,7 @@ suspend fun TelegramBot.handleLiveLocation(
|
|||||||
val capturedLiveLocationMessage = currentLiveLocationMessage
|
val capturedLiveLocationMessage = currentLiveLocationMessage
|
||||||
if (capturedLiveLocationMessage == null) {
|
if (capturedLiveLocationMessage == null) {
|
||||||
updateMessageJob.start()
|
updateMessageJob.start()
|
||||||
currentLiveLocationMessage = sendLiveLocation(
|
currentLiveLocationMessage = send(
|
||||||
chatId,
|
chatId,
|
||||||
it.latitude,
|
it.latitude,
|
||||||
it.longitude,
|
it.longitude,
|
||||||
@@ -64,6 +67,7 @@ suspend fun TelegramBot.handleLiveLocation(
|
|||||||
it.horizontalAccuracy,
|
it.horizontalAccuracy,
|
||||||
it.heading,
|
it.heading,
|
||||||
it.proximityAlertRadius,
|
it.proximityAlertRadius,
|
||||||
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
replyToMessageId,
|
replyToMessageId,
|
||||||
@@ -71,7 +75,7 @@ suspend fun TelegramBot.handleLiveLocation(
|
|||||||
it.replyMarkup
|
it.replyMarkup
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
editLiveLocation(
|
edit(
|
||||||
capturedLiveLocationMessage,
|
capturedLiveLocationMessage,
|
||||||
it.latitude,
|
it.latitude,
|
||||||
it.longitude,
|
it.longitude,
|
||||||
@@ -94,9 +98,10 @@ suspend fun TelegramBot.handleLiveLocation(
|
|||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
locationsFlow: Flow<Location>,
|
locationsFlow: Flow<Location>,
|
||||||
liveTimeMillis: Long = defaultLivePeriodDelayMillis,
|
liveTimeMillis: Long = defaultLivePeriodDelayMillis,
|
||||||
|
threadId: MessageThreadId? = 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
|
||||||
) {
|
) {
|
||||||
handleLiveLocation(
|
handleLiveLocation(
|
||||||
@@ -112,6 +117,7 @@ suspend fun TelegramBot.handleLiveLocation(
|
|||||||
)
|
)
|
||||||
},
|
},
|
||||||
liveTimeMillis,
|
liveTimeMillis,
|
||||||
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
replyToMessageId,
|
replyToMessageId,
|
||||||
@@ -129,9 +135,10 @@ suspend fun TelegramBot.handleLiveLocation(
|
|||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
locationsFlow: Flow<Pair<Double, Double>>,
|
locationsFlow: Flow<Pair<Double, Double>>,
|
||||||
liveTimeMillis: Long = defaultLivePeriodDelayMillis,
|
liveTimeMillis: Long = defaultLivePeriodDelayMillis,
|
||||||
|
threadId: MessageThreadId? = 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
|
||||||
) {
|
) {
|
||||||
handleLiveLocation(
|
handleLiveLocation(
|
||||||
@@ -143,6 +150,7 @@ suspend fun TelegramBot.handleLiveLocation(
|
|||||||
)
|
)
|
||||||
},
|
},
|
||||||
liveTimeMillis,
|
liveTimeMillis,
|
||||||
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
replyToMessageId,
|
replyToMessageId,
|
||||||
|
|||||||
@@ -90,9 +90,10 @@ suspend fun TelegramBot.startLiveLocation(
|
|||||||
initHorizontalAccuracy: Meters? = null,
|
initHorizontalAccuracy: Meters? = null,
|
||||||
initHeading: Degrees? = null,
|
initHeading: Degrees? = null,
|
||||||
initProximityAlertRadius: Meters? = null,
|
initProximityAlertRadius: Meters? = null,
|
||||||
|
threadId: MessageThreadId? = 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 {
|
||||||
@@ -106,6 +107,7 @@ suspend fun TelegramBot.startLiveLocation(
|
|||||||
initHorizontalAccuracy,
|
initHorizontalAccuracy,
|
||||||
initHeading,
|
initHeading,
|
||||||
initProximityAlertRadius,
|
initProximityAlertRadius,
|
||||||
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
replyToMessageId,
|
replyToMessageId,
|
||||||
@@ -135,9 +137,10 @@ suspend fun TelegramBot.startLiveLocation(
|
|||||||
initHorizontalAccuracy: Meters? = null,
|
initHorizontalAccuracy: Meters? = null,
|
||||||
initHeading: Degrees? = null,
|
initHeading: Degrees? = null,
|
||||||
initProximityAlertRadius: Meters? = null,
|
initProximityAlertRadius: Meters? = null,
|
||||||
|
threadId: MessageThreadId? = 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(
|
||||||
@@ -149,6 +152,7 @@ suspend fun TelegramBot.startLiveLocation(
|
|||||||
initHorizontalAccuracy,
|
initHorizontalAccuracy,
|
||||||
initHeading,
|
initHeading,
|
||||||
initProximityAlertRadius,
|
initProximityAlertRadius,
|
||||||
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
replyToMessageId,
|
replyToMessageId,
|
||||||
@@ -168,9 +172,10 @@ suspend fun TelegramBot.startLiveLocation(
|
|||||||
initHorizontalAccuracy: Meters? = null,
|
initHorizontalAccuracy: Meters? = null,
|
||||||
initHeading: Degrees? = null,
|
initHeading: Degrees? = null,
|
||||||
initProximityAlertRadius: Meters? = null,
|
initProximityAlertRadius: Meters? = null,
|
||||||
|
threadId: MessageThreadId? = 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(
|
||||||
@@ -182,6 +187,7 @@ suspend fun TelegramBot.startLiveLocation(
|
|||||||
initHorizontalAccuracy,
|
initHorizontalAccuracy,
|
||||||
initHeading,
|
initHeading,
|
||||||
initProximityAlertRadius,
|
initProximityAlertRadius,
|
||||||
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
replyToMessageId,
|
replyToMessageId,
|
||||||
@@ -201,9 +207,10 @@ suspend fun TelegramBot.startLiveLocation(
|
|||||||
initHorizontalAccuracy: Meters? = null,
|
initHorizontalAccuracy: Meters? = null,
|
||||||
initHeading: Degrees? = null,
|
initHeading: Degrees? = null,
|
||||||
initProximityAlertRadius: Meters? = null,
|
initProximityAlertRadius: Meters? = null,
|
||||||
|
threadId: MessageThreadId? = 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(
|
||||||
@@ -215,6 +222,7 @@ suspend fun TelegramBot.startLiveLocation(
|
|||||||
initHorizontalAccuracy,
|
initHorizontalAccuracy,
|
||||||
initHeading,
|
initHeading,
|
||||||
initProximityAlertRadius,
|
initProximityAlertRadius,
|
||||||
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
replyToMessageId,
|
replyToMessageId,
|
||||||
@@ -235,6 +243,7 @@ suspend inline fun TelegramBot.replyWithLiveLocation(
|
|||||||
initHorizontalAccuracy: Meters? = null,
|
initHorizontalAccuracy: Meters? = null,
|
||||||
initHeading: Degrees? = null,
|
initHeading: Degrees? = null,
|
||||||
initProximityAlertRadius: Meters? = null,
|
initProximityAlertRadius: Meters? = null,
|
||||||
|
threadId: MessageThreadId? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
@@ -248,6 +257,7 @@ suspend inline fun TelegramBot.replyWithLiveLocation(
|
|||||||
initHorizontalAccuracy,
|
initHorizontalAccuracy,
|
||||||
initHeading,
|
initHeading,
|
||||||
initProximityAlertRadius,
|
initProximityAlertRadius,
|
||||||
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
to.messageId,
|
to.messageId,
|
||||||
@@ -267,6 +277,7 @@ suspend inline fun TelegramBot.replyWithLiveLocation(
|
|||||||
initHorizontalAccuracy: Meters? = null,
|
initHorizontalAccuracy: Meters? = null,
|
||||||
initHeading: Degrees? = null,
|
initHeading: Degrees? = null,
|
||||||
initProximityAlertRadius: Meters? = null,
|
initProximityAlertRadius: Meters? = null,
|
||||||
|
threadId: MessageThreadId? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
@@ -279,6 +290,7 @@ suspend inline fun TelegramBot.replyWithLiveLocation(
|
|||||||
initHorizontalAccuracy,
|
initHorizontalAccuracy,
|
||||||
initHeading,
|
initHeading,
|
||||||
initProximityAlertRadius,
|
initProximityAlertRadius,
|
||||||
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
to.messageId,
|
to.messageId,
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
package dev.inmo.tgbotapi.extensions.api.chat.forum
|
||||||
|
|
||||||
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
|
import dev.inmo.tgbotapi.requests.chat.forum.CloseForumTopic
|
||||||
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||||
|
import dev.inmo.tgbotapi.types.ForumTopic
|
||||||
|
import dev.inmo.tgbotapi.types.MessageThreadId
|
||||||
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
|
|
||||||
|
suspend fun TelegramBot.closeForumTopic(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
messageThreadId: MessageThreadId
|
||||||
|
) = execute(
|
||||||
|
CloseForumTopic(
|
||||||
|
chatId,
|
||||||
|
messageThreadId
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.closeForumTopic(
|
||||||
|
chat: Chat,
|
||||||
|
messageThreadId: MessageThreadId
|
||||||
|
) = closeForumTopic(chat.id, messageThreadId)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.closeForumTopic(
|
||||||
|
chat: Chat,
|
||||||
|
forumTopic: ForumTopic
|
||||||
|
) = closeForumTopic(chat.id, forumTopic.messageThreadId)
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package dev.inmo.tgbotapi.extensions.api.chat.forum
|
||||||
|
|
||||||
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
|
import dev.inmo.tgbotapi.requests.chat.forum.CreateForumTopic
|
||||||
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||||
|
import dev.inmo.tgbotapi.types.CustomEmojiId
|
||||||
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
|
import dev.inmo.tgbotapi.utils.RGBColor
|
||||||
|
|
||||||
|
suspend fun TelegramBot.createForumTopic(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
name: String,
|
||||||
|
color: RGBColor,
|
||||||
|
iconEmojiId: CustomEmojiId? = null
|
||||||
|
) = execute(
|
||||||
|
CreateForumTopic(
|
||||||
|
chatId,
|
||||||
|
name,
|
||||||
|
color,
|
||||||
|
iconEmojiId
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.createForumTopic(
|
||||||
|
chat: Chat,
|
||||||
|
name: String,
|
||||||
|
color: RGBColor,
|
||||||
|
iconEmojiId: CustomEmojiId? = null
|
||||||
|
) = createForumTopic(chat.id, name, color, iconEmojiId)
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package dev.inmo.tgbotapi.extensions.api.chat.forum
|
||||||
|
|
||||||
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
|
import dev.inmo.tgbotapi.requests.chat.forum.DeleteForumTopic
|
||||||
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||||
|
import dev.inmo.tgbotapi.types.ForumTopic
|
||||||
|
import dev.inmo.tgbotapi.types.MessageThreadId
|
||||||
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
|
|
||||||
|
suspend fun TelegramBot.deleteForumTopic(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
messageThreadId: MessageThreadId
|
||||||
|
) = execute(
|
||||||
|
DeleteForumTopic(
|
||||||
|
chatId,
|
||||||
|
messageThreadId
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.deleteForumTopic(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
forumTopic: ForumTopic
|
||||||
|
) = deleteForumTopic(chatId, forumTopic.messageThreadId)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.deleteForumTopic(
|
||||||
|
chat: Chat,
|
||||||
|
messageThreadId: MessageThreadId
|
||||||
|
) = deleteForumTopic(chat.id, messageThreadId)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.deleteForumTopic(
|
||||||
|
chat: Chat,
|
||||||
|
forumTopic: ForumTopic
|
||||||
|
) = deleteForumTopic(chat.id, forumTopic.messageThreadId)
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package dev.inmo.tgbotapi.extensions.api.chat.forum
|
||||||
|
|
||||||
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
|
import dev.inmo.tgbotapi.requests.chat.forum.EditForumTopic
|
||||||
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||||
|
import dev.inmo.tgbotapi.types.CustomEmojiId
|
||||||
|
import dev.inmo.tgbotapi.types.ForumTopic
|
||||||
|
import dev.inmo.tgbotapi.types.MessageThreadId
|
||||||
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
|
|
||||||
|
suspend fun TelegramBot.editForumTopic(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
messageThreadId: MessageThreadId,
|
||||||
|
name: String,
|
||||||
|
iconEmojiId: CustomEmojiId
|
||||||
|
) = execute(
|
||||||
|
EditForumTopic(
|
||||||
|
chatId,
|
||||||
|
messageThreadId,
|
||||||
|
name,
|
||||||
|
iconEmojiId
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.editForumTopic(
|
||||||
|
chat: Chat,
|
||||||
|
messageThreadId: MessageThreadId,
|
||||||
|
name: String,
|
||||||
|
iconEmojiId: CustomEmojiId
|
||||||
|
) = editForumTopic(chat.id, messageThreadId, name, iconEmojiId)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.editForumTopic(
|
||||||
|
chatIdentifier: ChatIdentifier,
|
||||||
|
forumTopic: ForumTopic,
|
||||||
|
iconEmojiId: CustomEmojiId = forumTopic.iconEmojiId ?: error("Icon emoji id in forum topic should be presented when edit forum topic basing on other forum topic object")
|
||||||
|
) = editForumTopic(chatIdentifier, forumTopic.messageThreadId, forumTopic.name, iconEmojiId)
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
package dev.inmo.tgbotapi.extensions.api.chat.forum
|
||||||
|
|
||||||
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
|
import dev.inmo.tgbotapi.requests.chat.forum.ReopenForumTopic
|
||||||
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||||
|
import dev.inmo.tgbotapi.types.ForumTopic
|
||||||
|
import dev.inmo.tgbotapi.types.MessageThreadId
|
||||||
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
|
|
||||||
|
suspend fun TelegramBot.reopenForumTopic(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
messageThreadId: MessageThreadId
|
||||||
|
) = execute(
|
||||||
|
ReopenForumTopic(
|
||||||
|
chatId,
|
||||||
|
messageThreadId
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.reopenForumTopic(
|
||||||
|
chat: Chat,
|
||||||
|
messageThreadId: MessageThreadId
|
||||||
|
) = reopenForumTopic(chat.id, messageThreadId)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.reopenForumTopic(
|
||||||
|
chat: Chat,
|
||||||
|
forumTopic: ForumTopic
|
||||||
|
) = reopenForumTopic(chat.id, forumTopic.messageThreadId)
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
package dev.inmo.tgbotapi.extensions.api.chat.forum
|
||||||
|
|
||||||
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
|
import dev.inmo.tgbotapi.requests.chat.forum.UnpinAllForumTopicMessages
|
||||||
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||||
|
import dev.inmo.tgbotapi.types.ForumTopic
|
||||||
|
import dev.inmo.tgbotapi.types.MessageThreadId
|
||||||
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
|
|
||||||
|
suspend fun TelegramBot.unpinAllForumTopicMessages(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
messageThreadId: MessageThreadId
|
||||||
|
) = execute(
|
||||||
|
UnpinAllForumTopicMessages(
|
||||||
|
chatId,
|
||||||
|
messageThreadId
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.unpinAllForumTopicMessages(
|
||||||
|
chat: Chat,
|
||||||
|
messageThreadId: MessageThreadId
|
||||||
|
) = unpinAllForumTopicMessages(chat.id, messageThreadId)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.unpinAllForumTopicMessages(
|
||||||
|
chat: Chat,
|
||||||
|
forumTopic: ForumTopic
|
||||||
|
) = unpinAllForumTopicMessages(chat.id, forumTopic.messageThreadId)
|
||||||
@@ -3,7 +3,27 @@ package dev.inmo.tgbotapi.extensions.api.chat.get
|
|||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.chat.get.GetChat
|
import dev.inmo.tgbotapi.requests.chat.get.GetChat
|
||||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||||
import dev.inmo.tgbotapi.types.chat.*
|
import dev.inmo.tgbotapi.types.chat.ChannelChat
|
||||||
|
import dev.inmo.tgbotapi.types.chat.ChannelChatImpl
|
||||||
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
|
import dev.inmo.tgbotapi.types.chat.CommonUser
|
||||||
|
import dev.inmo.tgbotapi.types.chat.ExtendedChannelChat
|
||||||
|
import dev.inmo.tgbotapi.types.chat.ExtendedChannelChatImpl
|
||||||
|
import dev.inmo.tgbotapi.types.chat.ExtendedGroupChat
|
||||||
|
import dev.inmo.tgbotapi.types.chat.ExtendedGroupChatImpl
|
||||||
|
import dev.inmo.tgbotapi.types.chat.ExtendedPrivateChat
|
||||||
|
import dev.inmo.tgbotapi.types.chat.ExtendedPrivateChatImpl
|
||||||
|
import dev.inmo.tgbotapi.types.chat.ExtendedPublicChat
|
||||||
|
import dev.inmo.tgbotapi.types.chat.ExtendedSupergroupChat
|
||||||
|
import dev.inmo.tgbotapi.types.chat.ExtendedSupergroupChatImpl
|
||||||
|
import dev.inmo.tgbotapi.types.chat.ExtendedUser
|
||||||
|
import dev.inmo.tgbotapi.types.chat.GroupChat
|
||||||
|
import dev.inmo.tgbotapi.types.chat.GroupChatImpl
|
||||||
|
import dev.inmo.tgbotapi.types.chat.PrivateChat
|
||||||
|
import dev.inmo.tgbotapi.types.chat.PrivateChatImpl
|
||||||
|
import dev.inmo.tgbotapi.types.chat.PublicChat
|
||||||
|
import dev.inmo.tgbotapi.types.chat.SupergroupChat
|
||||||
|
import dev.inmo.tgbotapi.types.chat.SupergroupChatImpl
|
||||||
import dev.inmo.tgbotapi.utils.PreviewFeature
|
import dev.inmo.tgbotapi.utils.PreviewFeature
|
||||||
|
|
||||||
suspend fun TelegramBot.getChat(
|
suspend fun TelegramBot.getChat(
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ package dev.inmo.tgbotapi.extensions.api.chat.get
|
|||||||
|
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.chat.get.GetChatMenuButton
|
import dev.inmo.tgbotapi.requests.chat.get.GetChatMenuButton
|
||||||
import dev.inmo.tgbotapi.types.*
|
import dev.inmo.tgbotapi.types.ChatId
|
||||||
import dev.inmo.tgbotapi.types.chat.PrivateChat
|
import dev.inmo.tgbotapi.types.chat.PrivateChat
|
||||||
|
|
||||||
suspend fun TelegramBot.getChatMenuButton(
|
suspend fun TelegramBot.getChatMenuButton(
|
||||||
|
|||||||
@@ -2,7 +2,5 @@ package dev.inmo.tgbotapi.extensions.api.chat.get
|
|||||||
|
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.chat.get.GetDefaultChatMenuButton
|
import dev.inmo.tgbotapi.requests.chat.get.GetDefaultChatMenuButton
|
||||||
import dev.inmo.tgbotapi.requests.chat.modify.SetDefaultChatMenuButton
|
|
||||||
import dev.inmo.tgbotapi.types.MenuButton
|
|
||||||
|
|
||||||
suspend fun TelegramBot.getDefaultChatMenuButton() = execute(GetDefaultChatMenuButton)
|
suspend fun TelegramBot.getDefaultChatMenuButton() = execute(GetDefaultChatMenuButton)
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
package dev.inmo.tgbotapi.extensions.api.chat.get
|
||||||
|
|
||||||
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
|
import dev.inmo.tgbotapi.requests.chat.get.GetForumTopicIconStickers
|
||||||
|
|
||||||
|
suspend fun TelegramBot.getForumTopicIconStickers() = execute(GetForumTopicIconStickers)
|
||||||
@@ -2,8 +2,10 @@ package dev.inmo.tgbotapi.extensions.api.chat.invite_links
|
|||||||
|
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.chat.invite_links.ApproveChatJoinRequest
|
import dev.inmo.tgbotapi.requests.chat.invite_links.ApproveChatJoinRequest
|
||||||
import dev.inmo.tgbotapi.types.*
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||||
import dev.inmo.tgbotapi.types.chat.*
|
import dev.inmo.tgbotapi.types.UserId
|
||||||
|
import dev.inmo.tgbotapi.types.chat.ChatJoinRequest
|
||||||
|
import dev.inmo.tgbotapi.types.chat.PublicChat
|
||||||
import dev.inmo.tgbotapi.types.chat.User
|
import dev.inmo.tgbotapi.types.chat.User
|
||||||
import dev.inmo.tgbotapi.types.update.ChatJoinRequestUpdate
|
import dev.inmo.tgbotapi.types.update.ChatJoinRequestUpdate
|
||||||
|
|
||||||
|
|||||||
@@ -3,8 +3,11 @@ package dev.inmo.tgbotapi.extensions.api.chat.invite_links
|
|||||||
import com.soywiz.klock.DateTime
|
import com.soywiz.klock.DateTime
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.chat.invite_links.CreateChatInviteLink
|
import dev.inmo.tgbotapi.requests.chat.invite_links.CreateChatInviteLink
|
||||||
import dev.inmo.tgbotapi.types.*
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||||
|
import dev.inmo.tgbotapi.types.MembersLimit
|
||||||
|
import dev.inmo.tgbotapi.types.TelegramDate
|
||||||
import dev.inmo.tgbotapi.types.chat.PublicChat
|
import dev.inmo.tgbotapi.types.chat.PublicChat
|
||||||
|
import dev.inmo.tgbotapi.types.toTelegramDate
|
||||||
|
|
||||||
suspend fun TelegramBot.createChatInviteLinkUnlimited(
|
suspend fun TelegramBot.createChatInviteLinkUnlimited(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
|
|||||||
@@ -2,8 +2,10 @@ package dev.inmo.tgbotapi.extensions.api.chat.invite_links
|
|||||||
|
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.chat.invite_links.DeclineChatJoinRequest
|
import dev.inmo.tgbotapi.requests.chat.invite_links.DeclineChatJoinRequest
|
||||||
import dev.inmo.tgbotapi.types.*
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||||
import dev.inmo.tgbotapi.types.chat.*
|
import dev.inmo.tgbotapi.types.UserId
|
||||||
|
import dev.inmo.tgbotapi.types.chat.ChatJoinRequest
|
||||||
|
import dev.inmo.tgbotapi.types.chat.PublicChat
|
||||||
import dev.inmo.tgbotapi.types.chat.User
|
import dev.inmo.tgbotapi.types.chat.User
|
||||||
import dev.inmo.tgbotapi.types.update.ChatJoinRequestUpdate
|
import dev.inmo.tgbotapi.types.update.ChatJoinRequestUpdate
|
||||||
|
|
||||||
|
|||||||
@@ -3,8 +3,12 @@ package dev.inmo.tgbotapi.extensions.api.chat.invite_links
|
|||||||
import com.soywiz.klock.DateTime
|
import com.soywiz.klock.DateTime
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.chat.invite_links.EditChatInviteLink
|
import dev.inmo.tgbotapi.requests.chat.invite_links.EditChatInviteLink
|
||||||
import dev.inmo.tgbotapi.types.*
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||||
|
import dev.inmo.tgbotapi.types.ChatInviteLink
|
||||||
|
import dev.inmo.tgbotapi.types.MembersLimit
|
||||||
|
import dev.inmo.tgbotapi.types.TelegramDate
|
||||||
import dev.inmo.tgbotapi.types.chat.PublicChat
|
import dev.inmo.tgbotapi.types.chat.PublicChat
|
||||||
|
import dev.inmo.tgbotapi.types.toTelegramDate
|
||||||
|
|
||||||
suspend fun TelegramBot.editChatInviteLinkUnlimited(
|
suspend fun TelegramBot.editChatInviteLinkUnlimited(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
|
|||||||
@@ -2,7 +2,10 @@ package dev.inmo.tgbotapi.extensions.api.chat.members
|
|||||||
|
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.chat.members.BanChatMember
|
import dev.inmo.tgbotapi.requests.chat.members.BanChatMember
|
||||||
import dev.inmo.tgbotapi.types.*
|
import dev.inmo.tgbotapi.types.ChatId
|
||||||
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||||
|
import dev.inmo.tgbotapi.types.TelegramDate
|
||||||
|
import dev.inmo.tgbotapi.types.UserId
|
||||||
import dev.inmo.tgbotapi.types.chat.PublicChat
|
import dev.inmo.tgbotapi.types.chat.PublicChat
|
||||||
import dev.inmo.tgbotapi.types.chat.User
|
import dev.inmo.tgbotapi.types.chat.User
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,8 @@ package dev.inmo.tgbotapi.extensions.api.chat.members
|
|||||||
|
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.chat.members.BanChatSenderChat
|
import dev.inmo.tgbotapi.requests.chat.members.BanChatSenderChat
|
||||||
import dev.inmo.tgbotapi.types.*
|
import dev.inmo.tgbotapi.types.ChatId
|
||||||
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||||
import dev.inmo.tgbotapi.types.chat.PublicChat
|
import dev.inmo.tgbotapi.types.chat.PublicChat
|
||||||
|
|
||||||
suspend fun TelegramBot.banChatSenderChat(
|
suspend fun TelegramBot.banChatSenderChat(
|
||||||
|
|||||||
@@ -2,7 +2,9 @@ package dev.inmo.tgbotapi.extensions.api.chat.members
|
|||||||
|
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.chat.members.GetChatMember
|
import dev.inmo.tgbotapi.requests.chat.members.GetChatMember
|
||||||
import dev.inmo.tgbotapi.types.*
|
import dev.inmo.tgbotapi.types.ChatId
|
||||||
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||||
|
import dev.inmo.tgbotapi.types.UserId
|
||||||
import dev.inmo.tgbotapi.types.chat.PublicChat
|
import dev.inmo.tgbotapi.types.chat.PublicChat
|
||||||
import dev.inmo.tgbotapi.types.chat.User
|
import dev.inmo.tgbotapi.types.chat.User
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,10 @@ package dev.inmo.tgbotapi.extensions.api.chat.members
|
|||||||
|
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.chat.members.PromoteChatMember
|
import dev.inmo.tgbotapi.requests.chat.members.PromoteChatMember
|
||||||
import dev.inmo.tgbotapi.types.*
|
import dev.inmo.tgbotapi.types.ChatId
|
||||||
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||||
|
import dev.inmo.tgbotapi.types.TelegramDate
|
||||||
|
import dev.inmo.tgbotapi.types.UserId
|
||||||
import dev.inmo.tgbotapi.types.chat.PublicChat
|
import dev.inmo.tgbotapi.types.chat.PublicChat
|
||||||
import dev.inmo.tgbotapi.types.chat.User
|
import dev.inmo.tgbotapi.types.chat.User
|
||||||
|
|
||||||
@@ -20,7 +23,8 @@ suspend fun TelegramBot.promoteChatMember(
|
|||||||
canPinMessages: Boolean? = null,
|
canPinMessages: Boolean? = null,
|
||||||
canPromoteMembers: Boolean? = null,
|
canPromoteMembers: Boolean? = null,
|
||||||
canManageVideoChats: Boolean? = null,
|
canManageVideoChats: Boolean? = null,
|
||||||
canManageChat: Boolean?
|
canManageChat: Boolean? = null,
|
||||||
|
canManageTopics: Boolean? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
PromoteChatMember(
|
PromoteChatMember(
|
||||||
chatId,
|
chatId,
|
||||||
@@ -36,7 +40,8 @@ suspend fun TelegramBot.promoteChatMember(
|
|||||||
canPinMessages,
|
canPinMessages,
|
||||||
canPromoteMembers,
|
canPromoteMembers,
|
||||||
canManageVideoChats,
|
canManageVideoChats,
|
||||||
canManageChat
|
canManageChat,
|
||||||
|
canManageTopics
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -54,7 +59,8 @@ suspend fun TelegramBot.promoteChatMember(
|
|||||||
canPinMessages: Boolean? = null,
|
canPinMessages: Boolean? = null,
|
||||||
canPromoteMembers: Boolean? = null,
|
canPromoteMembers: Boolean? = null,
|
||||||
canManageVideoChats: Boolean? = null,
|
canManageVideoChats: Boolean? = null,
|
||||||
canManageChat: Boolean? = null
|
canManageChat: Boolean? = null,
|
||||||
|
canManageTopics: Boolean? = null
|
||||||
) = promoteChatMember(
|
) = promoteChatMember(
|
||||||
chat.id,
|
chat.id,
|
||||||
userId,
|
userId,
|
||||||
@@ -69,7 +75,8 @@ suspend fun TelegramBot.promoteChatMember(
|
|||||||
canPinMessages,
|
canPinMessages,
|
||||||
canPromoteMembers,
|
canPromoteMembers,
|
||||||
canManageVideoChats,
|
canManageVideoChats,
|
||||||
canManageChat
|
canManageChat,
|
||||||
|
canManageTopics
|
||||||
)
|
)
|
||||||
|
|
||||||
suspend fun TelegramBot.promoteChatMember(
|
suspend fun TelegramBot.promoteChatMember(
|
||||||
@@ -86,7 +93,8 @@ suspend fun TelegramBot.promoteChatMember(
|
|||||||
canPinMessages: Boolean? = null,
|
canPinMessages: Boolean? = null,
|
||||||
canPromoteMembers: Boolean? = null,
|
canPromoteMembers: Boolean? = null,
|
||||||
canManageVideoChats: Boolean? = null,
|
canManageVideoChats: Boolean? = null,
|
||||||
canManageChat: Boolean? = null
|
canManageChat: Boolean? = null,
|
||||||
|
canManageTopics: Boolean? = null
|
||||||
) = promoteChatMember(
|
) = promoteChatMember(
|
||||||
chatId,
|
chatId,
|
||||||
user.id,
|
user.id,
|
||||||
@@ -101,7 +109,8 @@ suspend fun TelegramBot.promoteChatMember(
|
|||||||
canPinMessages,
|
canPinMessages,
|
||||||
canPromoteMembers,
|
canPromoteMembers,
|
||||||
canManageVideoChats,
|
canManageVideoChats,
|
||||||
canManageChat
|
canManageChat,
|
||||||
|
canManageTopics
|
||||||
)
|
)
|
||||||
|
|
||||||
suspend fun TelegramBot.promoteChatMember(
|
suspend fun TelegramBot.promoteChatMember(
|
||||||
@@ -118,7 +127,8 @@ suspend fun TelegramBot.promoteChatMember(
|
|||||||
canPinMessages: Boolean? = null,
|
canPinMessages: Boolean? = null,
|
||||||
canPromoteMembers: Boolean? = null,
|
canPromoteMembers: Boolean? = null,
|
||||||
canManageVideoChats: Boolean? = null,
|
canManageVideoChats: Boolean? = null,
|
||||||
canManageChat: Boolean? = null
|
canManageChat: Boolean? = null,
|
||||||
|
canManageTopics: Boolean? = null
|
||||||
) = promoteChatMember(
|
) = promoteChatMember(
|
||||||
chat.id,
|
chat.id,
|
||||||
user.id,
|
user.id,
|
||||||
@@ -133,5 +143,6 @@ suspend fun TelegramBot.promoteChatMember(
|
|||||||
canPinMessages,
|
canPinMessages,
|
||||||
canPromoteMembers,
|
canPromoteMembers,
|
||||||
canManageVideoChats,
|
canManageVideoChats,
|
||||||
canManageChat
|
canManageChat,
|
||||||
|
canManageTopics
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -2,8 +2,12 @@ package dev.inmo.tgbotapi.extensions.api.chat.members
|
|||||||
|
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.chat.members.RestrictChatMember
|
import dev.inmo.tgbotapi.requests.chat.members.RestrictChatMember
|
||||||
import dev.inmo.tgbotapi.types.*
|
import dev.inmo.tgbotapi.types.ChatId
|
||||||
import dev.inmo.tgbotapi.types.chat.*
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||||
|
import dev.inmo.tgbotapi.types.TelegramDate
|
||||||
|
import dev.inmo.tgbotapi.types.UserId
|
||||||
|
import dev.inmo.tgbotapi.types.chat.ChatPermissions
|
||||||
|
import dev.inmo.tgbotapi.types.chat.PublicChat
|
||||||
import dev.inmo.tgbotapi.types.chat.User
|
import dev.inmo.tgbotapi.types.chat.User
|
||||||
|
|
||||||
suspend fun TelegramBot.restrictChatMember(
|
suspend fun TelegramBot.restrictChatMember(
|
||||||
|
|||||||
@@ -2,7 +2,8 @@ package dev.inmo.tgbotapi.extensions.api.chat.members
|
|||||||
|
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.chat.members.SetChatAdministratorCustomTitle
|
import dev.inmo.tgbotapi.requests.chat.members.SetChatAdministratorCustomTitle
|
||||||
import dev.inmo.tgbotapi.types.*
|
import dev.inmo.tgbotapi.types.ChatId
|
||||||
|
import dev.inmo.tgbotapi.types.UserId
|
||||||
import dev.inmo.tgbotapi.types.chat.PublicChat
|
import dev.inmo.tgbotapi.types.chat.PublicChat
|
||||||
import dev.inmo.tgbotapi.types.chat.User
|
import dev.inmo.tgbotapi.types.chat.User
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,9 @@ package dev.inmo.tgbotapi.extensions.api.chat.members
|
|||||||
|
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.chat.members.UnbanChatMember
|
import dev.inmo.tgbotapi.requests.chat.members.UnbanChatMember
|
||||||
import dev.inmo.tgbotapi.types.*
|
import dev.inmo.tgbotapi.types.ChatId
|
||||||
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||||
|
import dev.inmo.tgbotapi.types.UserId
|
||||||
import dev.inmo.tgbotapi.types.chat.PublicChat
|
import dev.inmo.tgbotapi.types.chat.PublicChat
|
||||||
import dev.inmo.tgbotapi.types.chat.User
|
import dev.inmo.tgbotapi.types.chat.User
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.api.chat.members
|
package dev.inmo.tgbotapi.extensions.api.chat.members
|
||||||
|
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.chat.members.*
|
import dev.inmo.tgbotapi.requests.chat.members.UnbanChatSenderChat
|
||||||
import dev.inmo.tgbotapi.types.*
|
import dev.inmo.tgbotapi.types.ChatId
|
||||||
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||||
import dev.inmo.tgbotapi.types.chat.PublicChat
|
import dev.inmo.tgbotapi.types.chat.PublicChat
|
||||||
|
|
||||||
suspend fun TelegramBot.unbanChatSenderChat(
|
suspend fun TelegramBot.unbanChatSenderChat(
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.api.chat.modify
|
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.*
|
import dev.inmo.tgbotapi.requests.chat.modify.SetChatMenuButton
|
||||||
import dev.inmo.tgbotapi.types.*
|
import dev.inmo.tgbotapi.types.ChatId
|
||||||
|
import dev.inmo.tgbotapi.types.MenuButton
|
||||||
import dev.inmo.tgbotapi.types.chat.PrivateChat
|
import dev.inmo.tgbotapi.types.chat.PrivateChat
|
||||||
|
|
||||||
suspend fun TelegramBot.setChatMenuButton(
|
suspend fun TelegramBot.setChatMenuButton(
|
||||||
|
|||||||
@@ -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(
|
||||||
|
|||||||
@@ -18,6 +18,8 @@ import dev.inmo.tgbotapi.types.message.abstracts.Message
|
|||||||
import dev.inmo.tgbotapi.types.message.content.*
|
import dev.inmo.tgbotapi.types.message.content.*
|
||||||
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.utils.EntitiesBuilderBody
|
||||||
|
import dev.inmo.tgbotapi.utils.buildEntities
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
@@ -50,7 +52,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 +67,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 +96,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 +109,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 +130,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 +141,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 +162,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 +172,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)
|
||||||
|
|
||||||
@@ -183,6 +185,57 @@ suspend fun TelegramBot.edit(
|
|||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editMessageReplyMarkup(message, replyMarkup)
|
) = editMessageReplyMarkup(message, replyMarkup)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
|
* as a builder for that
|
||||||
|
*/
|
||||||
|
suspend fun TelegramBot.edit(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
messageId: MessageId,
|
||||||
|
text: String,
|
||||||
|
parseMode: ParseMode? = null,
|
||||||
|
disableWebPagePreview: Boolean? = null,
|
||||||
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
|
) = editMessageText(chatId, messageId, text, parseMode, disableWebPagePreview, replyMarkup)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
|
* as a builder for that
|
||||||
|
*/
|
||||||
|
suspend fun TelegramBot.edit(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
messageId: MessageId,
|
||||||
|
entities: TextSourcesList,
|
||||||
|
disableWebPagePreview: Boolean? = null,
|
||||||
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
|
) = editMessageText(chatId, messageId, entities, disableWebPagePreview, replyMarkup)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
|
* as a builder for that
|
||||||
|
*/
|
||||||
|
suspend fun TelegramBot.edit(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
messageId: MessageId,
|
||||||
|
separator: TextSource? = null,
|
||||||
|
disableWebPagePreview: Boolean? = null,
|
||||||
|
replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
|
builderBody: EntitiesBuilderBody
|
||||||
|
) = edit(chatId, messageId, buildEntities(separator, builderBody), disableWebPagePreview, replyMarkup)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
|
* as a builder for that
|
||||||
|
*/
|
||||||
|
suspend fun TelegramBot.edit(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
messageId: MessageId,
|
||||||
|
separator: String,
|
||||||
|
disableWebPagePreview: Boolean? = null,
|
||||||
|
replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
|
builderBody: EntitiesBuilderBody
|
||||||
|
) = edit(chatId, messageId, buildEntities(separator, builderBody), disableWebPagePreview, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
@@ -193,7 +246,7 @@ suspend fun TelegramBot.edit(
|
|||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
disableWebPagePreview: Boolean? = null,
|
disableWebPagePreview: Boolean? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editMessageText(message, text, parseMode, disableWebPagePreview, replyMarkup)
|
) = edit(message.chat.id, message.messageId, text, parseMode, disableWebPagePreview, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
@@ -204,4 +257,52 @@ suspend fun TelegramBot.edit(
|
|||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
disableWebPagePreview: Boolean? = null,
|
disableWebPagePreview: Boolean? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editMessageText(message, entities, disableWebPagePreview, replyMarkup)
|
) = edit(message.chat.id, message.messageId, entities, disableWebPagePreview, replyMarkup)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
|
* as a builder for that
|
||||||
|
*/
|
||||||
|
suspend fun TelegramBot.edit(
|
||||||
|
message: ContentMessage<TextContent>,
|
||||||
|
separator: TextSource? = null,
|
||||||
|
disableWebPagePreview: Boolean? = null,
|
||||||
|
replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
|
builderBody: EntitiesBuilderBody
|
||||||
|
) = edit(message, buildEntities(separator, builderBody), disableWebPagePreview, replyMarkup)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
|
* as a builder for that
|
||||||
|
*/
|
||||||
|
suspend fun TelegramBot.edit(
|
||||||
|
message: ContentMessage<TextContent>,
|
||||||
|
separator: String,
|
||||||
|
disableWebPagePreview: Boolean? = null,
|
||||||
|
replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
|
builderBody: EntitiesBuilderBody
|
||||||
|
) = edit(message, buildEntities(separator, builderBody), disableWebPagePreview, replyMarkup)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
|
* as a builder for that
|
||||||
|
*/
|
||||||
|
suspend fun TelegramBot.editMessageText(
|
||||||
|
message: ContentMessage<TextContent>,
|
||||||
|
separator: TextSource? = null,
|
||||||
|
disableWebPagePreview: Boolean? = null,
|
||||||
|
replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
|
builderBody: EntitiesBuilderBody
|
||||||
|
) = edit(message, buildEntities(separator, builderBody), disableWebPagePreview, replyMarkup)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
|
* as a builder for that
|
||||||
|
*/
|
||||||
|
suspend fun TelegramBot.editMessageText(
|
||||||
|
message: ContentMessage<TextContent>,
|
||||||
|
separator: String,
|
||||||
|
disableWebPagePreview: Boolean? = null,
|
||||||
|
replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
|
builderBody: EntitiesBuilderBody
|
||||||
|
) = edit(message, buildEntities(separator, builderBody), disableWebPagePreview, 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,14 +4,15 @@ 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
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
||||||
import dev.inmo.tgbotapi.types.message.content.TextContent
|
import dev.inmo.tgbotapi.types.message.content.TextContent
|
||||||
import dev.inmo.tgbotapi.utils.RiskFeature
|
import dev.inmo.tgbotapi.types.message.textsources.TextSource
|
||||||
|
import dev.inmo.tgbotapi.utils.*
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
@@ -19,7 +20,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 +35,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 +60,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
|
||||||
@@ -67,18 +68,70 @@ suspend fun TelegramBot.editMessageText(
|
|||||||
EditChatMessageText(chatId, messageId, entities, disableWebPagePreview, replyMarkup)
|
EditChatMessageText(chatId, messageId, entities, disableWebPagePreview, replyMarkup)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
|
* as a builder for that
|
||||||
|
*/
|
||||||
|
suspend fun TelegramBot.editMessageText(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
messageId: MessageId,
|
||||||
|
separator: TextSource? = null,
|
||||||
|
disableWebPagePreview: Boolean? = null,
|
||||||
|
replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
|
builderBody: EntitiesBuilderBody
|
||||||
|
) = editMessageText(chatId, messageId, buildEntities(separator, builderBody), disableWebPagePreview, replyMarkup)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
|
* as a builder for that
|
||||||
|
*/
|
||||||
|
suspend fun TelegramBot.editMessageText(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
messageId: MessageId,
|
||||||
|
separator: String,
|
||||||
|
disableWebPagePreview: Boolean? = null,
|
||||||
|
replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
|
builderBody: EntitiesBuilderBody
|
||||||
|
) = editMessageText(chatId, messageId, buildEntities(separator, builderBody), disableWebPagePreview, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
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
|
||||||
) = editMessageText(chat.id, messageId, entities, disableWebPagePreview, replyMarkup)
|
) = editMessageText(chat.id, messageId, entities, disableWebPagePreview, replyMarkup)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
|
* as a builder for that
|
||||||
|
*/
|
||||||
|
suspend fun TelegramBot.editMessageText(
|
||||||
|
chat: Chat,
|
||||||
|
messageId: MessageId,
|
||||||
|
separator: TextSource? = null,
|
||||||
|
disableWebPagePreview: Boolean? = null,
|
||||||
|
replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
|
builderBody: EntitiesBuilderBody
|
||||||
|
) = editMessageText(chat.id, messageId, buildEntities(separator, builderBody), disableWebPagePreview, replyMarkup)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
|
* as a builder for that
|
||||||
|
*/
|
||||||
|
suspend fun TelegramBot.editMessageText(
|
||||||
|
chat: Chat,
|
||||||
|
messageId: MessageId,
|
||||||
|
separator: String,
|
||||||
|
disableWebPagePreview: Boolean? = null,
|
||||||
|
replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
|
builderBody: EntitiesBuilderBody
|
||||||
|
) = editMessageText(chat.id, messageId, buildEntities(separator, builderBody), disableWebPagePreview, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
@@ -90,6 +143,30 @@ suspend fun TelegramBot.editMessageText(
|
|||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editMessageText(message.chat.id, message.messageId, entities, disableWebPagePreview, replyMarkup)
|
) = editMessageText(message.chat.id, message.messageId, entities, disableWebPagePreview, replyMarkup)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
|
* as a builder for that
|
||||||
|
*/
|
||||||
|
suspend fun TelegramBot.editMessageText(
|
||||||
|
message: ContentMessage<TextContent>,
|
||||||
|
separator: TextSource? = null,
|
||||||
|
disableWebPagePreview: Boolean? = null,
|
||||||
|
replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
|
builderBody: EntitiesBuilderBody
|
||||||
|
) = editMessageText(message.chat.id, message.messageId, buildEntities(separator, builderBody), disableWebPagePreview, replyMarkup)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
|
* as a builder for that
|
||||||
|
*/
|
||||||
|
suspend fun TelegramBot.editMessageText(
|
||||||
|
message: ContentMessage<TextContent>,
|
||||||
|
separator: String,
|
||||||
|
disableWebPagePreview: Boolean? = null,
|
||||||
|
replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
|
builderBody: EntitiesBuilderBody
|
||||||
|
) = editMessageText(message.chat.id, message.messageId, buildEntities(separator, builderBody), disableWebPagePreview, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
@@ -101,3 +178,29 @@ suspend fun TelegramBot.editMessageText(
|
|||||||
disableWebPagePreview: Boolean? = null,
|
disableWebPagePreview: Boolean? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editMessageText(message.chat.id, message.messageId, entities, disableWebPagePreview, replyMarkup)
|
) = editMessageText(message.chat.id, message.messageId, entities, disableWebPagePreview, replyMarkup)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
|
* as a builder for that
|
||||||
|
*/
|
||||||
|
@RiskFeature("This method is unsafe due to absence of any guaranties about the type of message. In case if message is not text message this method will throw an exception")
|
||||||
|
suspend fun TelegramBot.editMessageText(
|
||||||
|
message: Message,
|
||||||
|
separator: TextSource? = null,
|
||||||
|
disableWebPagePreview: Boolean? = null,
|
||||||
|
replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
|
builderBody: EntitiesBuilderBody
|
||||||
|
) = editMessageText(message.chat.id, message.messageId, buildEntities(separator, builderBody), disableWebPagePreview, replyMarkup)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
|
* as a builder for that
|
||||||
|
*/
|
||||||
|
@RiskFeature("This method is unsafe due to absence of any guaranties about the type of message. In case if message is not text message this method will throw an exception")
|
||||||
|
suspend fun TelegramBot.editMessageText(
|
||||||
|
message: Message,
|
||||||
|
separator: String,
|
||||||
|
disableWebPagePreview: Boolean? = null,
|
||||||
|
replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
|
builderBody: EntitiesBuilderBody
|
||||||
|
) = editMessageText(message.chat.id, message.messageId, buildEntities(separator, builderBody), disableWebPagePreview, replyMarkup)
|
||||||
|
|||||||
@@ -6,6 +6,9 @@ import dev.inmo.tgbotapi.types.InlineMessageIdentifier
|
|||||||
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
||||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||||
|
import dev.inmo.tgbotapi.types.message.textsources.TextSource
|
||||||
|
import dev.inmo.tgbotapi.utils.EntitiesBuilderBody
|
||||||
|
import dev.inmo.tgbotapi.utils.buildEntities
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
@@ -29,3 +32,27 @@ suspend fun TelegramBot.editMessageText(
|
|||||||
disableWebPagePreview: Boolean? = null,
|
disableWebPagePreview: Boolean? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = execute(EditInlineMessageText(inlineMessageId, entities, disableWebPagePreview, replyMarkup))
|
) = execute(EditInlineMessageText(inlineMessageId, entities, disableWebPagePreview, replyMarkup))
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
|
* as a builder for that
|
||||||
|
*/
|
||||||
|
suspend fun TelegramBot.editMessageText(
|
||||||
|
inlineMessageId: InlineMessageIdentifier,
|
||||||
|
separator: TextSource? = null,
|
||||||
|
disableWebPagePreview: Boolean? = null,
|
||||||
|
replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
|
builderBody: EntitiesBuilderBody
|
||||||
|
) = editMessageText(inlineMessageId, buildEntities(separator, builderBody), disableWebPagePreview, replyMarkup)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
|
* as a builder for that
|
||||||
|
*/
|
||||||
|
suspend fun TelegramBot.editMessageText(
|
||||||
|
inlineMessageId: InlineMessageIdentifier,
|
||||||
|
separator: String,
|
||||||
|
disableWebPagePreview: Boolean? = null,
|
||||||
|
replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
|
builderBody: EntitiesBuilderBody
|
||||||
|
) = editMessageText(inlineMessageId, buildEntities(separator, builderBody), disableWebPagePreview, replyMarkup)
|
||||||
|
|||||||
@@ -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))
|
||||||
@@ -10,8 +10,21 @@ suspend fun TelegramBot.getStickerSet(
|
|||||||
GetStickerSet(name)
|
GetStickerSet(name)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@Deprecated("Renamed", ReplaceWith("getStickerSetOrThrow(sticker)", "dev.inmo.tgbotapi.extensions.api.get.getStickerSetOrThrow"))
|
||||||
suspend fun TelegramBot.getStickerSet(
|
suspend fun TelegramBot.getStickerSet(
|
||||||
sticker: Sticker
|
sticker: Sticker
|
||||||
) = getStickerSet(
|
) = getStickerSet(
|
||||||
sticker.stickerSetName ?: error("Sticker must contains stickerSetName to be correctly used in getStickerSet method")
|
sticker.stickerSetName ?: error("Sticker must contains stickerSetName to be correctly used in getStickerSet method")
|
||||||
)
|
)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.getStickerSetOrNull(
|
||||||
|
sticker: Sticker
|
||||||
|
) = sticker.stickerSetName ?.let {
|
||||||
|
getStickerSet(it)
|
||||||
|
}
|
||||||
|
|
||||||
|
suspend fun TelegramBot.getStickerSetOrThrow(
|
||||||
|
sticker: Sticker
|
||||||
|
) = getStickerSet(
|
||||||
|
sticker.stickerSetName ?: error("Sticker must contains stickerSetName to be correctly used in getStickerSet method")
|
||||||
|
)
|
||||||
|
|||||||
@@ -4,7 +4,8 @@ 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.MessageThreadId
|
||||||
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 +17,14 @@ 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,
|
||||||
|
threadId: MessageThreadId? = 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(
|
||||||
@@ -32,6 +34,7 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
toChatId,
|
toChatId,
|
||||||
text,
|
text,
|
||||||
parseMode,
|
parseMode,
|
||||||
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
replyToMessageId,
|
replyToMessageId,
|
||||||
@@ -46,16 +49,17 @@ 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,
|
||||||
|
threadId: MessageThreadId? = 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, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -63,16 +67,17 @@ 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,
|
||||||
|
threadId: MessageThreadId? = 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, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -80,16 +85,17 @@ 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,
|
||||||
|
threadId: MessageThreadId? = 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, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -98,12 +104,13 @@ 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,
|
||||||
|
threadId: MessageThreadId? = 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(
|
||||||
@@ -112,6 +119,7 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
messageId,
|
messageId,
|
||||||
toChatId,
|
toChatId,
|
||||||
entities,
|
entities,
|
||||||
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
replyToMessageId,
|
replyToMessageId,
|
||||||
@@ -126,15 +134,16 @@ 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,
|
||||||
|
threadId: MessageThreadId? = 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, entities, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = copyMessage(fromChat.id, messageId, toChatId, entities, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -142,15 +151,16 @@ 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,
|
||||||
|
threadId: MessageThreadId? = 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, entities, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = copyMessage(fromChatId, messageId, toChat.id, entities, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -158,15 +168,16 @@ 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,
|
||||||
|
threadId: MessageThreadId? = 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, entities, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = copyMessage(fromChat.id, messageId, toChat.id, entities, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -177,12 +188,13 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
message: Message,
|
message: Message,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
threadId: MessageThreadId? = 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, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -193,12 +205,13 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
message: Message,
|
message: Message,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
threadId: MessageThreadId? = 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, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -208,12 +221,13 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
toChatId: ChatIdentifier,
|
toChatId: ChatIdentifier,
|
||||||
message: Message,
|
message: Message,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
threadId: MessageThreadId? = 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, entities, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = copyMessage(message.chat, message.messageId, toChatId, entities, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -223,12 +237,13 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
toChat: Chat,
|
toChat: Chat,
|
||||||
message: Message,
|
message: Message,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
threadId: MessageThreadId? = 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, entities, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = copyMessage(message.chat, message.messageId, toChat, entities, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -237,12 +252,13 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
suspend inline fun TelegramBot.copyMessage(
|
suspend inline fun TelegramBot.copyMessage(
|
||||||
toChatId: ChatIdentifier,
|
toChatId: ChatIdentifier,
|
||||||
fromChatId: ChatIdentifier,
|
fromChatId: ChatIdentifier,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageId,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
threadId: MessageThreadId? = 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(
|
||||||
@@ -252,6 +268,7 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
toChatId,
|
toChatId,
|
||||||
text,
|
text,
|
||||||
parseMode,
|
parseMode,
|
||||||
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
replyToMessageId,
|
replyToMessageId,
|
||||||
@@ -267,12 +284,13 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
suspend inline fun TelegramBot.copyMessage(
|
suspend inline fun TelegramBot.copyMessage(
|
||||||
toChatId: ChatIdentifier,
|
toChatId: ChatIdentifier,
|
||||||
fromChat: Chat,
|
fromChat: Chat,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageId,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
threadId: MessageThreadId? = 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(
|
) = copyMessage(
|
||||||
@@ -281,6 +299,7 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
messageId,
|
messageId,
|
||||||
text,
|
text,
|
||||||
parseMode,
|
parseMode,
|
||||||
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
replyToMessageId,
|
replyToMessageId,
|
||||||
@@ -295,12 +314,13 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
suspend inline fun TelegramBot.copyMessage(
|
suspend inline fun TelegramBot.copyMessage(
|
||||||
toChat: Chat,
|
toChat: Chat,
|
||||||
fromChatId: ChatIdentifier,
|
fromChatId: ChatIdentifier,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageId,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
threadId: MessageThreadId? = 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(
|
) = copyMessage(
|
||||||
@@ -309,6 +329,7 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
messageId,
|
messageId,
|
||||||
text,
|
text,
|
||||||
parseMode,
|
parseMode,
|
||||||
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
replyToMessageId,
|
replyToMessageId,
|
||||||
@@ -323,12 +344,13 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
suspend inline fun TelegramBot.copyMessage(
|
suspend inline fun TelegramBot.copyMessage(
|
||||||
toChat: Chat,
|
toChat: Chat,
|
||||||
fromChat: Chat,
|
fromChat: Chat,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageId,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
threadId: MessageThreadId? = 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(
|
) = copyMessage(
|
||||||
@@ -337,6 +359,7 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
messageId,
|
messageId,
|
||||||
text,
|
text,
|
||||||
parseMode,
|
parseMode,
|
||||||
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
replyToMessageId,
|
replyToMessageId,
|
||||||
@@ -352,11 +375,12 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
suspend inline fun TelegramBot.copyMessage(
|
suspend inline fun TelegramBot.copyMessage(
|
||||||
toChatId: ChatIdentifier,
|
toChatId: ChatIdentifier,
|
||||||
fromChatId: ChatIdentifier,
|
fromChatId: ChatIdentifier,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageId,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
threadId: MessageThreadId? = 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(
|
||||||
@@ -365,6 +389,7 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
messageId,
|
messageId,
|
||||||
toChatId,
|
toChatId,
|
||||||
entities,
|
entities,
|
||||||
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
replyToMessageId,
|
replyToMessageId,
|
||||||
@@ -380,11 +405,12 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
suspend inline fun TelegramBot.copyMessage(
|
suspend inline fun TelegramBot.copyMessage(
|
||||||
toChatId: ChatIdentifier,
|
toChatId: ChatIdentifier,
|
||||||
fromChat: Chat,
|
fromChat: Chat,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageId,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
threadId: MessageThreadId? = 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(
|
) = copyMessage(
|
||||||
@@ -392,6 +418,7 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
fromChat.id,
|
fromChat.id,
|
||||||
messageId,
|
messageId,
|
||||||
entities,
|
entities,
|
||||||
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
replyToMessageId,
|
replyToMessageId,
|
||||||
@@ -406,11 +433,12 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
suspend inline fun TelegramBot.copyMessage(
|
suspend inline fun TelegramBot.copyMessage(
|
||||||
toChat: Chat,
|
toChat: Chat,
|
||||||
fromChatId: ChatIdentifier,
|
fromChatId: ChatIdentifier,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageId,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
threadId: MessageThreadId? = 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(
|
) = copyMessage(
|
||||||
@@ -418,6 +446,7 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
fromChatId,
|
fromChatId,
|
||||||
messageId,
|
messageId,
|
||||||
entities,
|
entities,
|
||||||
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
replyToMessageId,
|
replyToMessageId,
|
||||||
@@ -432,11 +461,12 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
suspend inline fun TelegramBot.copyMessage(
|
suspend inline fun TelegramBot.copyMessage(
|
||||||
toChat: Chat,
|
toChat: Chat,
|
||||||
fromChat: Chat,
|
fromChat: Chat,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageId,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
threadId: MessageThreadId? = 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(
|
) = copyMessage(
|
||||||
@@ -444,6 +474,7 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
fromChat.id,
|
fromChat.id,
|
||||||
messageId,
|
messageId,
|
||||||
entities,
|
entities,
|
||||||
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
replyToMessageId,
|
replyToMessageId,
|
||||||
|
|||||||
@@ -1,173 +0,0 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.api.send
|
|
||||||
|
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
|
||||||
import dev.inmo.tgbotapi.extensions.api.send.media.sendMediaGroup
|
|
||||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
|
||||||
import dev.inmo.tgbotapi.types.media.*
|
|
||||||
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.chat.Chat
|
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.MediaGroupMessage
|
|
||||||
import dev.inmo.tgbotapi.types.message.content.MediaGroupContent
|
|
||||||
import dev.inmo.tgbotapi.types.update.media_group.SentMediaGroupUpdate
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Send media group via [sendMediaGroup] extension with edited [entities] of first [messages] element. Other elements
|
|
||||||
* will be copied as they are
|
|
||||||
*/
|
|
||||||
suspend inline fun TelegramBot.copyMessages(
|
|
||||||
toChatId: ChatIdentifier,
|
|
||||||
messages: List<MediaGroupMessage<MediaGroupContent>>,
|
|
||||||
text: String? = null,
|
|
||||||
parseMode: ParseMode? = null,
|
|
||||||
disableNotification: Boolean = false,
|
|
||||||
protectContent: Boolean = false,
|
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
|
||||||
allowSendingWithoutReply: Boolean? = null
|
|
||||||
): List<MediaGroupMessage<MediaGroupContent>> {
|
|
||||||
val first = messages.first().content.toMediaGroupMemberTelegramMedia().let {
|
|
||||||
if (text != null) {
|
|
||||||
when (it) {
|
|
||||||
is TelegramMediaAudio -> it.copy(text = text, parseMode = parseMode)
|
|
||||||
is TelegramMediaDocument -> it.copy(text = text, parseMode = parseMode)
|
|
||||||
is TelegramMediaPhoto -> it.copy(text = text, parseMode = parseMode)
|
|
||||||
is TelegramMediaVideo -> it.copy(text = text, parseMode = parseMode)
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
it
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return sendMediaGroup(
|
|
||||||
toChatId,
|
|
||||||
listOf(first) + messages.drop(1).map {
|
|
||||||
it.content.toMediaGroupMemberTelegramMedia()
|
|
||||||
},
|
|
||||||
disableNotification,
|
|
||||||
protectContent,
|
|
||||||
replyToMessageId,
|
|
||||||
allowSendingWithoutReply
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Send media group via [sendMediaGroup] extension with edited [entities] of first [messages] element. Other elements
|
|
||||||
* will be copied as they are
|
|
||||||
*/
|
|
||||||
suspend inline fun TelegramBot.copyMessages(
|
|
||||||
toChat: Chat,
|
|
||||||
messages: List<MediaGroupMessage<MediaGroupContent>>,
|
|
||||||
text: String? = null,
|
|
||||||
parseMode: ParseMode? = null,
|
|
||||||
disableNotification: Boolean = false,
|
|
||||||
protectContent: Boolean = false,
|
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
|
||||||
allowSendingWithoutReply: Boolean? = null
|
|
||||||
) = copyMessages(toChat.id, messages, text, parseMode, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Send media group via [sendMediaGroup] extension with edited [entities] of first [messages] element. Other elements
|
|
||||||
* will be copied as they are
|
|
||||||
*/
|
|
||||||
suspend inline fun TelegramBot.copyMessages(
|
|
||||||
toChat: ChatIdentifier,
|
|
||||||
update: SentMediaGroupUpdate,
|
|
||||||
text: String? = null,
|
|
||||||
parseMode: ParseMode? = null,
|
|
||||||
disableNotification: Boolean = false,
|
|
||||||
protectContent: Boolean = false,
|
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
|
||||||
allowSendingWithoutReply: Boolean? = null
|
|
||||||
) = copyMessages(toChat, update.data, text, parseMode, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Send media group via [sendMediaGroup] extension with edited [entities] of first [messages] element. Other elements
|
|
||||||
* will be copied as they are
|
|
||||||
*/
|
|
||||||
suspend inline fun TelegramBot.copyMessages(
|
|
||||||
toChat: Chat,
|
|
||||||
update: SentMediaGroupUpdate,
|
|
||||||
text: String? = null,
|
|
||||||
parseMode: ParseMode? = null,
|
|
||||||
disableNotification: Boolean = false,
|
|
||||||
protectContent: Boolean = false,
|
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
|
||||||
allowSendingWithoutReply: Boolean? = null
|
|
||||||
) = copyMessages(toChat.id, update, text, parseMode, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Send media group via [sendMediaGroup] extension with edited [entities] of first [messages] element. Other elements
|
|
||||||
* will be copied as they are
|
|
||||||
*/
|
|
||||||
suspend inline fun TelegramBot.copyMessages(
|
|
||||||
toChatId: ChatIdentifier,
|
|
||||||
messages: List<MediaGroupMessage<MediaGroupContent>>,
|
|
||||||
entities: TextSourcesList,
|
|
||||||
disableNotification: Boolean = false,
|
|
||||||
protectContent: Boolean = false,
|
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
|
||||||
allowSendingWithoutReply: Boolean? = null
|
|
||||||
): List<MediaGroupMessage<MediaGroupContent>> {
|
|
||||||
val first = messages.first().content.toMediaGroupMemberTelegramMedia().let {
|
|
||||||
when (it) {
|
|
||||||
is TelegramMediaAudio -> TelegramMediaAudio(it.file, entities, it.duration, it.performer, it.title, it.thumb)
|
|
||||||
is TelegramMediaDocument -> TelegramMediaDocument(it.file, entities, it.thumb, it.disableContentTypeDetection)
|
|
||||||
is TelegramMediaPhoto -> TelegramMediaPhoto(it.file, entities)
|
|
||||||
is TelegramMediaVideo -> TelegramMediaVideo(it.file, entities, it.width, it.height, it.duration, it.thumb)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return sendMediaGroup(
|
|
||||||
toChatId,
|
|
||||||
listOf(first) + messages.drop(1).map {
|
|
||||||
it.content.toMediaGroupMemberTelegramMedia()
|
|
||||||
},
|
|
||||||
disableNotification,
|
|
||||||
protectContent,
|
|
||||||
replyToMessageId,
|
|
||||||
allowSendingWithoutReply
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Send media group via [sendMediaGroup] extension with edited [entities] of first [messages] element. Other elements
|
|
||||||
* will be copied as they are
|
|
||||||
*/
|
|
||||||
suspend inline fun TelegramBot.copyMessages(
|
|
||||||
toChat: Chat,
|
|
||||||
messages: List<MediaGroupMessage<MediaGroupContent>>,
|
|
||||||
entities: TextSourcesList,
|
|
||||||
disableNotification: Boolean = false,
|
|
||||||
protectContent: Boolean = false,
|
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
|
||||||
allowSendingWithoutReply: Boolean? = null
|
|
||||||
) = copyMessages(toChat.id, messages, entities, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Send media group via [sendMediaGroup] extension with edited [entities] of first [messages] element. Other elements
|
|
||||||
* will be copied as they are
|
|
||||||
*/
|
|
||||||
suspend inline fun TelegramBot.copyMessages(
|
|
||||||
toChat: ChatIdentifier,
|
|
||||||
update: SentMediaGroupUpdate,
|
|
||||||
entities: TextSourcesList,
|
|
||||||
disableNotification: Boolean = false,
|
|
||||||
protectContent: Boolean = false,
|
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
|
||||||
allowSendingWithoutReply: Boolean? = null
|
|
||||||
) = copyMessages(toChat, update.data, entities, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Send media group via [sendMediaGroup] extension with edited [entities] of first [messages] element. Other elements
|
|
||||||
* will be copied as they are
|
|
||||||
*/
|
|
||||||
suspend inline fun TelegramBot.copyMessages(
|
|
||||||
toChat: Chat,
|
|
||||||
update: SentMediaGroupUpdate,
|
|
||||||
entities: TextSourcesList,
|
|
||||||
disableNotification: Boolean = false,
|
|
||||||
protectContent: Boolean = false,
|
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
|
||||||
allowSendingWithoutReply: Boolean? = null
|
|
||||||
) = copyMessages(toChat.id, update, entities, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply)
|
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.api.send
|
package dev.inmo.tgbotapi.extensions.api.send
|
||||||
|
|
||||||
import dev.inmo.tgbotapi.abstracts.types.WithReplyMarkup
|
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.extensions.api.*
|
import dev.inmo.tgbotapi.extensions.api.*
|
||||||
import dev.inmo.tgbotapi.extensions.api.send.games.sendGame
|
import dev.inmo.tgbotapi.extensions.api.send.games.sendGame
|
||||||
@@ -12,7 +11,6 @@ import dev.inmo.tgbotapi.requests.abstracts.InputFile
|
|||||||
import dev.inmo.tgbotapi.requests.send.media.rawSendingMediaGroupsWarning
|
import dev.inmo.tgbotapi.requests.send.media.rawSendingMediaGroupsWarning
|
||||||
import dev.inmo.tgbotapi.types.*
|
import dev.inmo.tgbotapi.types.*
|
||||||
import dev.inmo.tgbotapi.types.media.*
|
import dev.inmo.tgbotapi.types.media.*
|
||||||
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.message.ParseMode
|
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||||
@@ -25,14 +23,16 @@ import dev.inmo.tgbotapi.types.files.Sticker
|
|||||||
import dev.inmo.tgbotapi.types.games.Game
|
import dev.inmo.tgbotapi.types.games.Game
|
||||||
import dev.inmo.tgbotapi.types.location.*
|
import dev.inmo.tgbotapi.types.location.*
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
||||||
|
import dev.inmo.tgbotapi.types.message.abstracts.PossiblyTopicMessage
|
||||||
import dev.inmo.tgbotapi.types.message.content.*
|
import dev.inmo.tgbotapi.types.message.content.*
|
||||||
|
import dev.inmo.tgbotapi.types.message.textsources.TextSource
|
||||||
import dev.inmo.tgbotapi.types.payments.LabeledPrice
|
import dev.inmo.tgbotapi.types.payments.LabeledPrice
|
||||||
import dev.inmo.tgbotapi.types.payments.abstracts.Currency
|
import dev.inmo.tgbotapi.types.payments.abstracts.Currency
|
||||||
import dev.inmo.tgbotapi.types.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.*
|
||||||
|
import dev.inmo.tgbotapi.utils.extensions.threadIdOrNull
|
||||||
import kotlinx.coroutines.flow.Flow
|
import kotlinx.coroutines.flow.Flow
|
||||||
import kotlinx.coroutines.flow.map
|
|
||||||
import kotlin.js.JsName
|
import kotlin.js.JsName
|
||||||
import kotlin.jvm.JvmName
|
import kotlin.jvm.JvmName
|
||||||
|
|
||||||
@@ -57,6 +57,7 @@ suspend inline fun TelegramBot.reply(
|
|||||||
phoneNumber,
|
phoneNumber,
|
||||||
firstName,
|
firstName,
|
||||||
lastName,
|
lastName,
|
||||||
|
to.threadIdOrNull,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
to.messageId,
|
to.messageId,
|
||||||
@@ -78,6 +79,7 @@ suspend inline fun TelegramBot.reply(
|
|||||||
) = sendContact(
|
) = sendContact(
|
||||||
to.chat,
|
to.chat,
|
||||||
contact,
|
contact,
|
||||||
|
to.threadIdOrNull,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
to.messageId,
|
to.messageId,
|
||||||
@@ -99,7 +101,7 @@ suspend inline fun TelegramBot.replyWithDice(
|
|||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendDice(to.chat, animationType, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
) = sendDice(to.chat, animationType, to.threadIdOrNull, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -133,6 +135,7 @@ suspend inline fun TelegramBot.reply(
|
|||||||
to.chat,
|
to.chat,
|
||||||
latitude,
|
latitude,
|
||||||
longitude,
|
longitude,
|
||||||
|
to.threadIdOrNull,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
allowSendingWithoutReply,
|
allowSendingWithoutReply,
|
||||||
@@ -154,6 +157,7 @@ suspend inline fun TelegramBot.reply(
|
|||||||
) = sendLocation(
|
) = sendLocation(
|
||||||
to.chat,
|
to.chat,
|
||||||
location,
|
location,
|
||||||
|
to.threadIdOrNull,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
allowSendingWithoutReply,
|
allowSendingWithoutReply,
|
||||||
@@ -182,6 +186,7 @@ suspend inline fun TelegramBot.reply(
|
|||||||
text,
|
text,
|
||||||
parseMode,
|
parseMode,
|
||||||
disableWebPagePreview,
|
disableWebPagePreview,
|
||||||
|
to.threadIdOrNull,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
to.messageId,
|
to.messageId,
|
||||||
@@ -205,6 +210,7 @@ suspend inline fun TelegramBot.reply(
|
|||||||
to.chat,
|
to.chat,
|
||||||
entities,
|
entities,
|
||||||
disableWebPagePreview,
|
disableWebPagePreview,
|
||||||
|
to.threadIdOrNull,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
to.messageId,
|
to.messageId,
|
||||||
@@ -212,6 +218,36 @@ suspend inline fun TelegramBot.reply(
|
|||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
|
* as a builder for that
|
||||||
|
*/
|
||||||
|
suspend fun TelegramBot.reply(
|
||||||
|
to: Message,
|
||||||
|
separator: TextSource? = null,
|
||||||
|
disableWebPagePreview: Boolean? = null,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null,
|
||||||
|
builderBody: EntitiesBuilderBody
|
||||||
|
) = reply(to, buildEntities(separator, builderBody), disableWebPagePreview, disableNotification, protectContent, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
|
* as a builder for that
|
||||||
|
*/
|
||||||
|
suspend fun TelegramBot.reply(
|
||||||
|
to: Message,
|
||||||
|
separator: String,
|
||||||
|
disableWebPagePreview: Boolean? = null,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null,
|
||||||
|
builderBody: EntitiesBuilderBody
|
||||||
|
) = reply(to, buildEntities(separator, builderBody), disableWebPagePreview, disableNotification, protectContent, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
|
|
||||||
// Venue
|
// Venue
|
||||||
|
|
||||||
@@ -243,6 +279,7 @@ suspend inline fun TelegramBot.reply(
|
|||||||
foursquareType = foursquareType,
|
foursquareType = foursquareType,
|
||||||
googlePlaceId = googlePlaceId,
|
googlePlaceId = googlePlaceId,
|
||||||
googlePlaceType = googlePlaceType,
|
googlePlaceType = googlePlaceType,
|
||||||
|
threadId = to.threadIdOrNull,
|
||||||
disableNotification = disableNotification,
|
disableNotification = disableNotification,
|
||||||
protectContent = protectContent,
|
protectContent = protectContent,
|
||||||
replyToMessageId = to.messageId,
|
replyToMessageId = to.messageId,
|
||||||
@@ -273,6 +310,7 @@ suspend inline fun TelegramBot.reply(
|
|||||||
foursquareType = foursquareType,
|
foursquareType = foursquareType,
|
||||||
googlePlaceId = googlePlaceId,
|
googlePlaceId = googlePlaceId,
|
||||||
googlePlaceType = googlePlaceType,
|
googlePlaceType = googlePlaceType,
|
||||||
|
threadId = to.threadIdOrNull,
|
||||||
disableNotification = disableNotification,
|
disableNotification = disableNotification,
|
||||||
protectContent = protectContent,
|
protectContent = protectContent,
|
||||||
replyToMessageId = to.messageId,
|
replyToMessageId = to.messageId,
|
||||||
@@ -290,6 +328,7 @@ suspend inline fun TelegramBot.reply(
|
|||||||
) = sendVenue(
|
) = sendVenue(
|
||||||
chat = to.chat,
|
chat = to.chat,
|
||||||
venue = venue,
|
venue = venue,
|
||||||
|
threadId = to.threadIdOrNull,
|
||||||
disableNotification = disableNotification,
|
disableNotification = disableNotification,
|
||||||
protectContent = protectContent,
|
protectContent = protectContent,
|
||||||
replyToMessageId = to.messageId,
|
replyToMessageId = to.messageId,
|
||||||
@@ -308,7 +347,7 @@ suspend inline fun TelegramBot.replyWithGame(
|
|||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendGame(
|
) = sendGame(
|
||||||
to.chat, gameShortName, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup
|
to.chat, gameShortName, to.threadIdOrNull, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
suspend inline fun TelegramBot.replyWithGame(
|
suspend inline fun TelegramBot.replyWithGame(
|
||||||
@@ -319,7 +358,7 @@ suspend inline fun TelegramBot.replyWithGame(
|
|||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendGame(
|
) = sendGame(
|
||||||
to.chat, game.title, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup
|
to.chat, game.title, to.threadIdOrNull, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
suspend inline fun TelegramBot.reply(
|
suspend inline fun TelegramBot.reply(
|
||||||
@@ -356,6 +395,7 @@ suspend inline fun TelegramBot.replyWithAnimation(
|
|||||||
duration,
|
duration,
|
||||||
width,
|
width,
|
||||||
height,
|
height,
|
||||||
|
to.threadIdOrNull,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
to.messageId,
|
to.messageId,
|
||||||
@@ -375,7 +415,7 @@ suspend inline fun TelegramBot.reply(
|
|||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendAnimation(to.chat, animation, text, parseMode, duration, width, height, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
) = sendAnimation(to.chat, animation, text, parseMode, duration, width, height, to.threadIdOrNull, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
suspend inline fun TelegramBot.replyWithAnimation(
|
suspend inline fun TelegramBot.replyWithAnimation(
|
||||||
to: Message,
|
to: Message,
|
||||||
@@ -397,6 +437,7 @@ suspend inline fun TelegramBot.replyWithAnimation(
|
|||||||
duration,
|
duration,
|
||||||
width,
|
width,
|
||||||
height,
|
height,
|
||||||
|
to.threadIdOrNull,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
to.messageId,
|
to.messageId,
|
||||||
@@ -415,7 +456,7 @@ suspend inline fun TelegramBot.reply(
|
|||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendAnimation(to.chat, animation, entities, duration, width, height, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
) = sendAnimation(to.chat, animation, entities, duration, width, height, to.threadIdOrNull, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
|
|
||||||
// Audio
|
// Audio
|
||||||
@@ -433,7 +474,7 @@ suspend inline fun TelegramBot.replyWithAudio(
|
|||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendAudio(to.chat, audio, thumb, text, parseMode, duration, performer, title, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
) = sendAudio(to.chat, audio, thumb, text, parseMode, duration, performer, title, to.threadIdOrNull, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
suspend inline fun TelegramBot.reply(
|
suspend inline fun TelegramBot.reply(
|
||||||
to: Message,
|
to: Message,
|
||||||
@@ -445,7 +486,7 @@ suspend inline fun TelegramBot.reply(
|
|||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendAudio(to.chat, audio, text, parseMode, title, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
) = sendAudio(to.chat, audio, text, parseMode, title, to.threadIdOrNull, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
suspend inline fun TelegramBot.replyWithAudio(
|
suspend inline fun TelegramBot.replyWithAudio(
|
||||||
to: Message,
|
to: Message,
|
||||||
@@ -459,7 +500,7 @@ suspend inline fun TelegramBot.replyWithAudio(
|
|||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendAudio(to.chat, audio, thumb, entities, duration, performer, title, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
) = sendAudio(to.chat, audio, thumb, entities, duration, performer, title, to.threadIdOrNull, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
suspend inline fun TelegramBot.reply(
|
suspend inline fun TelegramBot.reply(
|
||||||
to: Message,
|
to: Message,
|
||||||
@@ -470,7 +511,7 @@ suspend inline fun TelegramBot.reply(
|
|||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendAudio(to.chat, audio, entities, title, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
) = sendAudio(to.chat, audio, entities, title, to.threadIdOrNull, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
|
|
||||||
// Documents
|
// Documents
|
||||||
@@ -486,7 +527,7 @@ suspend inline fun TelegramBot.replyWithDocument(
|
|||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null,
|
replyMarkup: KeyboardMarkup? = null,
|
||||||
disableContentTypeDetection: Boolean? = null
|
disableContentTypeDetection: Boolean? = null
|
||||||
) = sendDocument(to.chat, document, thumb, text, parseMode, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup, disableContentTypeDetection)
|
) = sendDocument(to.chat, document, thumb, text, parseMode, to.threadIdOrNull, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup, disableContentTypeDetection)
|
||||||
|
|
||||||
suspend inline fun TelegramBot.reply(
|
suspend inline fun TelegramBot.reply(
|
||||||
to: Message,
|
to: Message,
|
||||||
@@ -498,7 +539,7 @@ suspend inline fun TelegramBot.reply(
|
|||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null,
|
replyMarkup: KeyboardMarkup? = null,
|
||||||
disableContentTypeDetection: Boolean? = null
|
disableContentTypeDetection: Boolean? = null
|
||||||
) = sendDocument(to.chat, document, text, parseMode, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup, disableContentTypeDetection)
|
) = sendDocument(to.chat, document, text, parseMode, to.threadIdOrNull, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup, disableContentTypeDetection)
|
||||||
|
|
||||||
suspend inline fun TelegramBot.replyWithDocument(
|
suspend inline fun TelegramBot.replyWithDocument(
|
||||||
to: Message,
|
to: Message,
|
||||||
@@ -510,7 +551,7 @@ suspend inline fun TelegramBot.replyWithDocument(
|
|||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null,
|
replyMarkup: KeyboardMarkup? = null,
|
||||||
disableContentTypeDetection: Boolean? = null
|
disableContentTypeDetection: Boolean? = null
|
||||||
) = sendDocument(to.chat, document, thumb, entities, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup, disableContentTypeDetection)
|
) = sendDocument(to.chat, document, thumb, entities, to.threadIdOrNull, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup, disableContentTypeDetection)
|
||||||
|
|
||||||
suspend inline fun TelegramBot.reply(
|
suspend inline fun TelegramBot.reply(
|
||||||
to: Message,
|
to: Message,
|
||||||
@@ -521,7 +562,7 @@ suspend inline fun TelegramBot.reply(
|
|||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null,
|
replyMarkup: KeyboardMarkup? = null,
|
||||||
disableContentTypeDetection: Boolean? = null
|
disableContentTypeDetection: Boolean? = null
|
||||||
) = sendDocument(to.chat, document, entities, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup, disableContentTypeDetection)
|
) = sendDocument(to.chat, document, entities, to.threadIdOrNull, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup, disableContentTypeDetection)
|
||||||
|
|
||||||
|
|
||||||
// Media Group
|
// Media Group
|
||||||
@@ -533,7 +574,7 @@ suspend inline fun TelegramBot.replyWithMediaGroup(
|
|||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null
|
allowSendingWithoutReply: Boolean? = null
|
||||||
) = sendMediaGroup(to.chat, media, disableNotification, protectContent, to.messageId, allowSendingWithoutReply)
|
) = sendMediaGroup(to.chat, media, to.threadIdOrNull, disableNotification, protectContent, to.messageId, allowSendingWithoutReply)
|
||||||
|
|
||||||
suspend inline fun TelegramBot.replyWithPlaylist(
|
suspend inline fun TelegramBot.replyWithPlaylist(
|
||||||
to: Message,
|
to: Message,
|
||||||
@@ -541,7 +582,7 @@ suspend inline fun TelegramBot.replyWithPlaylist(
|
|||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null
|
allowSendingWithoutReply: Boolean? = null
|
||||||
) = sendPlaylist(to.chat, media, disableNotification, protectContent, to.messageId, allowSendingWithoutReply)
|
) = sendPlaylist(to.chat, media, to.threadIdOrNull, disableNotification, protectContent, to.messageId, allowSendingWithoutReply)
|
||||||
|
|
||||||
suspend inline fun TelegramBot.replyWithDocuments(
|
suspend inline fun TelegramBot.replyWithDocuments(
|
||||||
to: Message,
|
to: Message,
|
||||||
@@ -549,7 +590,7 @@ suspend inline fun TelegramBot.replyWithDocuments(
|
|||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null
|
allowSendingWithoutReply: Boolean? = null
|
||||||
) = sendDocumentsGroup(to.chat, media, disableNotification, protectContent, to.messageId, allowSendingWithoutReply)
|
) = sendDocumentsGroup(to.chat, media, to.threadIdOrNull, disableNotification, protectContent, to.messageId, allowSendingWithoutReply)
|
||||||
|
|
||||||
suspend inline fun TelegramBot.replyWithGallery(
|
suspend inline fun TelegramBot.replyWithGallery(
|
||||||
to: Message,
|
to: Message,
|
||||||
@@ -557,7 +598,7 @@ suspend inline fun TelegramBot.replyWithGallery(
|
|||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null
|
allowSendingWithoutReply: Boolean? = null
|
||||||
) = sendVisualMediaGroup(to.chat, media, disableNotification, protectContent, to.messageId, allowSendingWithoutReply)
|
) = sendVisualMediaGroup(to.chat, media, to.threadIdOrNull, disableNotification, protectContent, to.messageId, allowSendingWithoutReply)
|
||||||
|
|
||||||
|
|
||||||
// Photo
|
// Photo
|
||||||
@@ -571,7 +612,7 @@ suspend inline fun TelegramBot.replyWithPhoto(
|
|||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendPhoto(to.chat, fileId, text, parseMode, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
) = sendPhoto(to.chat, fileId, text, parseMode, to.threadIdOrNull, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
suspend inline fun TelegramBot.reply(
|
suspend inline fun TelegramBot.reply(
|
||||||
to: Message,
|
to: Message,
|
||||||
@@ -582,7 +623,7 @@ suspend inline fun TelegramBot.reply(
|
|||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendPhoto(to.chat, photo, text, parseMode, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
) = sendPhoto(to.chat, photo, text, parseMode, to.threadIdOrNull, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
suspend inline fun TelegramBot.reply(
|
suspend inline fun TelegramBot.reply(
|
||||||
to: Message,
|
to: Message,
|
||||||
@@ -593,7 +634,7 @@ suspend inline fun TelegramBot.reply(
|
|||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendPhoto(to.chat, photoSize, text, parseMode, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
) = sendPhoto(to.chat, photoSize, text, parseMode, to.threadIdOrNull, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
|
|
||||||
suspend inline fun TelegramBot.replyWithPhoto(
|
suspend inline fun TelegramBot.replyWithPhoto(
|
||||||
@@ -604,7 +645,7 @@ suspend inline fun TelegramBot.replyWithPhoto(
|
|||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendPhoto(to.chat, fileId, entities, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
) = sendPhoto(to.chat, fileId, entities, to.threadIdOrNull, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
suspend inline fun TelegramBot.reply(
|
suspend inline fun TelegramBot.reply(
|
||||||
to: Message,
|
to: Message,
|
||||||
@@ -614,7 +655,7 @@ suspend inline fun TelegramBot.reply(
|
|||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendPhoto(to.chat, photo, entities, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
) = sendPhoto(to.chat, photo, entities, to.threadIdOrNull, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
suspend inline fun TelegramBot.reply(
|
suspend inline fun TelegramBot.reply(
|
||||||
to: Message,
|
to: Message,
|
||||||
@@ -624,7 +665,7 @@ suspend inline fun TelegramBot.reply(
|
|||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendPhoto(to.chat, photoSize, entities, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
) = sendPhoto(to.chat, photoSize, entities, to.threadIdOrNull, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
|
|
||||||
// Sticker
|
// Sticker
|
||||||
@@ -636,7 +677,7 @@ suspend inline fun TelegramBot.replyWithSticker(
|
|||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendSticker(to.chat, sticker, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
) = sendSticker(to.chat, sticker, to.threadIdOrNull, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
suspend inline fun TelegramBot.reply(
|
suspend inline fun TelegramBot.reply(
|
||||||
to: Message,
|
to: Message,
|
||||||
@@ -645,7 +686,7 @@ suspend inline fun TelegramBot.reply(
|
|||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendSticker(to.chat, sticker, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
) = sendSticker(to.chat, sticker, to.threadIdOrNull, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
|
|
||||||
// Videos
|
// Videos
|
||||||
@@ -663,7 +704,7 @@ suspend inline fun TelegramBot.replyWithVideo(
|
|||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVideo(to.chat, video, thumb, text, parseMode, duration, width, height, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
) = sendVideo(to.chat, video, thumb, text, parseMode, duration, width, height, to.threadIdOrNull, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
suspend inline fun TelegramBot.reply(
|
suspend inline fun TelegramBot.reply(
|
||||||
to: Message,
|
to: Message,
|
||||||
@@ -674,7 +715,7 @@ suspend inline fun TelegramBot.reply(
|
|||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVideo(to.chat, video, text, parseMode, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
) = sendVideo(to.chat, video, text, parseMode, to.threadIdOrNull, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
suspend inline fun TelegramBot.replyWithVideo(
|
suspend inline fun TelegramBot.replyWithVideo(
|
||||||
to: Message,
|
to: Message,
|
||||||
@@ -688,7 +729,7 @@ suspend inline fun TelegramBot.replyWithVideo(
|
|||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVideo(to.chat, video, thumb, entities, duration, width, height, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
) = sendVideo(to.chat, video, thumb, entities, duration, width, height, to.threadIdOrNull, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
suspend inline fun TelegramBot.reply(
|
suspend inline fun TelegramBot.reply(
|
||||||
to: Message,
|
to: Message,
|
||||||
@@ -698,7 +739,7 @@ suspend inline fun TelegramBot.reply(
|
|||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVideo(to.chat, video, entities, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
) = sendVideo(to.chat, video, entities, to.threadIdOrNull, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
|
|
||||||
// VideoNotes
|
// VideoNotes
|
||||||
@@ -713,7 +754,7 @@ suspend inline fun TelegramBot.replyWithVideoNote(
|
|||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVideoNote(to.chat, videoNote, thumb, duration, size, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
) = sendVideoNote(to.chat, videoNote, thumb, duration, size, to.threadIdOrNull, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
suspend inline fun TelegramBot.reply(
|
suspend inline fun TelegramBot.reply(
|
||||||
to: Message,
|
to: Message,
|
||||||
@@ -722,7 +763,7 @@ suspend inline fun TelegramBot.reply(
|
|||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVideoNote(to.chat, videoNote, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
) = sendVideoNote(to.chat, videoNote, to.threadIdOrNull, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
|
|
||||||
// Voice
|
// Voice
|
||||||
@@ -737,7 +778,7 @@ suspend inline fun TelegramBot.replyWithVoice(
|
|||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVoice(to.chat, voice, text, parseMode, duration, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
) = sendVoice(to.chat, voice, text, parseMode, duration, to.threadIdOrNull, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
suspend inline fun TelegramBot.reply(
|
suspend inline fun TelegramBot.reply(
|
||||||
to: Message,
|
to: Message,
|
||||||
@@ -748,7 +789,7 @@ suspend inline fun TelegramBot.reply(
|
|||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVoice(to.chat, voice, text, parseMode, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
) = sendVoice(to.chat, voice, text, parseMode, to.threadIdOrNull, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
|
|
||||||
suspend inline fun TelegramBot.replyWithVoice(
|
suspend inline fun TelegramBot.replyWithVoice(
|
||||||
@@ -760,7 +801,7 @@ suspend inline fun TelegramBot.replyWithVoice(
|
|||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVoice(to.chat, voice, entities, duration, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
) = sendVoice(to.chat, voice, entities, duration, to.threadIdOrNull, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
suspend inline fun TelegramBot.reply(
|
suspend inline fun TelegramBot.reply(
|
||||||
to: Message,
|
to: Message,
|
||||||
@@ -770,7 +811,7 @@ suspend inline fun TelegramBot.reply(
|
|||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVoice(to.chat, voice, entities, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
) = sendVoice(to.chat, voice, entities, to.threadIdOrNull, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
|
|
||||||
// Invoice
|
// Invoice
|
||||||
@@ -802,7 +843,7 @@ suspend inline fun TelegramBot.reply(
|
|||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = sendInvoice(to.chat.id, title, description, payload, providerToken, currency, prices, maxTipAmount, suggestedTipAmounts, startParameter, providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
) = sendInvoice(to.chat.id, title, description, payload, providerToken, currency, prices, maxTipAmount, suggestedTipAmounts, startParameter, providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress, to.threadIdOrNull, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
|
|
||||||
// Polls
|
// Polls
|
||||||
@@ -819,7 +860,7 @@ suspend inline fun TelegramBot.reply(
|
|||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendRegularPoll(to.chat, question, options, isAnonymous, isClosed, allowMultipleAnswers, closeInfo, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
) = sendRegularPoll(to.chat, question, options, isAnonymous, isClosed, allowMultipleAnswers, closeInfo, to.threadIdOrNull, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
suspend inline fun TelegramBot.reply(
|
suspend inline fun TelegramBot.reply(
|
||||||
to: Message,
|
to: Message,
|
||||||
@@ -834,7 +875,7 @@ suspend inline fun TelegramBot.reply(
|
|||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendRegularPoll(to.chat, poll, isClosed, question, options, isAnonymous, allowMultipleAnswers, closeInfo, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
) = sendRegularPoll(to.chat, poll, isClosed, question, options, isAnonymous, allowMultipleAnswers, closeInfo, to.threadIdOrNull, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
suspend inline fun TelegramBot.reply(
|
suspend inline fun TelegramBot.reply(
|
||||||
to: Message,
|
to: Message,
|
||||||
@@ -850,7 +891,7 @@ suspend inline fun TelegramBot.reply(
|
|||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendQuizPoll(to.chat, question, options, correctOptionId, isAnonymous, isClosed, explanation, parseMode, closeInfo, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
) = sendQuizPoll(to.chat, question, options, correctOptionId, isAnonymous, isClosed, explanation, parseMode, closeInfo, to.threadIdOrNull, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
suspend inline fun TelegramBot.reply(
|
suspend inline fun TelegramBot.reply(
|
||||||
to: Message,
|
to: Message,
|
||||||
@@ -867,7 +908,7 @@ suspend inline fun TelegramBot.reply(
|
|||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendQuizPoll(to.chat, isClosed, quizPoll, question, options, correctOptionId, isAnonymous, explanation, parseMode, closeInfo, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
) = sendQuizPoll(to.chat, isClosed, quizPoll, question, options, correctOptionId, isAnonymous, explanation, parseMode, closeInfo, to.threadIdOrNull, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
suspend inline fun TelegramBot.reply(
|
suspend inline fun TelegramBot.reply(
|
||||||
to: Message,
|
to: Message,
|
||||||
@@ -882,7 +923,7 @@ suspend inline fun TelegramBot.reply(
|
|||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendQuizPoll(to.chat, question, options, correctOptionId, isAnonymous, isClosed, entities, closeInfo, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
) = sendQuizPoll(to.chat, question, options, correctOptionId, isAnonymous, isClosed, entities, closeInfo, to.threadIdOrNull, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
suspend inline fun TelegramBot.reply(
|
suspend inline fun TelegramBot.reply(
|
||||||
to: Message,
|
to: Message,
|
||||||
@@ -898,7 +939,7 @@ suspend inline fun TelegramBot.reply(
|
|||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendQuizPoll(to.chat, isClosed, quizPoll, question, options, correctOptionId, isAnonymous, entities, closeInfo, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
) = sendQuizPoll(to.chat, isClosed, quizPoll, question, options, correctOptionId, isAnonymous, entities, closeInfo, to.threadIdOrNull, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
|
|
||||||
suspend inline fun TelegramBot.reply(
|
suspend inline fun TelegramBot.reply(
|
||||||
@@ -949,7 +990,7 @@ 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,
|
||||||
@@ -962,6 +1003,7 @@ suspend inline fun TelegramBot.reply(
|
|||||||
messageId,
|
messageId,
|
||||||
text,
|
text,
|
||||||
parseMode,
|
parseMode,
|
||||||
|
to.threadIdOrNull,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
to.messageId,
|
to.messageId,
|
||||||
@@ -972,7 +1014,7 @@ suspend inline fun TelegramBot.reply(
|
|||||||
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,
|
||||||
@@ -999,18 +1041,17 @@ suspend fun TelegramBot.reply(
|
|||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) {
|
): Message = execute(
|
||||||
execute(
|
content.createResend(
|
||||||
content.createResend(
|
to.chat.id,
|
||||||
to.chat.id,
|
to.threadIdOrNull,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
to.messageId,
|
to.messageId,
|
||||||
allowSendingWithoutReply,
|
allowSendingWithoutReply,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
|
||||||
)
|
)
|
||||||
}
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Will use [handleLiveLocation] with replying to [message] each time new message will be sent by live location update
|
* Will use [handleLiveLocation] with replying to [message] each time new message will be sent by live location update
|
||||||
@@ -1028,6 +1069,7 @@ suspend fun TelegramBot.reply(
|
|||||||
message.chat.id,
|
message.chat.id,
|
||||||
locationsFlow,
|
locationsFlow,
|
||||||
liveTimeMillis,
|
liveTimeMillis,
|
||||||
|
message.threadIdOrNull,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
message.messageId,
|
message.messageId,
|
||||||
@@ -1053,6 +1095,7 @@ suspend fun TelegramBot.reply(
|
|||||||
message.chat.id,
|
message.chat.id,
|
||||||
locationsFlow,
|
locationsFlow,
|
||||||
liveTimeMillis,
|
liveTimeMillis,
|
||||||
|
message.threadIdOrNull,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
message.messageId,
|
message.messageId,
|
||||||
@@ -1079,6 +1122,7 @@ suspend fun TelegramBot.reply(
|
|||||||
message.chat.id,
|
message.chat.id,
|
||||||
locationsFlow,
|
locationsFlow,
|
||||||
liveTimeMillis,
|
liveTimeMillis,
|
||||||
|
message.threadIdOrNull,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
message.messageId,
|
message.messageId,
|
||||||
@@ -1191,7 +1235,7 @@ suspend fun TelegramBot.reply(
|
|||||||
allowSendingWithoutReply = allowSendingWithoutReply,
|
allowSendingWithoutReply = allowSendingWithoutReply,
|
||||||
replyMarkup = replyMarkup
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
is AudioMediaGroupContent -> reply(
|
is AudioMediaGroupPartContent -> reply(
|
||||||
to = to,
|
to = to,
|
||||||
audio = content.media,
|
audio = content.media,
|
||||||
text = text,
|
text = text,
|
||||||
@@ -1247,7 +1291,7 @@ suspend fun TelegramBot.reply(
|
|||||||
suspend fun TelegramBot.reply(
|
suspend fun TelegramBot.reply(
|
||||||
to: Message,
|
to: Message,
|
||||||
content: TextedMediaContent,
|
content: TextedMediaContent,
|
||||||
entities: List<TextSource>,
|
entities: TextSourcesList,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
@@ -1263,7 +1307,7 @@ suspend fun TelegramBot.reply(
|
|||||||
allowSendingWithoutReply = allowSendingWithoutReply,
|
allowSendingWithoutReply = allowSendingWithoutReply,
|
||||||
replyMarkup = replyMarkup
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
is AudioMediaGroupContent -> reply(
|
is AudioMediaGroupPartContent -> reply(
|
||||||
to = to,
|
to = to,
|
||||||
audio = content.media,
|
audio = content.media,
|
||||||
entities = entities,
|
entities = entities,
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -15,14 +15,15 @@ suspend fun TelegramBot.sendContact(
|
|||||||
phoneNumber: String,
|
phoneNumber: String,
|
||||||
firstName: String,
|
firstName: String,
|
||||||
lastName: String? = null,
|
lastName: String? = null,
|
||||||
|
threadId: MessageThreadId? = 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(
|
||||||
SendContact(
|
SendContact(
|
||||||
chatId, phoneNumber, firstName, lastName, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
chatId, phoneNumber, firstName, lastName, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -33,14 +34,15 @@ suspend fun TelegramBot.sendContact(
|
|||||||
suspend fun TelegramBot.sendContact(
|
suspend fun TelegramBot.sendContact(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
contact: Contact,
|
contact: Contact,
|
||||||
|
threadId: MessageThreadId? = 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(
|
||||||
SendContact(
|
SendContact(
|
||||||
chatId, contact, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
chatId, contact, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -53,13 +55,14 @@ suspend fun TelegramBot.sendContact(
|
|||||||
phoneNumber: String,
|
phoneNumber: String,
|
||||||
firstName: String,
|
firstName: String,
|
||||||
lastName: String? = null,
|
lastName: String? = null,
|
||||||
|
threadId: MessageThreadId? = 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(
|
||||||
chat.id, phoneNumber, firstName, lastName, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
chat.id, phoneNumber, firstName, lastName, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -69,11 +72,12 @@ suspend fun TelegramBot.sendContact(
|
|||||||
suspend fun TelegramBot.sendContact(
|
suspend fun TelegramBot.sendContact(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
contact: Contact,
|
contact: Contact,
|
||||||
|
threadId: MessageThreadId? = 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(
|
||||||
chat.id, contact, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
chat.id, contact, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -3,7 +3,8 @@ 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.MessageThreadId
|
||||||
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
|
||||||
@@ -15,13 +16,14 @@ import dev.inmo.tgbotapi.types.dice.DiceAnimationType
|
|||||||
suspend fun TelegramBot.sendDice(
|
suspend fun TelegramBot.sendDice(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
animationType: DiceAnimationType? = null,
|
animationType: DiceAnimationType? = null,
|
||||||
|
threadId: MessageThreadId? = 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(
|
||||||
SendDice(chatId, animationType, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
SendDice(chatId, animationType, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -31,9 +33,10 @@ suspend fun TelegramBot.sendDice(
|
|||||||
suspend fun TelegramBot.sendDice(
|
suspend fun TelegramBot.sendDice(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
animationType: DiceAnimationType? = null,
|
animationType: DiceAnimationType? = null,
|
||||||
|
threadId: MessageThreadId? = 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, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|||||||
@@ -2,12 +2,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.SendLiveLocation
|
import dev.inmo.tgbotapi.requests.send.SendLiveLocation
|
||||||
import dev.inmo.tgbotapi.requests.send.SendStaticLocation
|
|
||||||
import dev.inmo.tgbotapi.types.*
|
import dev.inmo.tgbotapi.types.*
|
||||||
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.Location
|
import dev.inmo.tgbotapi.types.location.Location
|
||||||
import dev.inmo.tgbotapi.types.location.StaticLocation
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @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
|
||||||
@@ -21,9 +19,10 @@ suspend fun TelegramBot.sendLocation(
|
|||||||
horizontalAccuracy: Meters? = null,
|
horizontalAccuracy: Meters? = null,
|
||||||
heading: Degrees? = null,
|
heading: Degrees? = null,
|
||||||
proximityAlertRadius: Meters? = null,
|
proximityAlertRadius: Meters? = null,
|
||||||
|
threadId: MessageThreadId? = 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,6 +34,7 @@ suspend fun TelegramBot.sendLocation(
|
|||||||
horizontalAccuracy,
|
horizontalAccuracy,
|
||||||
heading,
|
heading,
|
||||||
proximityAlertRadius,
|
proximityAlertRadius,
|
||||||
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
replyToMessageId,
|
replyToMessageId,
|
||||||
@@ -54,9 +54,10 @@ suspend fun TelegramBot.sendLocation(
|
|||||||
horizontalAccuracy: Meters? = null,
|
horizontalAccuracy: Meters? = null,
|
||||||
heading: Degrees? = null,
|
heading: Degrees? = null,
|
||||||
proximityAlertRadius: Meters? = null,
|
proximityAlertRadius: Meters? = null,
|
||||||
|
threadId: MessageThreadId? = 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
|
||||||
) = sendLocation(
|
) = sendLocation(
|
||||||
@@ -67,6 +68,7 @@ suspend fun TelegramBot.sendLocation(
|
|||||||
horizontalAccuracy,
|
horizontalAccuracy,
|
||||||
heading,
|
heading,
|
||||||
proximityAlertRadius,
|
proximityAlertRadius,
|
||||||
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
replyToMessageId,
|
replyToMessageId,
|
||||||
@@ -86,9 +88,10 @@ suspend fun TelegramBot.sendLocation(
|
|||||||
horizontalAccuracy: Meters? = null,
|
horizontalAccuracy: Meters? = null,
|
||||||
heading: Degrees? = null,
|
heading: Degrees? = null,
|
||||||
proximityAlertRadius: Meters? = null,
|
proximityAlertRadius: Meters? = null,
|
||||||
|
threadId: MessageThreadId? = 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
|
||||||
) = sendLocation(
|
) = sendLocation(
|
||||||
@@ -99,6 +102,7 @@ suspend fun TelegramBot.sendLocation(
|
|||||||
horizontalAccuracy,
|
horizontalAccuracy,
|
||||||
heading,
|
heading,
|
||||||
proximityAlertRadius,
|
proximityAlertRadius,
|
||||||
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
replyToMessageId,
|
replyToMessageId,
|
||||||
@@ -117,9 +121,10 @@ suspend fun TelegramBot.sendLocation(
|
|||||||
horizontalAccuracy: Meters? = null,
|
horizontalAccuracy: Meters? = null,
|
||||||
heading: Degrees? = null,
|
heading: Degrees? = null,
|
||||||
proximityAlertRadius: Meters? = null,
|
proximityAlertRadius: Meters? = null,
|
||||||
|
threadId: MessageThreadId? = 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
|
||||||
) = sendLocation(
|
) = sendLocation(
|
||||||
@@ -130,6 +135,7 @@ suspend fun TelegramBot.sendLocation(
|
|||||||
horizontalAccuracy,
|
horizontalAccuracy,
|
||||||
heading,
|
heading,
|
||||||
proximityAlertRadius,
|
proximityAlertRadius,
|
||||||
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
replyToMessageId,
|
replyToMessageId,
|
||||||
@@ -149,12 +155,13 @@ suspend fun TelegramBot.sendLiveLocation(
|
|||||||
horizontalAccuracy: Meters? = null,
|
horizontalAccuracy: Meters? = null,
|
||||||
heading: Degrees? = null,
|
heading: Degrees? = null,
|
||||||
proximityAlertRadius: Meters? = null,
|
proximityAlertRadius: Meters? = null,
|
||||||
|
threadId: MessageThreadId? = 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
|
||||||
) = sendLocation(chatId, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendLocation(chatId, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -167,12 +174,13 @@ suspend fun TelegramBot.sendLiveLocation(
|
|||||||
horizontalAccuracy: Meters? = null,
|
horizontalAccuracy: Meters? = null,
|
||||||
heading: Degrees? = null,
|
heading: Degrees? = null,
|
||||||
proximityAlertRadius: Meters? = null,
|
proximityAlertRadius: Meters? = null,
|
||||||
|
threadId: MessageThreadId? = 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
|
||||||
) = sendLocation(chatId, location.latitude, location.longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendLocation(chatId, location.latitude, location.longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -186,12 +194,13 @@ suspend fun TelegramBot.sendLiveLocation(
|
|||||||
horizontalAccuracy: Meters? = null,
|
horizontalAccuracy: Meters? = null,
|
||||||
heading: Degrees? = null,
|
heading: Degrees? = null,
|
||||||
proximityAlertRadius: Meters? = null,
|
proximityAlertRadius: Meters? = null,
|
||||||
|
threadId: MessageThreadId? = 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
|
||||||
) = sendLocation(chat.id, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendLocation(chat.id, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -204,9 +213,10 @@ suspend fun TelegramBot.sendLiveLocation(
|
|||||||
horizontalAccuracy: Meters? = null,
|
horizontalAccuracy: Meters? = null,
|
||||||
heading: Degrees? = null,
|
heading: Degrees? = null,
|
||||||
proximityAlertRadius: Meters? = null,
|
proximityAlertRadius: Meters? = null,
|
||||||
|
threadId: MessageThreadId? = 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
|
||||||
) = sendLocation(chat.id, location.latitude, location.longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendLocation(chat.id, location.latitude, location.longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|||||||
@@ -2,12 +2,14 @@ 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.SendTextMessage
|
import dev.inmo.tgbotapi.requests.send.SendTextMessage
|
||||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
import dev.inmo.tgbotapi.types.*
|
||||||
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
||||||
import dev.inmo.tgbotapi.types.MessageIdentifier
|
|
||||||
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
|
||||||
|
import dev.inmo.tgbotapi.types.message.textsources.TextSource
|
||||||
|
import dev.inmo.tgbotapi.utils.EntitiesBuilderBody
|
||||||
|
import dev.inmo.tgbotapi.utils.buildEntities
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @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
|
||||||
@@ -18,13 +20,25 @@ suspend fun TelegramBot.sendMessage(
|
|||||||
text: String,
|
text: String,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
disableWebPagePreview: Boolean? = null,
|
disableWebPagePreview: Boolean? = null,
|
||||||
|
threadId: MessageThreadId? = 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(
|
||||||
SendTextMessage(chatId, text, parseMode, disableWebPagePreview, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
SendTextMessage(
|
||||||
|
chatId,
|
||||||
|
text,
|
||||||
|
parseMode,
|
||||||
|
disableWebPagePreview,
|
||||||
|
threadId,
|
||||||
|
disableNotification,
|
||||||
|
protectContent,
|
||||||
|
replyToMessageId,
|
||||||
|
allowSendingWithoutReply,
|
||||||
|
replyMarkup
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -36,32 +50,16 @@ suspend fun TelegramBot.sendTextMessage(
|
|||||||
text: String,
|
text: String,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
disableWebPagePreview: Boolean? = null,
|
disableWebPagePreview: Boolean? = null,
|
||||||
|
threadId: MessageThreadId? = 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(
|
||||||
chatId, text, parseMode, disableWebPagePreview, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
chatId, text, parseMode, disableWebPagePreview, threadId, 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.sendMessage(
|
|
||||||
chat: Chat,
|
|
||||||
text: String,
|
|
||||||
parseMode: ParseMode? = null,
|
|
||||||
disableWebPagePreview: Boolean? = null,
|
|
||||||
disableNotification: Boolean = false,
|
|
||||||
protectContent: Boolean = false,
|
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
|
||||||
replyMarkup: KeyboardMarkup? = null
|
|
||||||
) = sendMessage(chat.id, text, parseMode, disableWebPagePreview, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||||
@@ -71,12 +69,31 @@ suspend fun TelegramBot.sendTextMessage(
|
|||||||
text: String,
|
text: String,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
disableWebPagePreview: Boolean? = null,
|
disableWebPagePreview: Boolean? = null,
|
||||||
|
threadId: MessageThreadId? = 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, threadId, 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.sendMessage(
|
||||||
|
chat: Chat,
|
||||||
|
text: String,
|
||||||
|
parseMode: ParseMode? = null,
|
||||||
|
disableWebPagePreview: Boolean? = null,
|
||||||
|
threadId: MessageThreadId? = null,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null
|
||||||
|
) = sendMessage(chat.id, text, parseMode, disableWebPagePreview, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -86,15 +103,51 @@ suspend fun TelegramBot.sendMessage(
|
|||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
disableWebPagePreview: Boolean? = null,
|
disableWebPagePreview: Boolean? = null,
|
||||||
|
threadId: MessageThreadId? = 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(
|
||||||
SendTextMessage(chatId, entities, disableWebPagePreview, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
SendTextMessage(chatId, entities, disableWebPagePreview, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
|
* as a builder for that
|
||||||
|
*/
|
||||||
|
suspend fun TelegramBot.sendMessage(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
separator: TextSource? = null,
|
||||||
|
disableWebPagePreview: Boolean? = null,
|
||||||
|
threadId: MessageThreadId? = null,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null,
|
||||||
|
builderBody: EntitiesBuilderBody
|
||||||
|
) = sendMessage(chatId, buildEntities(separator, builderBody), disableWebPagePreview, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
|
* as a builder for that
|
||||||
|
*/
|
||||||
|
suspend fun TelegramBot.sendMessage(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
separator: String,
|
||||||
|
disableWebPagePreview: Boolean? = null,
|
||||||
|
threadId: MessageThreadId? = null,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null,
|
||||||
|
builderBody: EntitiesBuilderBody
|
||||||
|
) = sendMessage(chatId, buildEntities(separator, builderBody), disableWebPagePreview, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||||
@@ -103,15 +156,51 @@ suspend fun TelegramBot.sendTextMessage(
|
|||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
disableWebPagePreview: Boolean? = null,
|
disableWebPagePreview: Boolean? = null,
|
||||||
|
threadId: MessageThreadId? = 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(
|
||||||
chatId, entities, disableWebPagePreview, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
chatId, entities, disableWebPagePreview, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
|
* as a builder for that
|
||||||
|
*/
|
||||||
|
suspend fun TelegramBot.sendTextMessage(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
separator: TextSource? = null,
|
||||||
|
disableWebPagePreview: Boolean? = null,
|
||||||
|
threadId: MessageThreadId? = null,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null,
|
||||||
|
builderBody: EntitiesBuilderBody
|
||||||
|
) = sendTextMessage(chatId, buildEntities(separator, builderBody), disableWebPagePreview, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
|
* as a builder for that
|
||||||
|
*/
|
||||||
|
suspend fun TelegramBot.sendTextMessage(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
separator: String,
|
||||||
|
disableWebPagePreview: Boolean? = null,
|
||||||
|
threadId: MessageThreadId? = null,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null,
|
||||||
|
builderBody: EntitiesBuilderBody
|
||||||
|
) = sendTextMessage(chatId, buildEntities(separator, builderBody), disableWebPagePreview, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||||
@@ -120,12 +209,48 @@ suspend fun TelegramBot.sendMessage(
|
|||||||
chat: Chat,
|
chat: Chat,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
disableWebPagePreview: Boolean? = null,
|
disableWebPagePreview: Boolean? = null,
|
||||||
|
threadId: MessageThreadId? = 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, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
|
* as a builder for that
|
||||||
|
*/
|
||||||
|
suspend fun TelegramBot.sendMessage(
|
||||||
|
chat: Chat,
|
||||||
|
separator: TextSource? = null,
|
||||||
|
disableWebPagePreview: Boolean? = null,
|
||||||
|
threadId: MessageThreadId? = null,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null,
|
||||||
|
builderBody: EntitiesBuilderBody
|
||||||
|
) = sendMessage(chat, buildEntities(separator, builderBody), disableWebPagePreview, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
|
* as a builder for that
|
||||||
|
*/
|
||||||
|
suspend fun TelegramBot.sendMessage(
|
||||||
|
chat: Chat,
|
||||||
|
separator: String,
|
||||||
|
disableWebPagePreview: Boolean? = null,
|
||||||
|
threadId: MessageThreadId? = null,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null,
|
||||||
|
builderBody: EntitiesBuilderBody
|
||||||
|
) = sendMessage(chat, buildEntities(separator, builderBody), disableWebPagePreview, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -136,9 +261,45 @@ suspend fun TelegramBot.sendTextMessage(
|
|||||||
chat: Chat,
|
chat: Chat,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
disableWebPagePreview: Boolean? = null,
|
disableWebPagePreview: Boolean? = null,
|
||||||
|
threadId: MessageThreadId? = 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, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
|
* as a builder for that
|
||||||
|
*/
|
||||||
|
suspend fun TelegramBot.sendTextMessage(
|
||||||
|
chat: Chat,
|
||||||
|
separator: TextSource? = null,
|
||||||
|
disableWebPagePreview: Boolean? = null,
|
||||||
|
threadId: MessageThreadId? = null,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null,
|
||||||
|
builderBody: EntitiesBuilderBody
|
||||||
|
) = sendTextMessage(chat, buildEntities(separator, builderBody), disableWebPagePreview, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
|
* as a builder for that
|
||||||
|
*/
|
||||||
|
suspend fun TelegramBot.sendTextMessage(
|
||||||
|
chat: Chat,
|
||||||
|
separator: String,
|
||||||
|
disableWebPagePreview: Boolean? = null,
|
||||||
|
threadId: MessageThreadId? = null,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null,
|
||||||
|
builderBody: EntitiesBuilderBody
|
||||||
|
) = sendTextMessage(chat, buildEntities(separator, builderBody), disableWebPagePreview, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|||||||
@@ -3,11 +3,11 @@ 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.MessageThreadId
|
||||||
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.Location
|
import dev.inmo.tgbotapi.types.location.Location
|
||||||
import dev.inmo.tgbotapi.types.location.StaticLocation
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @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
|
||||||
@@ -17,16 +17,18 @@ suspend fun TelegramBot.sendLocation(
|
|||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
latitude: Double,
|
latitude: Double,
|
||||||
longitude: Double,
|
longitude: Double,
|
||||||
|
threadId: MessageThreadId? = null,
|
||||||
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(
|
||||||
chatId,
|
chatId,
|
||||||
latitude,
|
latitude,
|
||||||
longitude,
|
longitude,
|
||||||
|
threadId = threadId,
|
||||||
disableNotification = disableNotification,
|
disableNotification = disableNotification,
|
||||||
protectContent = protectContent,
|
protectContent = protectContent,
|
||||||
allowSendingWithoutReply = allowSendingWithoutReply,
|
allowSendingWithoutReply = allowSendingWithoutReply,
|
||||||
@@ -42,15 +44,17 @@ suspend fun TelegramBot.sendLocation(
|
|||||||
suspend fun TelegramBot.sendLocation(
|
suspend fun TelegramBot.sendLocation(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
location: Location,
|
location: Location,
|
||||||
|
threadId: MessageThreadId? = null,
|
||||||
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,
|
||||||
location.latitude,
|
location.latitude,
|
||||||
location.longitude,
|
location.longitude,
|
||||||
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
allowSendingWithoutReply,
|
allowSendingWithoutReply,
|
||||||
@@ -66,15 +70,17 @@ suspend fun TelegramBot.sendLocation(
|
|||||||
chat: Chat,
|
chat: Chat,
|
||||||
latitude: Double,
|
latitude: Double,
|
||||||
longitude: Double,
|
longitude: Double,
|
||||||
|
threadId: MessageThreadId? = null,
|
||||||
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,
|
||||||
latitude,
|
latitude,
|
||||||
longitude,
|
longitude,
|
||||||
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
allowSendingWithoutReply,
|
allowSendingWithoutReply,
|
||||||
@@ -89,15 +95,17 @@ suspend fun TelegramBot.sendLocation(
|
|||||||
suspend fun TelegramBot.sendLocation(
|
suspend fun TelegramBot.sendLocation(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
location: Location,
|
location: Location,
|
||||||
|
threadId: MessageThreadId? = null,
|
||||||
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,
|
||||||
location.latitude,
|
location.latitude,
|
||||||
location.longitude,
|
location.longitude,
|
||||||
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
allowSendingWithoutReply,
|
allowSendingWithoutReply,
|
||||||
@@ -113,12 +121,13 @@ suspend fun TelegramBot.sendStaticLocation(
|
|||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
latitude: Double,
|
latitude: Double,
|
||||||
longitude: Double,
|
longitude: Double,
|
||||||
|
threadId: MessageThreadId? = null,
|
||||||
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, threadId, disableNotification, protectContent, allowSendingWithoutReply, replyToMessageId, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -127,12 +136,13 @@ suspend fun TelegramBot.sendStaticLocation(
|
|||||||
suspend fun TelegramBot.sendStaticLocation(
|
suspend fun TelegramBot.sendStaticLocation(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
location: Location,
|
location: Location,
|
||||||
|
threadId: MessageThreadId? = null,
|
||||||
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, threadId, disableNotification, protectContent, allowSendingWithoutReply, replyToMessageId, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -142,12 +152,13 @@ suspend fun TelegramBot.sendStaticLocation(
|
|||||||
chat: Chat,
|
chat: Chat,
|
||||||
latitude: Double,
|
latitude: Double,
|
||||||
longitude: Double,
|
longitude: Double,
|
||||||
|
threadId: MessageThreadId? = null,
|
||||||
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, threadId, disableNotification, protectContent, allowSendingWithoutReply, replyToMessageId, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -156,9 +167,10 @@ suspend fun TelegramBot.sendStaticLocation(
|
|||||||
suspend fun TelegramBot.sendStaticLocation(
|
suspend fun TelegramBot.sendStaticLocation(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
location: Location,
|
location: Location,
|
||||||
|
threadId: MessageThreadId? = null,
|
||||||
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, threadId, disableNotification, protectContent, allowSendingWithoutReply, replyToMessageId, replyMarkup)
|
||||||
|
|||||||
@@ -22,9 +22,10 @@ suspend fun TelegramBot.sendVenue(
|
|||||||
foursquareType: FoursquareType? = null,
|
foursquareType: FoursquareType? = null,
|
||||||
googlePlaceId: GooglePlaceId? = null,
|
googlePlaceId: GooglePlaceId? = null,
|
||||||
googlePlaceType: GooglePlaceType? = null,
|
googlePlaceType: GooglePlaceType? = null,
|
||||||
|
threadId: MessageThreadId? = 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,6 +39,7 @@ suspend fun TelegramBot.sendVenue(
|
|||||||
foursquareType = foursquareType,
|
foursquareType = foursquareType,
|
||||||
googlePlaceId = googlePlaceId,
|
googlePlaceId = googlePlaceId,
|
||||||
googlePlaceType = googlePlaceType,
|
googlePlaceType = googlePlaceType,
|
||||||
|
threadId = threadId,
|
||||||
disableNotification = disableNotification,
|
disableNotification = disableNotification,
|
||||||
protectContent = protectContent,
|
protectContent = protectContent,
|
||||||
replyToMessageId = replyToMessageId,
|
replyToMessageId = replyToMessageId,
|
||||||
@@ -60,9 +62,10 @@ suspend fun TelegramBot.sendVenue(
|
|||||||
foursquareType: FoursquareType? = null,
|
foursquareType: FoursquareType? = null,
|
||||||
googlePlaceId: GooglePlaceId? = null,
|
googlePlaceId: GooglePlaceId? = null,
|
||||||
googlePlaceType: GooglePlaceType? = null,
|
googlePlaceType: GooglePlaceType? = null,
|
||||||
|
threadId: MessageThreadId? = 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(
|
||||||
@@ -75,6 +78,7 @@ suspend fun TelegramBot.sendVenue(
|
|||||||
foursquareType = foursquareType,
|
foursquareType = foursquareType,
|
||||||
googlePlaceId = googlePlaceId,
|
googlePlaceId = googlePlaceId,
|
||||||
googlePlaceType = googlePlaceType,
|
googlePlaceType = googlePlaceType,
|
||||||
|
threadId = threadId,
|
||||||
disableNotification = disableNotification,
|
disableNotification = disableNotification,
|
||||||
protectContent = protectContent,
|
protectContent = protectContent,
|
||||||
replyToMessageId = replyToMessageId,
|
replyToMessageId = replyToMessageId,
|
||||||
@@ -95,9 +99,10 @@ suspend fun TelegramBot.sendVenue(
|
|||||||
foursquareType: FoursquareType? = null,
|
foursquareType: FoursquareType? = null,
|
||||||
googlePlaceId: GooglePlaceId? = null,
|
googlePlaceId: GooglePlaceId? = null,
|
||||||
googlePlaceType: GooglePlaceType? = null,
|
googlePlaceType: GooglePlaceType? = null,
|
||||||
|
threadId: MessageThreadId? = 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(
|
||||||
@@ -110,6 +115,7 @@ suspend fun TelegramBot.sendVenue(
|
|||||||
foursquareType = foursquareType,
|
foursquareType = foursquareType,
|
||||||
googlePlaceId = googlePlaceId,
|
googlePlaceId = googlePlaceId,
|
||||||
googlePlaceType = googlePlaceType,
|
googlePlaceType = googlePlaceType,
|
||||||
|
threadId = threadId,
|
||||||
disableNotification = disableNotification,
|
disableNotification = disableNotification,
|
||||||
protectContent = protectContent,
|
protectContent = protectContent,
|
||||||
replyToMessageId = replyToMessageId,
|
replyToMessageId = replyToMessageId,
|
||||||
@@ -130,9 +136,10 @@ suspend fun TelegramBot.sendVenue(
|
|||||||
foursquareType: FoursquareType? = null,
|
foursquareType: FoursquareType? = null,
|
||||||
googlePlaceId: GooglePlaceId? = null,
|
googlePlaceId: GooglePlaceId? = null,
|
||||||
googlePlaceType: GooglePlaceType? = null,
|
googlePlaceType: GooglePlaceType? = null,
|
||||||
|
threadId: MessageThreadId? = 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(
|
||||||
@@ -145,6 +152,7 @@ suspend fun TelegramBot.sendVenue(
|
|||||||
foursquareType = foursquareType,
|
foursquareType = foursquareType,
|
||||||
googlePlaceId = googlePlaceId,
|
googlePlaceId = googlePlaceId,
|
||||||
googlePlaceType = googlePlaceType,
|
googlePlaceType = googlePlaceType,
|
||||||
|
threadId = threadId,
|
||||||
disableNotification = disableNotification,
|
disableNotification = disableNotification,
|
||||||
protectContent = protectContent,
|
protectContent = protectContent,
|
||||||
replyToMessageId = replyToMessageId,
|
replyToMessageId = replyToMessageId,
|
||||||
@@ -159,15 +167,17 @@ suspend fun TelegramBot.sendVenue(
|
|||||||
suspend fun TelegramBot.sendVenue(
|
suspend fun TelegramBot.sendVenue(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
venue: Venue,
|
venue: Venue,
|
||||||
|
threadId: MessageThreadId? = 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(
|
||||||
SendVenue(
|
SendVenue(
|
||||||
chatId = chatId,
|
chatId = chatId,
|
||||||
venue = venue,
|
venue = venue,
|
||||||
|
threadId = threadId,
|
||||||
disableNotification = disableNotification,
|
disableNotification = disableNotification,
|
||||||
protectContent = protectContent,
|
protectContent = protectContent,
|
||||||
replyToMessageId = replyToMessageId,
|
replyToMessageId = replyToMessageId,
|
||||||
@@ -183,14 +193,16 @@ suspend fun TelegramBot.sendVenue(
|
|||||||
suspend fun TelegramBot.sendVenue(
|
suspend fun TelegramBot.sendVenue(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
venue: Venue,
|
venue: Venue,
|
||||||
|
threadId: MessageThreadId? = 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(
|
||||||
chatId = chat.id,
|
chatId = chat.id,
|
||||||
venue = venue,
|
venue = venue,
|
||||||
|
threadId = threadId,
|
||||||
disableNotification = disableNotification,
|
disableNotification = disableNotification,
|
||||||
protectContent = protectContent,
|
protectContent = protectContent,
|
||||||
replyToMessageId = replyToMessageId,
|
replyToMessageId = replyToMessageId,
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -3,7 +3,8 @@ 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.MessageThreadId
|
||||||
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
|
||||||
@@ -15,14 +16,15 @@ import dev.inmo.tgbotapi.types.games.Game
|
|||||||
suspend fun TelegramBot.sendGame(
|
suspend fun TelegramBot.sendGame(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
gameShortName: String,
|
gameShortName: String,
|
||||||
|
threadId: MessageThreadId? = 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(
|
||||||
SendGame(
|
SendGame(
|
||||||
chatId, gameShortName, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
chatId, gameShortName, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -33,13 +35,14 @@ suspend fun TelegramBot.sendGame(
|
|||||||
suspend fun TelegramBot.sendGame(
|
suspend fun TelegramBot.sendGame(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
gameShortName: String,
|
gameShortName: String,
|
||||||
|
threadId: MessageThreadId? = 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
|
||||||
) = sendGame(
|
) = sendGame(
|
||||||
chat.id, gameShortName, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
chat.id, gameShortName, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -49,13 +52,14 @@ suspend fun TelegramBot.sendGame(
|
|||||||
suspend fun TelegramBot.sendGame(
|
suspend fun TelegramBot.sendGame(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
game: Game,
|
game: Game,
|
||||||
|
threadId: MessageThreadId? = 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
|
||||||
) = sendGame(
|
) = sendGame(
|
||||||
chatId, game.title, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
chatId, game.title, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -65,11 +69,12 @@ suspend fun TelegramBot.sendGame(
|
|||||||
suspend fun TelegramBot.sendGame(
|
suspend fun TelegramBot.sendGame(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
game: Game,
|
game: Game,
|
||||||
|
threadId: MessageThreadId? = 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
|
||||||
) = sendGame(
|
) = sendGame(
|
||||||
chat.id, game.title, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
chat.id, game.title, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -5,7 +5,8 @@ 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.MessageThreadId
|
||||||
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
|
||||||
@@ -24,9 +25,10 @@ suspend fun TelegramBot.sendAnimation(
|
|||||||
duration: Long? = null,
|
duration: Long? = null,
|
||||||
width: Int? = null,
|
width: Int? = null,
|
||||||
height: Int? = null,
|
height: Int? = null,
|
||||||
|
threadId: MessageThreadId? = 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(
|
||||||
@@ -39,6 +41,7 @@ suspend fun TelegramBot.sendAnimation(
|
|||||||
duration,
|
duration,
|
||||||
width,
|
width,
|
||||||
height,
|
height,
|
||||||
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
replyToMessageId,
|
replyToMessageId,
|
||||||
@@ -59,13 +62,14 @@ suspend fun TelegramBot.sendAnimation(
|
|||||||
duration: Long? = null,
|
duration: Long? = null,
|
||||||
width: Int? = null,
|
width: Int? = null,
|
||||||
height: Int? = null,
|
height: Int? = null,
|
||||||
|
threadId: MessageThreadId? = 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(
|
||||||
chatId, animation.fileId, animation.thumb ?.fileId, text, parseMode, duration, width, height, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
chatId, animation.fileId, animation.thumb ?.fileId, text, parseMode, duration, width, height, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -81,12 +85,13 @@ suspend fun TelegramBot.sendAnimation(
|
|||||||
duration: Long? = null,
|
duration: Long? = null,
|
||||||
width: Int? = null,
|
width: Int? = null,
|
||||||
height: Int? = null,
|
height: Int? = null,
|
||||||
|
threadId: MessageThreadId? = 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, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -100,12 +105,13 @@ suspend fun TelegramBot.sendAnimation(
|
|||||||
duration: Long? = null,
|
duration: Long? = null,
|
||||||
width: Int? = null,
|
width: Int? = null,
|
||||||
height: Int? = null,
|
height: Int? = null,
|
||||||
|
threadId: MessageThreadId? = 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, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -120,9 +126,10 @@ suspend fun TelegramBot.sendAnimation(
|
|||||||
duration: Long? = null,
|
duration: Long? = null,
|
||||||
width: Int? = null,
|
width: Int? = null,
|
||||||
height: Int? = null,
|
height: Int? = null,
|
||||||
|
threadId: MessageThreadId? = 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(
|
||||||
@@ -134,6 +141,7 @@ suspend fun TelegramBot.sendAnimation(
|
|||||||
duration,
|
duration,
|
||||||
width,
|
width,
|
||||||
height,
|
height,
|
||||||
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
replyToMessageId,
|
replyToMessageId,
|
||||||
@@ -153,13 +161,14 @@ suspend fun TelegramBot.sendAnimation(
|
|||||||
duration: Long? = null,
|
duration: Long? = null,
|
||||||
width: Int? = null,
|
width: Int? = null,
|
||||||
height: Int? = null,
|
height: Int? = null,
|
||||||
|
threadId: MessageThreadId? = 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(
|
||||||
chatId, animation.fileId, animation.thumb ?.fileId, entities, duration, width, height, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
chatId, animation.fileId, animation.thumb ?.fileId, entities, duration, width, height, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -174,12 +183,13 @@ suspend fun TelegramBot.sendAnimation(
|
|||||||
duration: Long? = null,
|
duration: Long? = null,
|
||||||
width: Int? = null,
|
width: Int? = null,
|
||||||
height: Int? = null,
|
height: Int? = null,
|
||||||
|
threadId: MessageThreadId? = 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, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -192,9 +202,10 @@ suspend fun TelegramBot.sendAnimation(
|
|||||||
duration: Long? = null,
|
duration: Long? = null,
|
||||||
width: Int? = null,
|
width: Int? = null,
|
||||||
height: Int? = null,
|
height: Int? = null,
|
||||||
|
threadId: MessageThreadId? = 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, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|||||||
@@ -5,7 +5,8 @@ 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.MessageThreadId
|
||||||
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
|
||||||
@@ -24,9 +25,10 @@ suspend fun TelegramBot.sendAudio(
|
|||||||
duration: Long? = null,
|
duration: Long? = null,
|
||||||
performer: String? = null,
|
performer: String? = null,
|
||||||
title: String? = null,
|
title: String? = null,
|
||||||
|
threadId: MessageThreadId? = 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(
|
||||||
@@ -39,6 +41,7 @@ suspend fun TelegramBot.sendAudio(
|
|||||||
duration,
|
duration,
|
||||||
performer,
|
performer,
|
||||||
title,
|
title,
|
||||||
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
replyToMessageId,
|
replyToMessageId,
|
||||||
@@ -60,12 +63,13 @@ suspend fun TelegramBot.sendAudio(
|
|||||||
duration: Long? = null,
|
duration: Long? = null,
|
||||||
performer: String? = null,
|
performer: String? = null,
|
||||||
title: String? = null,
|
title: String? = null,
|
||||||
|
threadId: MessageThreadId? = 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, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -77,12 +81,13 @@ suspend fun TelegramBot.sendAudio(
|
|||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
title: String? = audio.title,
|
title: String? = audio.title,
|
||||||
|
threadId: MessageThreadId? = 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(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, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -94,12 +99,13 @@ suspend fun TelegramBot.sendAudio(
|
|||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
title: String? = audio.title,
|
title: String? = audio.title,
|
||||||
|
threadId: MessageThreadId? = 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, text, parseMode, title, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendAudio(chat.id, audio, text, parseMode, title, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -114,9 +120,10 @@ suspend inline fun TelegramBot.sendAudio(
|
|||||||
duration: Long? = null,
|
duration: Long? = null,
|
||||||
performer: String? = null,
|
performer: String? = null,
|
||||||
title: String? = null,
|
title: String? = null,
|
||||||
|
threadId: MessageThreadId? = 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(
|
||||||
@@ -128,6 +135,7 @@ suspend inline fun TelegramBot.sendAudio(
|
|||||||
duration,
|
duration,
|
||||||
performer,
|
performer,
|
||||||
title,
|
title,
|
||||||
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
replyToMessageId,
|
replyToMessageId,
|
||||||
@@ -148,12 +156,13 @@ suspend inline fun TelegramBot.sendAudio(
|
|||||||
duration: Long? = null,
|
duration: Long? = null,
|
||||||
performer: String? = null,
|
performer: String? = null,
|
||||||
title: String? = null,
|
title: String? = null,
|
||||||
|
threadId: MessageThreadId? = 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, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -164,12 +173,13 @@ suspend inline fun TelegramBot.sendAudio(
|
|||||||
audio: AudioFile,
|
audio: AudioFile,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
title: String? = audio.title,
|
title: String? = audio.title,
|
||||||
|
threadId: MessageThreadId? = 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(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, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -180,9 +190,10 @@ suspend inline fun TelegramBot.sendAudio(
|
|||||||
audio: AudioFile,
|
audio: AudioFile,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
title: String? = audio.title,
|
title: String? = audio.title,
|
||||||
|
threadId: MessageThreadId? = 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, entities, title, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendAudio(chat.id, audio, entities, title, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|||||||
@@ -5,7 +5,8 @@ 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.MessageThreadId
|
||||||
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
|
||||||
@@ -21,9 +22,10 @@ suspend fun TelegramBot.sendDocument(
|
|||||||
thumb: InputFile? = null,
|
thumb: InputFile? = null,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
threadId: MessageThreadId? = 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
|
||||||
@@ -34,6 +36,7 @@ suspend fun TelegramBot.sendDocument(
|
|||||||
thumb,
|
thumb,
|
||||||
text,
|
text,
|
||||||
parseMode,
|
parseMode,
|
||||||
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
replyToMessageId,
|
replyToMessageId,
|
||||||
@@ -53,13 +56,14 @@ suspend fun TelegramBot.sendDocument(
|
|||||||
thumb: InputFile? = null,
|
thumb: InputFile? = null,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
threadId: MessageThreadId? = 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
|
||||||
) = sendDocument(chat.id, document, thumb, text, parseMode, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup, disableContentTypeDetection)
|
) = sendDocument(chat.id, document, thumb, text, parseMode, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup, disableContentTypeDetection)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -70,14 +74,15 @@ suspend fun TelegramBot.sendDocument(
|
|||||||
document: DocumentFile,
|
document: DocumentFile,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
threadId: MessageThreadId? = 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
|
||||||
) = sendDocument(
|
) = sendDocument(
|
||||||
chatId, document.fileId, document.thumb ?.fileId, text, parseMode, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup, disableContentTypeDetection
|
chatId, document.fileId, document.thumb ?.fileId, text, parseMode, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup, disableContentTypeDetection
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -89,13 +94,14 @@ suspend fun TelegramBot.sendDocument(
|
|||||||
document: DocumentFile,
|
document: DocumentFile,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
threadId: MessageThreadId? = 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
|
||||||
) = sendDocument(chat.id, document, text, parseMode, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup, disableContentTypeDetection)
|
) = sendDocument(chat.id, document, text, parseMode, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup, disableContentTypeDetection)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -106,9 +112,10 @@ suspend inline fun TelegramBot.sendDocument(
|
|||||||
document: InputFile,
|
document: InputFile,
|
||||||
thumb: InputFile? = null,
|
thumb: InputFile? = null,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
threadId: MessageThreadId? = 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
|
||||||
@@ -118,6 +125,7 @@ suspend inline fun TelegramBot.sendDocument(
|
|||||||
document,
|
document,
|
||||||
thumb,
|
thumb,
|
||||||
entities,
|
entities,
|
||||||
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
replyToMessageId,
|
replyToMessageId,
|
||||||
@@ -136,13 +144,14 @@ suspend inline fun TelegramBot.sendDocument(
|
|||||||
document: InputFile,
|
document: InputFile,
|
||||||
thumb: InputFile? = null,
|
thumb: InputFile? = null,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
threadId: MessageThreadId? = 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
|
||||||
) = sendDocument(chat.id, document, thumb, entities, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup, disableContentTypeDetection)
|
) = sendDocument(chat.id, document, thumb, entities, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup, disableContentTypeDetection)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -152,14 +161,15 @@ suspend inline fun TelegramBot.sendDocument(
|
|||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
document: DocumentFile,
|
document: DocumentFile,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
threadId: MessageThreadId? = 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
|
||||||
) = sendDocument(
|
) = sendDocument(
|
||||||
chatId, document.fileId, document.thumb ?.fileId, entities, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup, disableContentTypeDetection
|
chatId, document.fileId, document.thumb ?.fileId, entities, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup, disableContentTypeDetection
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -170,10 +180,11 @@ suspend inline fun TelegramBot.sendDocument(
|
|||||||
chat: Chat,
|
chat: Chat,
|
||||||
document: DocumentFile,
|
document: DocumentFile,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
threadId: MessageThreadId? = 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
|
||||||
) = sendDocument(chat.id, document, entities, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup, disableContentTypeDetection)
|
) = sendDocument(chat.id, document, entities, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup, disableContentTypeDetection)
|
||||||
|
|||||||
@@ -4,10 +4,11 @@ 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.MessageThreadId
|
||||||
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.MediaGroupPartContent
|
||||||
import dev.inmo.tgbotapi.types.message.content.VisualMediaGroupContent
|
import dev.inmo.tgbotapi.types.message.content.VisualMediaGroupPartContent
|
||||||
import dev.inmo.tgbotapi.types.message.content.AudioContent
|
import dev.inmo.tgbotapi.types.message.content.AudioContent
|
||||||
import dev.inmo.tgbotapi.types.message.content.DocumentContent
|
import dev.inmo.tgbotapi.types.message.content.DocumentContent
|
||||||
import dev.inmo.tgbotapi.utils.RiskFeature
|
import dev.inmo.tgbotapi.utils.RiskFeature
|
||||||
@@ -20,13 +21,14 @@ import kotlin.jvm.JvmName
|
|||||||
suspend fun TelegramBot.sendMediaGroup(
|
suspend fun TelegramBot.sendMediaGroup(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
media: List<MediaGroupMemberTelegramMedia>,
|
media: List<MediaGroupMemberTelegramMedia>,
|
||||||
|
threadId: MessageThreadId? = 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
|
||||||
) = execute(
|
) = execute(
|
||||||
SendMediaGroup<MediaGroupContent>(
|
SendMediaGroup<MediaGroupPartContent>(
|
||||||
chatId, media, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
chatId, media, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -37,12 +39,13 @@ suspend fun TelegramBot.sendMediaGroup(
|
|||||||
suspend fun TelegramBot.sendMediaGroup(
|
suspend fun TelegramBot.sendMediaGroup(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
media: List<MediaGroupMemberTelegramMedia>,
|
media: List<MediaGroupMemberTelegramMedia>,
|
||||||
|
threadId: MessageThreadId? = 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
|
||||||
) = sendMediaGroup(
|
) = sendMediaGroup(
|
||||||
chat.id, media, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
chat.id, media, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -52,13 +55,14 @@ suspend fun TelegramBot.sendMediaGroup(
|
|||||||
@JvmName("sendMedaGroupByContent")
|
@JvmName("sendMedaGroupByContent")
|
||||||
suspend fun TelegramBot.sendMediaGroup(
|
suspend fun TelegramBot.sendMediaGroup(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
media: List<MediaGroupContent>,
|
media: List<MediaGroupPartContent>,
|
||||||
|
threadId: MessageThreadId? = 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
|
||||||
) = sendMediaGroup(
|
) = sendMediaGroup(
|
||||||
chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -68,13 +72,14 @@ suspend fun TelegramBot.sendMediaGroup(
|
|||||||
@JvmName("sendMedaGroupByContent")
|
@JvmName("sendMedaGroupByContent")
|
||||||
suspend fun TelegramBot.sendMediaGroup(
|
suspend fun TelegramBot.sendMediaGroup(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
media: List<MediaGroupContent>,
|
media: List<MediaGroupPartContent>,
|
||||||
|
threadId: MessageThreadId? = 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
|
||||||
) = sendMediaGroup(
|
) = sendMediaGroup(
|
||||||
chat.id, media, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
chat.id, media, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -83,13 +88,14 @@ suspend fun TelegramBot.sendMediaGroup(
|
|||||||
suspend fun TelegramBot.sendPlaylist(
|
suspend fun TelegramBot.sendPlaylist(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
media: List<AudioMediaGroupMemberTelegramMedia>,
|
media: List<AudioMediaGroupMemberTelegramMedia>,
|
||||||
|
threadId: MessageThreadId? = 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
|
||||||
) = execute(
|
) = execute(
|
||||||
SendPlaylist(
|
SendPlaylist(
|
||||||
chatId, media, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
chatId, media, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -99,12 +105,13 @@ suspend fun TelegramBot.sendPlaylist(
|
|||||||
suspend fun TelegramBot.sendPlaylist(
|
suspend fun TelegramBot.sendPlaylist(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
media: List<AudioMediaGroupMemberTelegramMedia>,
|
media: List<AudioMediaGroupMemberTelegramMedia>,
|
||||||
|
threadId: MessageThreadId? = 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
|
||||||
) = sendPlaylist(
|
) = sendPlaylist(
|
||||||
chat.id, media, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
chat.id, media, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -114,12 +121,13 @@ suspend fun TelegramBot.sendPlaylist(
|
|||||||
suspend fun TelegramBot.sendPlaylist(
|
suspend fun TelegramBot.sendPlaylist(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
media: List<AudioContent>,
|
media: List<AudioContent>,
|
||||||
|
threadId: MessageThreadId? = 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
|
||||||
) = sendPlaylist(
|
) = sendPlaylist(
|
||||||
chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -129,12 +137,13 @@ suspend fun TelegramBot.sendPlaylist(
|
|||||||
suspend fun TelegramBot.sendPlaylist(
|
suspend fun TelegramBot.sendPlaylist(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
media: List<AudioContent>,
|
media: List<AudioContent>,
|
||||||
|
threadId: MessageThreadId? = 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
|
||||||
) = sendPlaylist(
|
) = sendPlaylist(
|
||||||
chat.id, media, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
chat.id, media, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -143,13 +152,14 @@ suspend fun TelegramBot.sendPlaylist(
|
|||||||
suspend fun TelegramBot.sendDocumentsGroup(
|
suspend fun TelegramBot.sendDocumentsGroup(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
media: List<DocumentMediaGroupMemberTelegramMedia>,
|
media: List<DocumentMediaGroupMemberTelegramMedia>,
|
||||||
|
threadId: MessageThreadId? = 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
|
||||||
) = execute(
|
) = execute(
|
||||||
SendDocumentsGroup(
|
SendDocumentsGroup(
|
||||||
chatId, media, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
chatId, media, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -159,12 +169,13 @@ suspend fun TelegramBot.sendDocumentsGroup(
|
|||||||
suspend fun TelegramBot.sendDocumentsGroup(
|
suspend fun TelegramBot.sendDocumentsGroup(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
media: List<DocumentMediaGroupMemberTelegramMedia>,
|
media: List<DocumentMediaGroupMemberTelegramMedia>,
|
||||||
|
threadId: MessageThreadId? = 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
|
||||||
) = sendDocumentsGroup(
|
) = sendDocumentsGroup(
|
||||||
chat.id, media, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
chat.id, media, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -174,12 +185,13 @@ suspend fun TelegramBot.sendDocumentsGroup(
|
|||||||
suspend fun TelegramBot.sendDocumentsGroup(
|
suspend fun TelegramBot.sendDocumentsGroup(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
media: List<DocumentContent>,
|
media: List<DocumentContent>,
|
||||||
|
threadId: MessageThreadId? = 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
|
||||||
) = sendDocumentsGroup(
|
) = sendDocumentsGroup(
|
||||||
chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -189,12 +201,13 @@ suspend fun TelegramBot.sendDocumentsGroup(
|
|||||||
suspend fun TelegramBot.sendDocumentsGroup(
|
suspend fun TelegramBot.sendDocumentsGroup(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
media: List<DocumentContent>,
|
media: List<DocumentContent>,
|
||||||
|
threadId: MessageThreadId? = 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
|
||||||
) = sendDocumentsGroup(
|
) = sendDocumentsGroup(
|
||||||
chat.id, media, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
chat.id, media, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -203,13 +216,14 @@ suspend fun TelegramBot.sendDocumentsGroup(
|
|||||||
suspend fun TelegramBot.sendVisualMediaGroup(
|
suspend fun TelegramBot.sendVisualMediaGroup(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
media: List<VisualMediaGroupMemberTelegramMedia>,
|
media: List<VisualMediaGroupMemberTelegramMedia>,
|
||||||
|
threadId: MessageThreadId? = 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
|
||||||
) = execute(
|
) = execute(
|
||||||
SendVisualMediaGroup(
|
SendVisualMediaGroup(
|
||||||
chatId, media, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
chatId, media, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -219,12 +233,13 @@ suspend fun TelegramBot.sendVisualMediaGroup(
|
|||||||
suspend fun TelegramBot.sendVisualMediaGroup(
|
suspend fun TelegramBot.sendVisualMediaGroup(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
media: List<VisualMediaGroupMemberTelegramMedia>,
|
media: List<VisualMediaGroupMemberTelegramMedia>,
|
||||||
|
threadId: MessageThreadId? = 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
|
||||||
) = sendVisualMediaGroup(
|
) = sendVisualMediaGroup(
|
||||||
chat.id, media, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
chat.id, media, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -233,13 +248,14 @@ suspend fun TelegramBot.sendVisualMediaGroup(
|
|||||||
@JvmName("sendVisualMediaGroupByContent")
|
@JvmName("sendVisualMediaGroupByContent")
|
||||||
suspend fun TelegramBot.sendVisualMediaGroup(
|
suspend fun TelegramBot.sendVisualMediaGroup(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
media: List<VisualMediaGroupContent>,
|
media: List<VisualMediaGroupPartContent>,
|
||||||
|
threadId: MessageThreadId? = 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
|
||||||
) = sendVisualMediaGroup(
|
) = sendVisualMediaGroup(
|
||||||
chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -248,11 +264,12 @@ suspend fun TelegramBot.sendVisualMediaGroup(
|
|||||||
@JvmName("sendVisualMediaGroupByContent")
|
@JvmName("sendVisualMediaGroupByContent")
|
||||||
suspend fun TelegramBot.sendVisualMediaGroup(
|
suspend fun TelegramBot.sendVisualMediaGroup(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
media: List<VisualMediaGroupContent>,
|
media: List<VisualMediaGroupPartContent>,
|
||||||
|
threadId: MessageThreadId? = 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
|
||||||
) = sendVisualMediaGroup(
|
) = sendVisualMediaGroup(
|
||||||
chat.id, media, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
chat.id, media, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -5,7 +5,8 @@ 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.MessageThreadId
|
||||||
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,9 +21,10 @@ suspend fun TelegramBot.sendPhoto(
|
|||||||
fileId: InputFile,
|
fileId: InputFile,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
threadId: MessageThreadId? = 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(
|
||||||
@@ -31,6 +33,7 @@ suspend fun TelegramBot.sendPhoto(
|
|||||||
fileId,
|
fileId,
|
||||||
text,
|
text,
|
||||||
parseMode,
|
parseMode,
|
||||||
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
replyToMessageId,
|
replyToMessageId,
|
||||||
@@ -48,12 +51,13 @@ suspend fun TelegramBot.sendPhoto(
|
|||||||
fileId: InputFile,
|
fileId: InputFile,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
threadId: MessageThreadId? = 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, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -64,12 +68,13 @@ suspend fun TelegramBot.sendPhoto(
|
|||||||
photo: Photo,
|
photo: Photo,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
threadId: MessageThreadId? = 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, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -80,12 +85,13 @@ suspend fun TelegramBot.sendPhoto(
|
|||||||
photo: Photo,
|
photo: Photo,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
threadId: MessageThreadId? = 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, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -96,12 +102,13 @@ suspend fun TelegramBot.sendPhoto(
|
|||||||
photoSize: PhotoSize,
|
photoSize: PhotoSize,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
threadId: MessageThreadId? = 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, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -112,12 +119,13 @@ suspend fun TelegramBot.sendPhoto(
|
|||||||
photoSize: PhotoSize,
|
photoSize: PhotoSize,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
threadId: MessageThreadId? = 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, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -128,9 +136,10 @@ suspend inline fun TelegramBot.sendPhoto(
|
|||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
fileId: InputFile,
|
fileId: InputFile,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
threadId: MessageThreadId? = 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,6 +147,7 @@ suspend inline fun TelegramBot.sendPhoto(
|
|||||||
chatId,
|
chatId,
|
||||||
fileId,
|
fileId,
|
||||||
entities,
|
entities,
|
||||||
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
replyToMessageId,
|
replyToMessageId,
|
||||||
@@ -154,12 +164,13 @@ suspend inline fun TelegramBot.sendPhoto(
|
|||||||
chat: Chat,
|
chat: Chat,
|
||||||
fileId: InputFile,
|
fileId: InputFile,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
threadId: MessageThreadId? = 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, entities, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendPhoto(chat.id, fileId, entities, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -169,12 +180,13 @@ suspend inline fun TelegramBot.sendPhoto(
|
|||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
photo: Photo,
|
photo: Photo,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
threadId: MessageThreadId? = 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"), entities, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendPhoto(chatId, photo.biggest() ?.fileId ?: error("Photo content must not be empty"), entities, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -184,12 +196,13 @@ suspend inline fun TelegramBot.sendPhoto(
|
|||||||
chat: Chat,
|
chat: Chat,
|
||||||
photo: Photo,
|
photo: Photo,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
threadId: MessageThreadId? = 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, entities, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendPhoto(chat.id, photo, entities, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -199,12 +212,13 @@ suspend inline fun TelegramBot.sendPhoto(
|
|||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
photoSize: PhotoSize,
|
photoSize: PhotoSize,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
threadId: MessageThreadId? = 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, entities, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendPhoto(chatId, photoSize.fileId, entities, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -214,9 +228,10 @@ suspend inline fun TelegramBot.sendPhoto(
|
|||||||
chat: Chat,
|
chat: Chat,
|
||||||
photoSize: PhotoSize,
|
photoSize: PhotoSize,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
threadId: MessageThreadId? = 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, entities, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendPhoto(chat.id, photoSize, entities, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|||||||
@@ -4,7 +4,8 @@ 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.MessageThreadId
|
||||||
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
|
||||||
@@ -16,13 +17,14 @@ import dev.inmo.tgbotapi.types.files.Sticker
|
|||||||
suspend fun TelegramBot.sendSticker(
|
suspend fun TelegramBot.sendSticker(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
sticker: InputFile,
|
sticker: InputFile,
|
||||||
|
threadId: MessageThreadId? = 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(
|
||||||
SendSticker(chatId, sticker, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
SendSticker(chatId, sticker, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -32,12 +34,13 @@ suspend fun TelegramBot.sendSticker(
|
|||||||
suspend fun TelegramBot.sendSticker(
|
suspend fun TelegramBot.sendSticker(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
sticker: InputFile,
|
sticker: InputFile,
|
||||||
|
threadId: MessageThreadId? = 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
|
||||||
) = sendSticker(chat.id, sticker, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendSticker(chat.id, sticker, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -46,12 +49,13 @@ suspend fun TelegramBot.sendSticker(
|
|||||||
suspend fun TelegramBot.sendSticker(
|
suspend fun TelegramBot.sendSticker(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
sticker: Sticker,
|
sticker: Sticker,
|
||||||
|
threadId: MessageThreadId? = 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
|
||||||
) = sendSticker(chatId, sticker.fileId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendSticker(chatId, sticker.fileId, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -60,9 +64,10 @@ suspend fun TelegramBot.sendSticker(
|
|||||||
suspend fun TelegramBot.sendSticker(
|
suspend fun TelegramBot.sendSticker(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
sticker: Sticker,
|
sticker: Sticker,
|
||||||
|
threadId: MessageThreadId? = 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
|
||||||
) = sendSticker(chat, sticker.fileId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendSticker(chat, sticker.fileId, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|||||||
@@ -5,7 +5,8 @@ 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.MessageThreadId
|
||||||
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
|
||||||
@@ -24,9 +25,10 @@ suspend fun TelegramBot.sendVideo(
|
|||||||
duration: Long? = null,
|
duration: Long? = null,
|
||||||
width: Int? = null,
|
width: Int? = null,
|
||||||
height: Int? = null,
|
height: Int? = null,
|
||||||
|
threadId: MessageThreadId? = 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(
|
||||||
@@ -40,6 +42,7 @@ suspend fun TelegramBot.sendVideo(
|
|||||||
width,
|
width,
|
||||||
height,
|
height,
|
||||||
null,
|
null,
|
||||||
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
replyToMessageId,
|
replyToMessageId,
|
||||||
@@ -57,12 +60,13 @@ suspend fun TelegramBot.sendVideo(
|
|||||||
video: VideoFile,
|
video: VideoFile,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
threadId: MessageThreadId? = 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, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -77,12 +81,13 @@ suspend fun TelegramBot.sendVideo(
|
|||||||
duration: Long? = null,
|
duration: Long? = null,
|
||||||
width: Int? = null,
|
width: Int? = null,
|
||||||
height: Int? = null,
|
height: Int? = null,
|
||||||
|
threadId: MessageThreadId? = 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, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -94,12 +99,13 @@ suspend fun TelegramBot.sendVideo(
|
|||||||
video: VideoFile,
|
video: VideoFile,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
threadId: MessageThreadId? = 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, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -113,9 +119,10 @@ suspend inline fun TelegramBot.sendVideo(
|
|||||||
duration: Long? = null,
|
duration: Long? = null,
|
||||||
width: Int? = null,
|
width: Int? = null,
|
||||||
height: Int? = null,
|
height: Int? = null,
|
||||||
|
threadId: MessageThreadId? = 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(
|
||||||
@@ -128,6 +135,7 @@ suspend inline fun TelegramBot.sendVideo(
|
|||||||
width,
|
width,
|
||||||
height,
|
height,
|
||||||
null,
|
null,
|
||||||
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
replyToMessageId,
|
replyToMessageId,
|
||||||
@@ -144,12 +152,13 @@ suspend inline fun TelegramBot.sendVideo(
|
|||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
video: VideoFile,
|
video: VideoFile,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
threadId: MessageThreadId? = 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, 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, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -163,12 +172,13 @@ suspend inline fun TelegramBot.sendVideo(
|
|||||||
duration: Long? = null,
|
duration: Long? = null,
|
||||||
width: Int? = null,
|
width: Int? = null,
|
||||||
height: Int? = null,
|
height: Int? = null,
|
||||||
|
threadId: MessageThreadId? = 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, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -179,9 +189,10 @@ suspend inline fun TelegramBot.sendVideo(
|
|||||||
chat: Chat,
|
chat: Chat,
|
||||||
video: VideoFile,
|
video: VideoFile,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
threadId: MessageThreadId? = 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, entities, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendVideo(chat.id, video, entities, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|||||||
@@ -4,7 +4,8 @@ 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.MessageThreadId
|
||||||
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
|
||||||
@@ -19,9 +20,10 @@ suspend fun TelegramBot.sendVideoNote(
|
|||||||
thumb: InputFile? = null,
|
thumb: InputFile? = null,
|
||||||
duration: Long? = null,
|
duration: Long? = null,
|
||||||
size: Int? = null,
|
size: Int? = null,
|
||||||
|
threadId: MessageThreadId? = 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(
|
||||||
@@ -31,6 +33,7 @@ suspend fun TelegramBot.sendVideoNote(
|
|||||||
thumb,
|
thumb,
|
||||||
duration,
|
duration,
|
||||||
size,
|
size,
|
||||||
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
replyToMessageId,
|
replyToMessageId,
|
||||||
@@ -46,13 +49,14 @@ suspend fun TelegramBot.sendVideoNote(
|
|||||||
suspend fun TelegramBot.sendVideoNote(
|
suspend fun TelegramBot.sendVideoNote(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
videoNote: VideoNoteFile,
|
videoNote: VideoNoteFile,
|
||||||
|
threadId: MessageThreadId? = 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(
|
) = sendVideoNote(
|
||||||
chatId, videoNote.fileId, videoNote.thumb ?.fileId, videoNote.duration, videoNote.width, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
chatId, videoNote.fileId, videoNote.thumb ?.fileId, videoNote.duration, videoNote.width, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -65,12 +69,13 @@ suspend fun TelegramBot.sendVideoNote(
|
|||||||
thumb: InputFile? = null,
|
thumb: InputFile? = null,
|
||||||
duration: Long? = null,
|
duration: Long? = null,
|
||||||
size: Int? = null,
|
size: Int? = null,
|
||||||
|
threadId: MessageThreadId? = 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, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -79,9 +84,10 @@ suspend fun TelegramBot.sendVideoNote(
|
|||||||
suspend fun TelegramBot.sendVideoNote(
|
suspend fun TelegramBot.sendVideoNote(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
videoNote: VideoNoteFile,
|
videoNote: VideoNoteFile,
|
||||||
|
threadId: MessageThreadId? = 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, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendVideoNote(chat.id, videoNote, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|||||||
@@ -5,7 +5,8 @@ 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.MessageThreadId
|
||||||
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
|
||||||
@@ -21,9 +22,10 @@ suspend fun TelegramBot.sendVoice(
|
|||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
duration: Long? = null,
|
duration: Long? = null,
|
||||||
|
threadId: MessageThreadId? = 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,6 +35,7 @@ suspend fun TelegramBot.sendVoice(
|
|||||||
text,
|
text,
|
||||||
parseMode,
|
parseMode,
|
||||||
duration,
|
duration,
|
||||||
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
replyToMessageId,
|
replyToMessageId,
|
||||||
@@ -51,12 +54,13 @@ suspend fun TelegramBot.sendVoice(
|
|||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
duration: Long? = null,
|
duration: Long? = null,
|
||||||
|
threadId: MessageThreadId? = 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, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -67,13 +71,14 @@ suspend fun TelegramBot.sendVoice(
|
|||||||
voice: VoiceFile,
|
voice: VoiceFile,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
threadId: MessageThreadId? = 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(
|
||||||
chatId, voice.fileId, text, parseMode, voice.duration, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
chatId, voice.fileId, text, parseMode, voice.duration, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -85,12 +90,13 @@ suspend fun TelegramBot.sendVoice(
|
|||||||
voice: VoiceFile,
|
voice: VoiceFile,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
threadId: MessageThreadId? = 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, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -102,9 +108,10 @@ suspend inline fun TelegramBot.sendVoice(
|
|||||||
voice: InputFile,
|
voice: InputFile,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
duration: Long? = null,
|
duration: Long? = null,
|
||||||
|
threadId: MessageThreadId? = 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(
|
||||||
@@ -113,6 +120,7 @@ suspend inline fun TelegramBot.sendVoice(
|
|||||||
voice,
|
voice,
|
||||||
entities,
|
entities,
|
||||||
duration,
|
duration,
|
||||||
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
replyToMessageId,
|
replyToMessageId,
|
||||||
@@ -130,12 +138,13 @@ suspend inline fun TelegramBot.sendVoice(
|
|||||||
voice: InputFile,
|
voice: InputFile,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
duration: Long? = null,
|
duration: Long? = null,
|
||||||
|
threadId: MessageThreadId? = 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, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -145,13 +154,14 @@ suspend inline fun TelegramBot.sendVoice(
|
|||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
voice: VoiceFile,
|
voice: VoiceFile,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
threadId: MessageThreadId? = 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(
|
||||||
chatId, voice.fileId, entities, voice.duration, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
chatId, voice.fileId, entities, voice.duration, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
||||||
)
|
)
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -161,9 +171,10 @@ suspend inline fun TelegramBot.sendVoice(
|
|||||||
chat: Chat,
|
chat: Chat,
|
||||||
voice: VoiceFile,
|
voice: VoiceFile,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
threadId: MessageThreadId? = 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, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendVoice(chat.id, voice, entities, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|||||||
@@ -31,13 +31,14 @@ suspend fun TelegramBot.sendInvoice(
|
|||||||
shouldSendPhoneNumberToProvider: Boolean = false,
|
shouldSendPhoneNumberToProvider: Boolean = false,
|
||||||
shouldSendEmailToProvider: Boolean = false,
|
shouldSendEmailToProvider: Boolean = false,
|
||||||
priceDependOnShipAddress: Boolean = false,
|
priceDependOnShipAddress: Boolean = false,
|
||||||
|
threadId: MessageThreadId? = 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: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
SendInvoice(chatId, title, description, payload, providerToken, currency, prices, maxTipAmount, suggestedTipAmounts ?.sorted(), startParameter, providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
SendInvoice(chatId, title, description, payload, providerToken, currency, prices, maxTipAmount, suggestedTipAmounts ?.sorted(), startParameter, providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -63,9 +64,10 @@ suspend fun TelegramBot.sendInvoice(
|
|||||||
shouldSendPhoneNumberToProvider: Boolean = false,
|
shouldSendPhoneNumberToProvider: Boolean = false,
|
||||||
shouldSendEmailToProvider: Boolean = false,
|
shouldSendEmailToProvider: Boolean = false,
|
||||||
priceDependOnShipAddress: Boolean = false,
|
priceDependOnShipAddress: Boolean = false,
|
||||||
|
threadId: MessageThreadId? = 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: 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, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|||||||
@@ -5,7 +5,8 @@ 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.MessageThreadId
|
||||||
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,14 +24,15 @@ suspend fun TelegramBot.sendRegularPoll(
|
|||||||
isClosed: Boolean = false,
|
isClosed: Boolean = false,
|
||||||
allowMultipleAnswers: Boolean = false,
|
allowMultipleAnswers: Boolean = false,
|
||||||
closeInfo: ScheduledCloseInfo? = null,
|
closeInfo: ScheduledCloseInfo? = null,
|
||||||
|
threadId: MessageThreadId? = 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(
|
||||||
SendRegularPoll(
|
SendRegularPoll(
|
||||||
chatId, question, options, isAnonymous, isClosed, allowMultipleAnswers, closeInfo, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
chatId, question, options, isAnonymous, isClosed, allowMultipleAnswers, closeInfo, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
/**
|
/**
|
||||||
@@ -46,12 +48,13 @@ suspend fun TelegramBot.sendRegularPoll(
|
|||||||
isAnonymous: Boolean = poll.isAnonymous,
|
isAnonymous: Boolean = poll.isAnonymous,
|
||||||
allowMultipleAnswers: Boolean = poll.allowMultipleAnswers,
|
allowMultipleAnswers: Boolean = poll.allowMultipleAnswers,
|
||||||
closeInfo: ScheduledCloseInfo? = null,
|
closeInfo: ScheduledCloseInfo? = null,
|
||||||
|
threadId: MessageThreadId? = 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, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -65,13 +68,14 @@ suspend fun TelegramBot.sendRegularPoll(
|
|||||||
isClosed: Boolean = false,
|
isClosed: Boolean = false,
|
||||||
allowMultipleAnswers: Boolean = false,
|
allowMultipleAnswers: Boolean = false,
|
||||||
closeInfo: ScheduledCloseInfo? = null,
|
closeInfo: ScheduledCloseInfo? = null,
|
||||||
|
threadId: MessageThreadId? = 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(
|
||||||
chat.id, question, options, isAnonymous, isClosed, allowMultipleAnswers, closeInfo, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
chat.id, question, options, isAnonymous, isClosed, allowMultipleAnswers, closeInfo, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -87,13 +91,14 @@ suspend fun TelegramBot.sendRegularPoll(
|
|||||||
isAnonymous: Boolean = poll.isAnonymous,
|
isAnonymous: Boolean = poll.isAnonymous,
|
||||||
allowMultipleAnswers: Boolean = poll.allowMultipleAnswers,
|
allowMultipleAnswers: Boolean = poll.allowMultipleAnswers,
|
||||||
closeInfo: ScheduledCloseInfo? = null,
|
closeInfo: ScheduledCloseInfo? = null,
|
||||||
|
threadId: MessageThreadId? = 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(
|
||||||
chat.id, question, options, isAnonymous, isClosed, allowMultipleAnswers, closeInfo, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
chat.id, question, options, isAnonymous, isClosed, allowMultipleAnswers, closeInfo, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@@ -111,14 +116,15 @@ suspend fun TelegramBot.sendQuizPoll(
|
|||||||
explanation: String? = null,
|
explanation: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
closeInfo: ScheduledCloseInfo? = null,
|
closeInfo: ScheduledCloseInfo? = null,
|
||||||
|
threadId: MessageThreadId? = 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(
|
||||||
SendQuizPoll(
|
SendQuizPoll(
|
||||||
chatId, question, options, correctOptionId, isAnonymous, isClosed, explanation, parseMode, closeInfo, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
chatId, question, options, correctOptionId, isAnonymous, isClosed, explanation, parseMode, closeInfo, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -136,13 +142,14 @@ suspend fun TelegramBot.sendQuizPoll(
|
|||||||
explanation: String? = null,
|
explanation: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
closeInfo: ScheduledCloseInfo? = null,
|
closeInfo: ScheduledCloseInfo? = null,
|
||||||
|
threadId: MessageThreadId? = 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(
|
||||||
chat.id, question, options, correctOptionId, isAnonymous, isClosed, explanation, parseMode, closeInfo, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
chat.id, question, options, correctOptionId, isAnonymous, isClosed, explanation, parseMode, closeInfo, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -160,13 +167,14 @@ suspend fun TelegramBot.sendQuizPoll(
|
|||||||
explanation: String? = null,
|
explanation: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
closeInfo: ScheduledCloseInfo? = null,
|
closeInfo: ScheduledCloseInfo? = null,
|
||||||
|
threadId: MessageThreadId? = 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(
|
||||||
chatId, question, options, correctOptionId, isAnonymous, isClosed, explanation, parseMode, closeInfo, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
chatId, question, options, correctOptionId, isAnonymous, isClosed, explanation, parseMode, closeInfo, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -184,13 +192,14 @@ suspend fun TelegramBot.sendQuizPoll(
|
|||||||
explanation: String? = null,
|
explanation: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
closeInfo: ScheduledCloseInfo? = null,
|
closeInfo: ScheduledCloseInfo? = null,
|
||||||
|
threadId: MessageThreadId? = 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(
|
||||||
chat.id, question, options, correctOptionId, isAnonymous, isClosed, explanation, parseMode, closeInfo, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
chat.id, question, options, correctOptionId, isAnonymous, isClosed, explanation, parseMode, closeInfo, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@@ -207,14 +216,15 @@ suspend inline fun TelegramBot.sendQuizPoll(
|
|||||||
isClosed: Boolean = false,
|
isClosed: Boolean = false,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
closeInfo: ScheduledCloseInfo? = null,
|
closeInfo: ScheduledCloseInfo? = null,
|
||||||
|
threadId: MessageThreadId? = 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(
|
||||||
SendQuizPoll(
|
SendQuizPoll(
|
||||||
chatId, question, options, correctOptionId, isAnonymous, isClosed, entities, closeInfo, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
chatId, question, options, correctOptionId, isAnonymous, isClosed, entities, closeInfo, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -231,13 +241,14 @@ suspend inline fun TelegramBot.sendQuizPoll(
|
|||||||
isClosed: Boolean = false,
|
isClosed: Boolean = false,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
closeInfo: ScheduledCloseInfo? = null,
|
closeInfo: ScheduledCloseInfo? = null,
|
||||||
|
threadId: MessageThreadId? = 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(
|
||||||
chat.id, question, options, correctOptionId, isAnonymous, isClosed, entities, closeInfo, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
chat.id, question, options, correctOptionId, isAnonymous, isClosed, entities, closeInfo, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -254,13 +265,14 @@ suspend inline fun TelegramBot.sendQuizPoll(
|
|||||||
isAnonymous: Boolean = quizPoll.isAnonymous,
|
isAnonymous: Boolean = quizPoll.isAnonymous,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
closeInfo: ScheduledCloseInfo? = null,
|
closeInfo: ScheduledCloseInfo? = null,
|
||||||
|
threadId: MessageThreadId? = 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(
|
||||||
chatId, question, options, correctOptionId, isAnonymous, isClosed, entities, closeInfo, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
chatId, question, options, correctOptionId, isAnonymous, isClosed, entities, closeInfo, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -277,11 +289,12 @@ suspend inline fun TelegramBot.sendQuizPoll(
|
|||||||
isAnonymous: Boolean = quizPoll.isAnonymous,
|
isAnonymous: Boolean = quizPoll.isAnonymous,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
closeInfo: ScheduledCloseInfo? = null,
|
closeInfo: ScheduledCloseInfo? = null,
|
||||||
|
threadId: MessageThreadId? = 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(
|
||||||
chat.id, question, options, correctOptionId, isAnonymous, isClosed, entities, closeInfo, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
chat.id, question, options, correctOptionId, isAnonymous, isClosed, entities, closeInfo, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -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
|
||||||
|
)
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.api.utils
|
package dev.inmo.tgbotapi.extensions.api.utils
|
||||||
|
|
||||||
import dev.inmo.tgbotapi.extensions.api.InternalUtils.convertWithMediaGroupUpdates
|
import dev.inmo.tgbotapi.extensions.api.InternalUtils.convertWithMediaGroupUpdates
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.MediaGroupMessage
|
import dev.inmo.tgbotapi.types.message.abstracts.PossiblySentViaBotCommonMessage
|
||||||
import dev.inmo.tgbotapi.types.update.abstracts.BaseMessageUpdate
|
import dev.inmo.tgbotapi.types.update.abstracts.BaseMessageUpdate
|
||||||
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
||||||
import dev.inmo.tgbotapi.updateshandlers.UpdateReceiver
|
import dev.inmo.tgbotapi.updateshandlers.UpdateReceiver
|
||||||
@@ -30,10 +30,21 @@ fun CoroutineScope.updateHandlerWithMediaGroupsAdaptation(
|
|||||||
launch {
|
launch {
|
||||||
launch {
|
launch {
|
||||||
for (update in updatesChannel) {
|
for (update in updatesChannel) {
|
||||||
when (val data = update.data) {
|
val dataAsPossiblySentViaBotCommonMessage = update.data as? PossiblySentViaBotCommonMessage<*>
|
||||||
is MediaGroupMessage<*> -> mediaGroupChannel.send("${data.mediaGroupId}${update::class.simpleName}" to update as BaseMessageUpdate)
|
|
||||||
else -> output(update)
|
if (dataAsPossiblySentViaBotCommonMessage == null) {
|
||||||
|
output(update)
|
||||||
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val mediaGroupId = dataAsPossiblySentViaBotCommonMessage.mediaGroupId
|
||||||
|
|
||||||
|
if (mediaGroupId == null) {
|
||||||
|
output(update)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
mediaGroupChannel.send("${mediaGroupId}${update::class.simpleName}" to update as BaseMessageUpdate)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
launch {
|
launch {
|
||||||
|
|||||||
@@ -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(
|
||||||
|
|||||||
@@ -0,0 +1,126 @@
|
|||||||
|
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.BotCommand
|
||||||
|
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)
|
||||||
|
|
||||||
|
suspend fun BehaviourContext.waitCommandMessage(
|
||||||
|
botCommand: BotCommand,
|
||||||
|
initRequest: Request<*>? = null,
|
||||||
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
|
) = waitCommandMessage(botCommand.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)
|
||||||
|
}
|
||||||
@@ -66,12 +66,12 @@ suspend fun BehaviourContext.waitAudioMediaGroupContent(
|
|||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null },
|
errorFactory: NullableRequestBuilder<*> = { null },
|
||||||
includeMediaGroups: Boolean = true
|
includeMediaGroups: Boolean = true
|
||||||
) = waitContent<AudioMediaGroupContent>(initRequest, includeMediaGroups, errorFactory)
|
) = waitContent<AudioMediaGroupPartContent>(initRequest, includeMediaGroups, errorFactory)
|
||||||
suspend fun BehaviourContext.waitDocumentMediaGroupContent(
|
suspend fun BehaviourContext.waitDocumentMediaGroupContent(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null },
|
errorFactory: NullableRequestBuilder<*> = { null },
|
||||||
includeMediaGroups: Boolean = true
|
includeMediaGroups: Boolean = true
|
||||||
) = waitContent<DocumentMediaGroupContent>(initRequest, includeMediaGroups, errorFactory)
|
) = waitContent<DocumentMediaGroupPartContent>(initRequest, includeMediaGroups, errorFactory)
|
||||||
suspend fun BehaviourContext.waitMedia(
|
suspend fun BehaviourContext.waitMedia(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null },
|
errorFactory: NullableRequestBuilder<*> = { null },
|
||||||
@@ -81,12 +81,12 @@ suspend fun BehaviourContext.waitAnyMediaGroupContent(
|
|||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null },
|
errorFactory: NullableRequestBuilder<*> = { null },
|
||||||
includeMediaGroups: Boolean = true
|
includeMediaGroups: Boolean = true
|
||||||
) = waitContent<MediaGroupContent>(initRequest, includeMediaGroups, errorFactory)
|
) = waitContent<MediaGroupPartContent>(initRequest, includeMediaGroups, errorFactory)
|
||||||
suspend fun BehaviourContext.waitVisualMediaGroupContent(
|
suspend fun BehaviourContext.waitVisualMediaGroupContent(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null },
|
errorFactory: NullableRequestBuilder<*> = { null },
|
||||||
includeMediaGroups: Boolean = true
|
includeMediaGroups: Boolean = true
|
||||||
) = waitContent<VisualMediaGroupContent>(initRequest, includeMediaGroups, errorFactory)
|
) = waitContent<VisualMediaGroupPartContent>(initRequest, includeMediaGroups, errorFactory)
|
||||||
suspend fun BehaviourContext.waitTextedMediaContent(
|
suspend fun BehaviourContext.waitTextedMediaContent(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null },
|
errorFactory: NullableRequestBuilder<*> = { null },
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ 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.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
|
||||||
@@ -25,20 +24,7 @@ suspend inline fun <reified O : MessageContent> BehaviourContext.waitContentMess
|
|||||||
initRequest,
|
initRequest,
|
||||||
errorFactory
|
errorFactory
|
||||||
) {
|
) {
|
||||||
val messages = when (it) {
|
listOfNotNull((it.data as? CommonMessage<*>) ?.withContent<O>())
|
||||||
is SentMediaGroupUpdate -> {
|
|
||||||
if (includeMediaGroups) {
|
|
||||||
it.data
|
|
||||||
} else {
|
|
||||||
emptyList()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
is BaseSentMessageUpdate -> listOf(it.data)
|
|
||||||
else -> return@expectFlow emptyList()
|
|
||||||
}
|
|
||||||
messages.mapNotNull { message ->
|
|
||||||
(message as? CommonMessage<*>) ?.withContent<O>()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
internal inline fun <reified T : MessageContent> contentMessageConverter(
|
internal inline fun <reified T : MessageContent> contentMessageConverter(
|
||||||
@@ -103,12 +89,12 @@ suspend fun BehaviourContext.waitAudioMediaGroupContentMessage(
|
|||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null },
|
errorFactory: NullableRequestBuilder<*> = { null },
|
||||||
includeMediaGroups: Boolean = true
|
includeMediaGroups: Boolean = true
|
||||||
) = waitContentMessage<AudioMediaGroupContent>(initRequest, includeMediaGroups, errorFactory)
|
) = waitContentMessage<AudioMediaGroupPartContent>(initRequest, includeMediaGroups, errorFactory)
|
||||||
suspend fun BehaviourContext.waitDocumentMediaGroupContentMessage(
|
suspend fun BehaviourContext.waitDocumentMediaGroupContentMessage(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null },
|
errorFactory: NullableRequestBuilder<*> = { null },
|
||||||
includeMediaGroups: Boolean = true
|
includeMediaGroups: Boolean = true
|
||||||
) = waitContentMessage<DocumentMediaGroupContent>(initRequest, includeMediaGroups, errorFactory)
|
) = waitContentMessage<DocumentMediaGroupPartContent>(initRequest, includeMediaGroups, errorFactory)
|
||||||
suspend fun BehaviourContext.waitMediaMessage(
|
suspend fun BehaviourContext.waitMediaMessage(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null },
|
errorFactory: NullableRequestBuilder<*> = { null },
|
||||||
@@ -118,12 +104,12 @@ suspend fun BehaviourContext.waitAnyMediaGroupContentMessage(
|
|||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null },
|
errorFactory: NullableRequestBuilder<*> = { null },
|
||||||
includeMediaGroups: Boolean = true
|
includeMediaGroups: Boolean = true
|
||||||
) = waitContentMessage<MediaGroupContent>(initRequest, includeMediaGroups, errorFactory)
|
) = waitContentMessage<MediaGroupPartContent>(initRequest, includeMediaGroups, errorFactory)
|
||||||
suspend fun BehaviourContext.waitVisualMediaGroupContentMessage(
|
suspend fun BehaviourContext.waitVisualMediaGroupContentMessage(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null },
|
errorFactory: NullableRequestBuilder<*> = { null },
|
||||||
includeMediaGroups: Boolean = true
|
includeMediaGroups: Boolean = true
|
||||||
) = waitContentMessage<VisualMediaGroupContent>(initRequest, includeMediaGroups, errorFactory)
|
) = waitContentMessage<VisualMediaGroupPartContent>(initRequest, includeMediaGroups, errorFactory)
|
||||||
suspend fun BehaviourContext.waitTextedMediaContentMessage(
|
suspend fun BehaviourContext.waitTextedMediaContentMessage(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null },
|
errorFactory: NullableRequestBuilder<*> = { null },
|
||||||
|
|||||||
@@ -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)
|
||||||
|
}
|
||||||
@@ -15,7 +15,7 @@ suspend inline fun <reified O : MessageContent> BehaviourContext.waitEditedConte
|
|||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
includeMediaGroups: Boolean = true,
|
includeMediaGroups: Boolean = true,
|
||||||
noinline errorFactory: NullableRequestBuilder<*> = { null }
|
noinline errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
): Flow<O> = waitEditedContentMessage<O>(initRequest, includeMediaGroups, errorFactory).map { it.content }
|
): Flow<O> = waitEditedContentMessage<O>(initRequest, errorFactory).map { it.content }
|
||||||
|
|
||||||
suspend fun BehaviourContext.waitEditedMessageContent(
|
suspend fun BehaviourContext.waitEditedMessageContent(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
@@ -64,12 +64,12 @@ suspend fun BehaviourContext.waitEditedAudioMediaGroupContent(
|
|||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null },
|
errorFactory: NullableRequestBuilder<*> = { null },
|
||||||
includeMediaGroups: Boolean = true
|
includeMediaGroups: Boolean = true
|
||||||
) = waitEditedContent<AudioMediaGroupContent>(initRequest, includeMediaGroups, errorFactory)
|
) = waitEditedContent<AudioMediaGroupPartContent>(initRequest, includeMediaGroups, errorFactory)
|
||||||
suspend fun BehaviourContext.waitEditedDocumentMediaGroupContent(
|
suspend fun BehaviourContext.waitEditedDocumentMediaGroupContent(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null },
|
errorFactory: NullableRequestBuilder<*> = { null },
|
||||||
includeMediaGroups: Boolean = true
|
includeMediaGroups: Boolean = true
|
||||||
) = waitEditedContent<DocumentMediaGroupContent>(initRequest, includeMediaGroups, errorFactory)
|
) = waitEditedContent<DocumentMediaGroupPartContent>(initRequest, includeMediaGroups, errorFactory)
|
||||||
suspend fun BehaviourContext.waitEditedMedia(
|
suspend fun BehaviourContext.waitEditedMedia(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null },
|
errorFactory: NullableRequestBuilder<*> = { null },
|
||||||
@@ -79,12 +79,12 @@ suspend fun BehaviourContext.waitEditedAnyMediaGroupContent(
|
|||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null },
|
errorFactory: NullableRequestBuilder<*> = { null },
|
||||||
includeMediaGroups: Boolean = true
|
includeMediaGroups: Boolean = true
|
||||||
) = waitEditedContent<MediaGroupContent>(initRequest, includeMediaGroups, errorFactory)
|
) = waitEditedContent<MediaGroupPartContent>(initRequest, includeMediaGroups, errorFactory)
|
||||||
suspend fun BehaviourContext.waitEditedVisualMediaGroupContent(
|
suspend fun BehaviourContext.waitEditedVisualMediaGroupContent(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null },
|
errorFactory: NullableRequestBuilder<*> = { null },
|
||||||
includeMediaGroups: Boolean = true
|
includeMediaGroups: Boolean = true
|
||||||
) = waitEditedContent<VisualMediaGroupContent>(initRequest, includeMediaGroups, errorFactory)
|
) = waitEditedContent<VisualMediaGroupPartContent>(initRequest, includeMediaGroups, errorFactory)
|
||||||
suspend fun BehaviourContext.waitEditedTextedMediaContent(
|
suspend fun BehaviourContext.waitEditedTextedMediaContent(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null },
|
errorFactory: NullableRequestBuilder<*> = { null },
|
||||||
|
|||||||
@@ -3,11 +3,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.utils.baseEditMessageUpdateOrNull
|
||||||
import dev.inmo.tgbotapi.extensions.utils.commonMessageOrNull
|
import dev.inmo.tgbotapi.extensions.utils.commonMessageOrNull
|
||||||
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.content.*
|
import dev.inmo.tgbotapi.types.message.content.*
|
||||||
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
|
||||||
@@ -17,7 +17,6 @@ import kotlinx.coroutines.flow.Flow
|
|||||||
@RiskFeature(lowLevelRiskFeatureMessage)
|
@RiskFeature(lowLevelRiskFeatureMessage)
|
||||||
suspend inline fun <reified O : MessageContent> BehaviourContext.waitEditedContentMessage(
|
suspend inline fun <reified O : MessageContent> BehaviourContext.waitEditedContentMessage(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
includeMediaGroups: Boolean = true,
|
|
||||||
noinline errorFactory: NullableRequestBuilder<*> = { null }
|
noinline errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
): Flow<CommonMessage<O>> = expectFlow(
|
): Flow<CommonMessage<O>> = expectFlow(
|
||||||
initRequest,
|
initRequest,
|
||||||
@@ -26,11 +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.commonMessageOrNull() ?: return@expectFlow emptyList()
|
val commonMessage = it.data.commonMessageOrNull() ?: return@expectFlow emptyList()
|
||||||
if (commonMessage !is MediaGroupMessage<*> || includeMediaGroups) {
|
listOf(commonMessage)
|
||||||
listOf(commonMessage)
|
|
||||||
} else {
|
|
||||||
emptyList()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else -> return@expectFlow emptyList()
|
else -> return@expectFlow emptyList()
|
||||||
}
|
}
|
||||||
@@ -41,109 +36,103 @@ suspend inline fun <reified O : MessageContent> BehaviourContext.waitEditedConte
|
|||||||
|
|
||||||
suspend fun BehaviourContext.waitEditedMessageContentMessage(
|
suspend fun BehaviourContext.waitEditedMessageContentMessage(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null },
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
includeMediaGroups: Boolean = true
|
) = waitEditedContentMessage<MessageContent>(initRequest, errorFactory)
|
||||||
) = waitEditedContentMessage<MessageContent>(initRequest, includeMediaGroups, errorFactory)
|
|
||||||
|
|
||||||
suspend fun BehaviourContext.waitEditedContactMessage(
|
suspend fun BehaviourContext.waitEditedContactMessage(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
) = waitEditedContentMessage<ContactContent>(initRequest, false, errorFactory)
|
) = waitEditedContentMessage<ContactContent>(initRequest, errorFactory)
|
||||||
suspend fun BehaviourContext.waitEditedDiceMessage(
|
suspend fun BehaviourContext.waitEditedDiceMessage(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
) = waitEditedContentMessage<DiceContent>(initRequest, false, errorFactory)
|
) = waitEditedContentMessage<DiceContent>(initRequest, errorFactory)
|
||||||
suspend fun BehaviourContext.waitEditedGameMessage(
|
suspend fun BehaviourContext.waitEditedGameMessage(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
) = waitEditedContentMessage<GameContent>(initRequest, false, errorFactory)
|
) = waitEditedContentMessage<GameContent>(initRequest, errorFactory)
|
||||||
suspend fun BehaviourContext.waitEditedLocationMessage(
|
suspend fun BehaviourContext.waitEditedLocationMessage(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
) = waitEditedContentMessage<LocationContent>(initRequest, false, errorFactory)
|
) = waitEditedContentMessage<LocationContent>(initRequest, errorFactory)
|
||||||
suspend fun BehaviourContext.waitEditedLiveLocationMessage(
|
suspend fun BehaviourContext.waitEditedLiveLocationMessage(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
) = waitEditedContentMessage<LiveLocationContent>(initRequest, false, errorFactory)
|
) = waitEditedContentMessage<LiveLocationContent>(initRequest, errorFactory)
|
||||||
suspend fun BehaviourContext.waitEditedStaticLocationMessage(
|
suspend fun BehaviourContext.waitEditedStaticLocationMessage(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
) = waitEditedContentMessage<StaticLocationContent>(initRequest, false, errorFactory)
|
) = waitEditedContentMessage<StaticLocationContent>(initRequest, errorFactory)
|
||||||
suspend fun BehaviourContext.waitEditedTextMessage(
|
suspend fun BehaviourContext.waitEditedTextMessage(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
) = waitEditedContentMessage<TextContent>(initRequest, false, errorFactory)
|
) = waitEditedContentMessage<TextContent>(initRequest, errorFactory)
|
||||||
suspend fun BehaviourContext.waitEditedVenueMessage(
|
suspend fun BehaviourContext.waitEditedVenueMessage(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
) = waitEditedContentMessage<VenueContent>(initRequest, false, errorFactory)
|
) = waitEditedContentMessage<VenueContent>(initRequest, errorFactory)
|
||||||
suspend fun BehaviourContext.waitEditedAudioMediaGroupContentMessage(
|
suspend fun BehaviourContext.waitEditedAudioMediaGroupContentMessage(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null },
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
includeMediaGroups: Boolean = true
|
) = waitEditedContentMessage<AudioMediaGroupPartContent>(initRequest, errorFactory)
|
||||||
) = waitEditedContentMessage<AudioMediaGroupContent>(initRequest, includeMediaGroups, errorFactory)
|
|
||||||
suspend fun BehaviourContext.waitEditedDocumentMediaGroupContentMessage(
|
suspend fun BehaviourContext.waitEditedDocumentMediaGroupContentMessage(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null },
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
includeMediaGroups: Boolean = true
|
) = waitEditedContentMessage<DocumentMediaGroupPartContent>(initRequest, errorFactory)
|
||||||
) = waitEditedContentMessage<DocumentMediaGroupContent>(initRequest, includeMediaGroups, errorFactory)
|
|
||||||
suspend fun BehaviourContext.waitEditedMediaMessage(
|
suspend fun BehaviourContext.waitEditedMediaMessage(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null },
|
errorFactory: NullableRequestBuilder<*> = { null },
|
||||||
includeMediaGroups: Boolean = false
|
includeMediaGroups: Boolean = false
|
||||||
) = waitEditedContentMessage<MediaContent>(initRequest, includeMediaGroups, errorFactory)
|
) = waitEditedContentMessage<MediaContent>(initRequest, errorFactory)
|
||||||
suspend fun BehaviourContext.waitEditedAnyMediaGroupContentMessage(
|
suspend fun BehaviourContext.waitEditedAnyMediaGroupContentMessage(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null },
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
includeMediaGroups: Boolean = true
|
) = waitEditedContentMessage<MediaGroupPartContent>(initRequest, errorFactory)
|
||||||
) = waitEditedContentMessage<MediaGroupContent>(initRequest, includeMediaGroups, errorFactory)
|
|
||||||
suspend fun BehaviourContext.waitEditedVisualMediaGroupContentMessage(
|
suspend fun BehaviourContext.waitEditedVisualMediaGroupContentMessage(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null },
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
includeMediaGroups: Boolean = true
|
) = waitEditedContentMessage<VisualMediaGroupPartContent>(initRequest, errorFactory)
|
||||||
) = waitEditedContentMessage<VisualMediaGroupContent>(initRequest, includeMediaGroups, errorFactory)
|
|
||||||
suspend fun BehaviourContext.waitEditedTextedMediaContentMessage(
|
suspend fun BehaviourContext.waitEditedTextedMediaContentMessage(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null },
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
includeMediaGroups: Boolean = true
|
) = waitEditedContentMessage<TextedMediaContent>(initRequest, errorFactory)
|
||||||
) = waitEditedContentMessage<TextedMediaContent>(initRequest, includeMediaGroups, errorFactory)
|
|
||||||
suspend fun BehaviourContext.waitEditedAnimationMessage(
|
suspend fun BehaviourContext.waitEditedAnimationMessage(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
) = waitEditedContentMessage<AnimationContent>(initRequest, false, errorFactory)
|
) = waitEditedContentMessage<AnimationContent>(initRequest, errorFactory)
|
||||||
suspend fun BehaviourContext.waitEditedAudioMessage(
|
suspend fun BehaviourContext.waitEditedAudioMessage(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null },
|
errorFactory: NullableRequestBuilder<*> = { null },
|
||||||
includeMediaGroups: Boolean = false
|
includeMediaGroups: Boolean = false
|
||||||
) = waitEditedContentMessage<AudioContent>(initRequest, includeMediaGroups, errorFactory)
|
) = waitEditedContentMessage<AudioContent>(initRequest, errorFactory)
|
||||||
suspend fun BehaviourContext.waitEditedDocumentMessage(
|
suspend fun BehaviourContext.waitEditedDocumentMessage(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null },
|
errorFactory: NullableRequestBuilder<*> = { null },
|
||||||
includeMediaGroups: Boolean = false
|
includeMediaGroups: Boolean = false
|
||||||
) = waitEditedContentMessage<DocumentContent>(initRequest, includeMediaGroups, errorFactory)
|
) = waitEditedContentMessage<DocumentContent>(initRequest, errorFactory)
|
||||||
suspend fun BehaviourContext.waitEditedPhotoMessage(
|
suspend fun BehaviourContext.waitEditedPhotoMessage(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null },
|
errorFactory: NullableRequestBuilder<*> = { null },
|
||||||
includeMediaGroups: Boolean = false
|
includeMediaGroups: Boolean = false
|
||||||
) = waitEditedContentMessage<PhotoContent>(initRequest, includeMediaGroups, errorFactory)
|
) = waitEditedContentMessage<PhotoContent>(initRequest, errorFactory)
|
||||||
suspend fun BehaviourContext.waitEditedStickerMessage(
|
suspend fun BehaviourContext.waitEditedStickerMessage(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
) = waitEditedContentMessage<StickerContent>(initRequest, false, errorFactory)
|
) = waitEditedContentMessage<StickerContent>(initRequest, errorFactory)
|
||||||
suspend fun BehaviourContext.waitEditedVideoMessage(
|
suspend fun BehaviourContext.waitEditedVideoMessage(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null },
|
errorFactory: NullableRequestBuilder<*> = { null },
|
||||||
includeMediaGroups: Boolean = false
|
includeMediaGroups: Boolean = false
|
||||||
) = waitEditedContentMessage<VideoContent>(initRequest, includeMediaGroups, errorFactory)
|
) = waitEditedContentMessage<VideoContent>(initRequest, errorFactory)
|
||||||
suspend fun BehaviourContext.waitEditedVideoNoteMessage(
|
suspend fun BehaviourContext.waitEditedVideoNoteMessage(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
) = waitEditedContentMessage<VideoNoteContent>(initRequest, false, errorFactory)
|
) = waitEditedContentMessage<VideoNoteContent>(initRequest, errorFactory)
|
||||||
suspend fun BehaviourContext.waitEditedVoiceMessage(
|
suspend fun BehaviourContext.waitEditedVoiceMessage(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
) = waitEditedContentMessage<VoiceContent>(initRequest, false, errorFactory)
|
) = waitEditedContentMessage<VoiceContent>(initRequest, errorFactory)
|
||||||
suspend fun BehaviourContext.waitEditedInvoiceMessage(
|
suspend fun BehaviourContext.waitEditedInvoiceMessage(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
) = waitEditedContentMessage<InvoiceContent>(initRequest, false, errorFactory)
|
) = waitEditedContentMessage<InvoiceContent>(initRequest, errorFactory)
|
||||||
|
|||||||
@@ -7,6 +7,9 @@ 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.forum.ForumTopicClosed
|
||||||
|
import dev.inmo.tgbotapi.types.message.ChatEvents.forum.ForumTopicCreated
|
||||||
|
import dev.inmo.tgbotapi.types.message.ChatEvents.forum.ForumTopicReopened
|
||||||
import dev.inmo.tgbotapi.types.message.ChatEvents.voice.*
|
import dev.inmo.tgbotapi.types.message.ChatEvents.voice.*
|
||||||
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
|
||||||
@@ -136,3 +139,15 @@ suspend fun BehaviourContext.waitWebAppDataEvents(
|
|||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
) = waitEvents<WebAppData>(initRequest, errorFactory)
|
) = waitEvents<WebAppData>(initRequest, errorFactory)
|
||||||
|
suspend fun BehaviourContext.waitForumTopicClosed(
|
||||||
|
initRequest: Request<*>? = null,
|
||||||
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
|
) = waitEvents<ForumTopicClosed>(initRequest, errorFactory)
|
||||||
|
suspend fun BehaviourContext.waitForumTopicCreated(
|
||||||
|
initRequest: Request<*>? = null,
|
||||||
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
|
) = waitEvents<ForumTopicCreated>(initRequest, errorFactory)
|
||||||
|
suspend fun BehaviourContext.waitForumTopicReopened(
|
||||||
|
initRequest: Request<*>? = null,
|
||||||
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
|
) = waitEvents<ForumTopicReopened>(initRequest, errorFactory)
|
||||||
|
|||||||
@@ -7,6 +7,9 @@ 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.forum.ForumTopicClosed
|
||||||
|
import dev.inmo.tgbotapi.types.message.ChatEvents.forum.ForumTopicCreated
|
||||||
|
import dev.inmo.tgbotapi.types.message.ChatEvents.forum.ForumTopicReopened
|
||||||
import dev.inmo.tgbotapi.types.message.ChatEvents.voice.*
|
import dev.inmo.tgbotapi.types.message.ChatEvents.voice.*
|
||||||
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
|
||||||
@@ -133,3 +136,15 @@ suspend fun BehaviourContext.waitWebAppDataEventsMessages(
|
|||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
) = waitEventsMessages<WebAppData>(initRequest, errorFactory)
|
) = waitEventsMessages<WebAppData>(initRequest, errorFactory)
|
||||||
|
suspend fun BehaviourContext.waitForumTopicClosedEventsMessages(
|
||||||
|
initRequest: Request<*>? = null,
|
||||||
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
|
) = waitEventsMessages<ForumTopicClosed>(initRequest, errorFactory)
|
||||||
|
suspend fun BehaviourContext.waitForumTopicCreatedEventsMessages(
|
||||||
|
initRequest: Request<*>? = null,
|
||||||
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
|
) = waitEventsMessages<ForumTopicCreated>(initRequest, errorFactory)
|
||||||
|
suspend fun BehaviourContext.waitForumTopicReopenedEventsMessages(
|
||||||
|
initRequest: Request<*>? = null,
|
||||||
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
|
) = waitEventsMessages<ForumTopicReopened>(initRequest, errorFactory)
|
||||||
|
|||||||
@@ -1,40 +1,46 @@
|
|||||||
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.baseSentMessageUpdateOrNull
|
||||||
|
import dev.inmo.tgbotapi.extensions.utils.commonMessageOrNull
|
||||||
|
import dev.inmo.tgbotapi.extensions.utils.withContent
|
||||||
|
import dev.inmo.tgbotapi.extensions.utils.withContentOrNull
|
||||||
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.content.*
|
import dev.inmo.tgbotapi.types.message.content.*
|
||||||
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.map
|
|
||||||
|
|
||||||
typealias MediaGroupFilter<T> = SimpleFilter<List<MediaGroupMessage<T>>>
|
|
||||||
|
|
||||||
|
|
||||||
@RiskFeature(lowLevelRiskFeatureMessage)
|
@RiskFeature(lowLevelRiskFeatureMessage)
|
||||||
suspend inline fun <reified O : MediaGroupContent> BehaviourContext.buildMediaGroupWaiter(
|
suspend inline fun <reified T : MediaGroupPartContent> BehaviourContext.buildMediaGroupWaiter(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
noinline errorFactory: NullableRequestBuilder<*> = { null }
|
noinline errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
): Flow<List<O>> = buildMediaGroupMessagesWaiter<O>(initRequest, errorFactory).map { it.map { it.content } }
|
): Flow<MediaGroupContent<T>> = flowsUpdatesFilter.expectFlow(bot, initRequest, errorFactory) { update ->
|
||||||
|
update.baseSentMessageUpdateOrNull() ?.data ?.commonMessageOrNull() ?.withContentOrNull<MediaGroupContent<*>>() ?.let { message ->
|
||||||
|
if (message.content.group.all { it is T }) {
|
||||||
|
listOf(message.content as MediaGroupContent<T>)
|
||||||
|
} else {
|
||||||
|
null
|
||||||
|
}
|
||||||
|
} ?: emptyList()
|
||||||
|
}
|
||||||
|
|
||||||
suspend fun BehaviourContext.waitMediaGroup(
|
suspend fun BehaviourContext.waitMediaGroup(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
) = buildMediaGroupWaiter<MediaGroupContent>(initRequest, errorFactory)
|
) = buildMediaGroupWaiter<MediaGroupPartContent>(initRequest, errorFactory)
|
||||||
suspend fun BehaviourContext.waitPlaylist(
|
suspend fun BehaviourContext.waitPlaylist(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
) = buildMediaGroupWaiter<AudioMediaGroupContent>(initRequest, errorFactory)
|
) = buildMediaGroupWaiter<AudioMediaGroupPartContent>(initRequest, errorFactory)
|
||||||
suspend fun BehaviourContext.waitDocumentsGroup(
|
suspend fun BehaviourContext.waitDocumentsGroup(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
) = buildMediaGroupWaiter<DocumentMediaGroupContent>(initRequest, errorFactory)
|
) = buildMediaGroupWaiter<DocumentMediaGroupPartContent>(initRequest, errorFactory)
|
||||||
suspend fun BehaviourContext.waitVisualGallery(
|
suspend fun BehaviourContext.waitVisualGallery(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
) = buildMediaGroupWaiter<VisualMediaGroupContent>(initRequest, errorFactory)
|
) = buildMediaGroupWaiter<VisualMediaGroupPartContent>(initRequest, errorFactory)
|
||||||
suspend fun BehaviourContext.waitPhotoGallery(
|
suspend fun BehaviourContext.waitPhotoGallery(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
|
|||||||
@@ -1,44 +1,46 @@
|
|||||||
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.utils.sentMediaGroupUpdateOrNull
|
import dev.inmo.tgbotapi.extensions.utils.baseSentMessageUpdateOrNull
|
||||||
|
import dev.inmo.tgbotapi.extensions.utils.commonMessageOrNull
|
||||||
import dev.inmo.tgbotapi.extensions.utils.withContent
|
import dev.inmo.tgbotapi.extensions.utils.withContent
|
||||||
|
import dev.inmo.tgbotapi.extensions.utils.withContentOrNull
|
||||||
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.content.*
|
import dev.inmo.tgbotapi.types.message.content.*
|
||||||
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
|
||||||
|
|
||||||
@RiskFeature(lowLevelRiskFeatureMessage)
|
@RiskFeature(lowLevelRiskFeatureMessage)
|
||||||
suspend inline fun <reified T : MediaGroupContent> BehaviourContext.buildMediaGroupMessagesWaiter(
|
suspend inline fun <reified T : MediaGroupPartContent> BehaviourContext.buildMediaGroupMessagesWaiter(
|
||||||
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<MediaGroupMessage<T>> = flowsUpdatesFilter.expectFlow(bot, initRequest, errorFactory) { update ->
|
||||||
update.sentMediaGroupUpdateOrNull() ?.data ?.let { mediaGroup ->
|
update.baseSentMessageUpdateOrNull() ?.data ?.commonMessageOrNull() ?.withContentOrNull<MediaGroupContent<*>>() ?.let { message ->
|
||||||
val mapped = mediaGroup.mapNotNull { it.withContent<T>() }
|
if (message.content.group.all { it is T }) {
|
||||||
listOf(
|
listOf(message as MediaGroupMessage<T>)
|
||||||
mapped
|
} else {
|
||||||
)
|
null
|
||||||
|
}
|
||||||
} ?: emptyList()
|
} ?: emptyList()
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun BehaviourContext.waitMediaGroupMessages(
|
suspend fun BehaviourContext.waitMediaGroupMessages(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
) = buildMediaGroupMessagesWaiter<MediaGroupContent>(initRequest, errorFactory)
|
) = buildMediaGroupMessagesWaiter<MediaGroupPartContent>(initRequest, errorFactory)
|
||||||
suspend fun BehaviourContext.waitPlaylistMessages(
|
suspend fun BehaviourContext.waitPlaylistMessages(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
) = buildMediaGroupMessagesWaiter<AudioMediaGroupContent>(initRequest, errorFactory)
|
) = buildMediaGroupMessagesWaiter<AudioMediaGroupPartContent>(initRequest, errorFactory)
|
||||||
suspend fun BehaviourContext.waitDocumentsGroupMessages(
|
suspend fun BehaviourContext.waitDocumentsGroupMessages(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
) = buildMediaGroupMessagesWaiter<DocumentMediaGroupContent>(initRequest, errorFactory)
|
) = buildMediaGroupMessagesWaiter<DocumentMediaGroupPartContent>(initRequest, errorFactory)
|
||||||
suspend fun BehaviourContext.waitVisualGalleryMessages(
|
suspend fun BehaviourContext.waitVisualGalleryMessages(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
) = buildMediaGroupMessagesWaiter<VisualMediaGroupContent>(initRequest, errorFactory)
|
) = buildMediaGroupMessagesWaiter<VisualMediaGroupPartContent>(initRequest, errorFactory)
|
||||||
suspend fun BehaviourContext.waitPhotoGalleryMessages(
|
suspend fun BehaviourContext.waitPhotoGalleryMessages(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
|
|||||||
@@ -3,18 +3,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.behaviour_builder.utils.SimpleFilter
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.*
|
import dev.inmo.tgbotapi.types.message.abstracts.*
|
||||||
|
import dev.inmo.tgbotapi.types.message.content.MediaGroupContent
|
||||||
|
import dev.inmo.tgbotapi.types.message.content.MediaGroupMessage
|
||||||
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
||||||
|
|
||||||
/**
|
|
||||||
* Allow only messages which are not [MediaGroupMessage]
|
|
||||||
*/
|
|
||||||
val MessageFilterExcludingMediaGroups: BehaviourContextAndTwoTypesReceiver<Boolean, CommonMessage<*>, Update> = { _, update ->
|
|
||||||
update !is MediaGroupMessage<*>
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Allow only messages which are not [MediaGroupMessage]
|
* Allow only messages which are not [MediaGroupMessage]
|
||||||
*/
|
*/
|
||||||
val CommonMessageFilterExcludeMediaGroups = SimpleFilter<Message> {
|
val CommonMessageFilterExcludeMediaGroups = SimpleFilter<Message> {
|
||||||
it !is MediaGroupMessage<*>
|
it !is CommonMessage<*> || it.content !is MediaGroupContent<*>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package dev.inmo.tgbotapi.extensions.behaviour_builder.filters
|
||||||
|
|
||||||
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter
|
||||||
|
import dev.inmo.tgbotapi.types.message.abstracts.*
|
||||||
|
import dev.inmo.tgbotapi.utils.extensions.threadIdOrNull
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Allow only messages which are not in some forum
|
||||||
|
*/
|
||||||
|
val MessageFilterForums = SimpleFilter<Message> {
|
||||||
|
it.threadIdOrNull == null
|
||||||
|
}
|
||||||
@@ -12,6 +12,7 @@ import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.Mar
|
|||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times
|
||||||
import dev.inmo.tgbotapi.extensions.utils.botCommandTextSourceOrNull
|
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.BotCommand
|
||||||
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
|
||||||
@@ -82,6 +83,15 @@ suspend fun <BC : BehaviourContext> BC.command(
|
|||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage>
|
||||||
) = command(command.toRegex(), requireOnlyCommandInMessage, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
|
) = command(command.toRegex(), requireOnlyCommandInMessage, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
|
||||||
|
|
||||||
|
suspend fun <BC : BehaviourContext> BC.command(
|
||||||
|
botCommand: BotCommand,
|
||||||
|
requireOnlyCommandInMessage: Boolean = true,
|
||||||
|
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||||
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update> = MessageFilterByChat,
|
||||||
|
markerFactory: MarkerFactory<in TextMessage, Any> = ByChatMessageMarkerFactory,
|
||||||
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage>
|
||||||
|
) = command(botCommand.command, requireOnlyCommandInMessage, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
|
||||||
|
|
||||||
suspend fun <BC : BehaviourContext> BC.onCommand(
|
suspend fun <BC : BehaviourContext> BC.onCommand(
|
||||||
commandRegex: Regex,
|
commandRegex: Regex,
|
||||||
requireOnlyCommandInMessage: Boolean = true,
|
requireOnlyCommandInMessage: Boolean = true,
|
||||||
@@ -100,6 +110,15 @@ suspend fun <BC : BehaviourContext> BC.onCommand(
|
|||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage>
|
||||||
): Job = onCommand(command.toRegex(), requireOnlyCommandInMessage, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
|
): Job = onCommand(command.toRegex(), requireOnlyCommandInMessage, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
|
||||||
|
|
||||||
|
suspend fun <BC : BehaviourContext> BC.onCommand(
|
||||||
|
botCommand: BotCommand,
|
||||||
|
requireOnlyCommandInMessage: Boolean = true,
|
||||||
|
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||||
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update> = MessageFilterByChat,
|
||||||
|
markerFactory: MarkerFactory<in TextMessage, Any> = ByChatMessageMarkerFactory,
|
||||||
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage>
|
||||||
|
): Job = onCommand(botCommand.command, requireOnlyCommandInMessage, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
|
||||||
|
|
||||||
suspend fun <BC : BehaviourContext> BC.commandWithArgs(
|
suspend fun <BC : BehaviourContext> BC.commandWithArgs(
|
||||||
commandRegex: Regex,
|
commandRegex: Regex,
|
||||||
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
|
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||||
@@ -134,6 +153,20 @@ suspend fun <BC : BehaviourContext> BC.commandWithArgs(
|
|||||||
scenarioReceiver = scenarioReceiver
|
scenarioReceiver = scenarioReceiver
|
||||||
)
|
)
|
||||||
|
|
||||||
|
suspend fun <BC : BehaviourContext> BC.commandWithArgs(
|
||||||
|
botCommand: BotCommand,
|
||||||
|
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||||
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update> = MessageFilterByChat,
|
||||||
|
markerFactory: MarkerFactory<in TextMessage, Any> = ByChatMessageMarkerFactory,
|
||||||
|
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>>
|
||||||
|
) = commandWithArgs(
|
||||||
|
botCommand.command,
|
||||||
|
initialFilter = initialFilter,
|
||||||
|
subcontextUpdatesFilter = subcontextUpdatesFilter,
|
||||||
|
markerFactory = markerFactory,
|
||||||
|
scenarioReceiver = scenarioReceiver
|
||||||
|
)
|
||||||
|
|
||||||
suspend fun <BC : BehaviourContext> BC.onCommandWithArgs(
|
suspend fun <BC : BehaviourContext> BC.onCommandWithArgs(
|
||||||
commandRegex: Regex,
|
commandRegex: Regex,
|
||||||
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
|
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||||
@@ -149,3 +182,11 @@ suspend fun <BC : BehaviourContext> BC.onCommandWithArgs(
|
|||||||
markerFactory: MarkerFactory<in TextMessage, Any> = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in TextMessage, Any> = ByChatMessageMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>>
|
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>>
|
||||||
): Job = onCommandWithArgs(command.toRegex(), initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
|
): Job = onCommandWithArgs(command.toRegex(), initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
|
||||||
|
|
||||||
|
suspend fun <BC : BehaviourContext> BC.onCommandWithArgs(
|
||||||
|
botCommand: BotCommand,
|
||||||
|
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||||
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update> = MessageFilterByChat,
|
||||||
|
markerFactory: MarkerFactory<in TextMessage, Any> = ByChatMessageMarkerFactory,
|
||||||
|
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>>
|
||||||
|
): Job = onCommandWithArgs(botCommand.command, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ 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.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>>
|
||||||
|
|
||||||
@@ -26,7 +25,6 @@ internal suspend inline fun <BC : BehaviourContext, reified T : MessageContent>
|
|||||||
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
|
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
|
||||||
when (it) {
|
when (it) {
|
||||||
is BaseSentMessageUpdate -> it.data.whenCommonMessage(::listOfNotNull)
|
is BaseSentMessageUpdate -> it.data.whenCommonMessage(::listOfNotNull)
|
||||||
is SentMediaGroupUpdate -> it.data
|
|
||||||
else -> null
|
else -> null
|
||||||
} ?.mapNotNull { message ->
|
} ?.mapNotNull { message ->
|
||||||
if (message.content is T) message as CommonMessage<T> else null
|
if (message.content is T) message as CommonMessage<T> else null
|
||||||
@@ -287,7 +285,7 @@ suspend fun <BC : BehaviourContext> BC.onVenue(
|
|||||||
* data
|
* data
|
||||||
*/
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onAudioMediaGroup(
|
suspend fun <BC : BehaviourContext> BC.onAudioMediaGroup(
|
||||||
initialFilter: CommonMessageFilter<AudioMediaGroupContent>? = null,
|
initialFilter: CommonMessageFilter<AudioMediaGroupPartContent>? = null,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, AudioMediaGroupMessage, Update> = MessageFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, AudioMediaGroupMessage, Update> = MessageFilterByChat,
|
||||||
markerFactory: MarkerFactory<in AudioMediaGroupMessage, Any> = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in AudioMediaGroupMessage, Any> = ByChatMessageMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, AudioMediaGroupMessage>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, AudioMediaGroupMessage>
|
||||||
@@ -311,7 +309,7 @@ suspend fun <BC : BehaviourContext> BC.onAudioMediaGroup(
|
|||||||
* data
|
* data
|
||||||
*/
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onDocumentMediaGroupContent(
|
suspend fun <BC : BehaviourContext> BC.onDocumentMediaGroupContent(
|
||||||
initialFilter: CommonMessageFilter<DocumentMediaGroupContent>? = null,
|
initialFilter: CommonMessageFilter<DocumentMediaGroupPartContent>? = null,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, DocumentMediaGroupMessage, Update> = MessageFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, DocumentMediaGroupMessage, Update> = MessageFilterByChat,
|
||||||
markerFactory: MarkerFactory<in DocumentMediaGroupMessage, Any> = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in DocumentMediaGroupMessage, Any> = ByChatMessageMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, DocumentMediaGroupMessage>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, DocumentMediaGroupMessage>
|
||||||
|
|||||||
@@ -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) }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -222,7 +222,7 @@ suspend fun <BC : BehaviourContext> BC.onEditedVenue(
|
|||||||
* data
|
* data
|
||||||
*/
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onEditedAudioMediaGroup(
|
suspend fun <BC : BehaviourContext> BC.onEditedAudioMediaGroup(
|
||||||
initialFilter: CommonMessageFilter<AudioMediaGroupContent>? = null,
|
initialFilter: CommonMessageFilter<AudioMediaGroupPartContent>? = null,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, AudioMediaGroupMessage, Update> = MessageFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, AudioMediaGroupMessage, Update> = MessageFilterByChat,
|
||||||
markerFactory: MarkerFactory<in AudioMediaGroupMessage, Any> = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in AudioMediaGroupMessage, Any> = ByChatMessageMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, AudioMediaGroupMessage>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, AudioMediaGroupMessage>
|
||||||
@@ -246,7 +246,7 @@ suspend fun <BC : BehaviourContext> BC.onEditedAudioMediaGroup(
|
|||||||
* data
|
* data
|
||||||
*/
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onEditedDocumentMediaGroupContent(
|
suspend fun <BC : BehaviourContext> BC.onEditedDocumentMediaGroupContent(
|
||||||
initialFilter: CommonMessageFilter<DocumentMediaGroupContent>? = null,
|
initialFilter: CommonMessageFilter<DocumentMediaGroupPartContent>? = null,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, DocumentMediaGroupMessage, Update> = MessageFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, DocumentMediaGroupMessage, Update> = MessageFilterByChat,
|
||||||
markerFactory: MarkerFactory<in DocumentMediaGroupMessage, Any> = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in DocumentMediaGroupMessage, Any> = ByChatMessageMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, DocumentMediaGroupMessage>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, DocumentMediaGroupMessage>
|
||||||
|
|||||||
@@ -11,9 +11,13 @@ import dev.inmo.tgbotapi.extensions.utils.baseSentMessageUpdateOrNull
|
|||||||
import dev.inmo.tgbotapi.extensions.utils.chatEventMessageOrNull
|
import dev.inmo.tgbotapi.extensions.utils.chatEventMessageOrNull
|
||||||
import dev.inmo.tgbotapi.types.message.ChatEvents.*
|
import dev.inmo.tgbotapi.types.message.ChatEvents.*
|
||||||
import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.*
|
import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.*
|
||||||
|
import dev.inmo.tgbotapi.types.message.ChatEvents.forum.ForumTopicClosed
|
||||||
|
import dev.inmo.tgbotapi.types.message.ChatEvents.forum.ForumTopicCreated
|
||||||
|
import dev.inmo.tgbotapi.types.message.ChatEvents.forum.ForumTopicReopened
|
||||||
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.PrivateEventMessage
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.ChatEventMessage
|
import dev.inmo.tgbotapi.types.message.abstracts.ChatEventMessage
|
||||||
|
import dev.inmo.tgbotapi.types.message.abstracts.SupergroupEventMessage
|
||||||
import dev.inmo.tgbotapi.types.message.payments.SuccessfulPaymentEvent
|
import dev.inmo.tgbotapi.types.message.payments.SuccessfulPaymentEvent
|
||||||
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
||||||
|
|
||||||
@@ -27,6 +31,16 @@ internal suspend inline fun <BC : BehaviourContext, reified T : ChatEvent> BC.on
|
|||||||
(it.baseSentMessageUpdateOrNull() ?.data ?.chatEventMessageOrNull() ?.takeIf { it.chatEvent is T } as? ChatEventMessage<T>) ?.let(::listOfNotNull)
|
(it.baseSentMessageUpdateOrNull() ?.data ?.chatEventMessageOrNull() ?.takeIf { it.chatEvent is T } as? ChatEventMessage<T>) ?.let(::listOfNotNull)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal suspend inline fun <BC : BehaviourContext, reified T : ChatEvent, reified CEM : ChatEventMessage<T>> BC.onEventWithCustomChatEventMessage(
|
||||||
|
initialFilter: SimpleFilter<CEM>? = null,
|
||||||
|
noinline subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CEM, Update>? = MessageFilterByChat,
|
||||||
|
markerFactory: MarkerFactory<in CEM, Any> = ByChatMessageMarkerFactory,
|
||||||
|
noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CEM>
|
||||||
|
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
|
||||||
|
@Suppress("UNCHECKED_CAST")
|
||||||
|
(it.baseSentMessageUpdateOrNull() ?.data ?.chatEventMessageOrNull() ?.takeIf { it.chatEvent is T } as? CEM) ?.let(::listOfNotNull)
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param initialFilter This filter will be called to remove unnecessary data BEFORE [scenarioReceiver] call
|
* @param initialFilter This filter will be called to remove unnecessary data BEFORE [scenarioReceiver] call
|
||||||
* @param subcontextUpdatesFilter This filter will be applied to each update inside of [scenarioReceiver]. For example,
|
* @param subcontextUpdatesFilter This filter will be applied to each update inside of [scenarioReceiver]. For example,
|
||||||
@@ -503,12 +517,61 @@ suspend fun <BC : BehaviourContext> BC.onWebAppData(
|
|||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, PrivateEventMessage<WebAppData>, Update>? = MessageFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, PrivateEventMessage<WebAppData>, Update>? = MessageFilterByChat,
|
||||||
markerFactory: MarkerFactory<in ChatEventMessage<WebAppData>, Any> = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in ChatEventMessage<WebAppData>, Any> = ByChatMessageMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, PrivateEventMessage<WebAppData>>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, PrivateEventMessage<WebAppData>>
|
||||||
) = onEvent(
|
) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
|
||||||
initialFilter ?.let { { it is PrivateEventMessage<WebAppData> && initialFilter(it) } },
|
|
||||||
subcontextUpdatesFilter ?.let { { message: ChatEventMessage<WebAppData>, update: Update -> message is PrivateEventMessage<WebAppData> && subcontextUpdatesFilter(message, update) } },
|
/**
|
||||||
markerFactory
|
* @param initialFilter This filter will be called to remove unnecessary data BEFORE [scenarioReceiver] call
|
||||||
) {
|
* @param subcontextUpdatesFilter This filter will be applied to each update inside of [scenarioReceiver]. For example,
|
||||||
if (it is PrivateEventMessage<WebAppData>) {
|
* this filter will be used if you will call [dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.waitContentMessage].
|
||||||
scenarioReceiver(it)
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
||||||
}
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
||||||
}
|
* to combinate several filters
|
||||||
|
* @param markerFactory Will be used to identify different "stream". [scenarioReceiver] will be called synchronously
|
||||||
|
* in one "stream". Output of [markerFactory] will be used as a key for "stream"
|
||||||
|
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||||
|
* data
|
||||||
|
*/
|
||||||
|
suspend fun <BC : BehaviourContext> BC.onForumTopicClosed(
|
||||||
|
initialFilter: SimpleFilter<SupergroupEventMessage<ForumTopicClosed>>? = null,
|
||||||
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, SupergroupEventMessage<ForumTopicClosed>, Update>? = MessageFilterByChat,
|
||||||
|
markerFactory: MarkerFactory<in ChatEventMessage<ForumTopicClosed>, Any> = ByChatMessageMarkerFactory,
|
||||||
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, SupergroupEventMessage<ForumTopicClosed>>
|
||||||
|
) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param initialFilter This filter will be called to remove unnecessary data BEFORE [scenarioReceiver] call
|
||||||
|
* @param subcontextUpdatesFilter This filter will be applied to each update inside of [scenarioReceiver]. For example,
|
||||||
|
* this filter will be used if you will call [dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.waitContentMessage].
|
||||||
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
||||||
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
||||||
|
* to combinate several filters
|
||||||
|
* @param markerFactory Will be used to identify different "stream". [scenarioReceiver] will be called synchronously
|
||||||
|
* in one "stream". Output of [markerFactory] will be used as a key for "stream"
|
||||||
|
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||||
|
* data
|
||||||
|
*/
|
||||||
|
suspend fun <BC : BehaviourContext> BC.onForumTopicCreated(
|
||||||
|
initialFilter: SimpleFilter<SupergroupEventMessage<ForumTopicCreated>>? = null,
|
||||||
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, SupergroupEventMessage<ForumTopicCreated>, Update>? = MessageFilterByChat,
|
||||||
|
markerFactory: MarkerFactory<in ChatEventMessage<ForumTopicCreated>, Any> = ByChatMessageMarkerFactory,
|
||||||
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, SupergroupEventMessage<ForumTopicCreated>>
|
||||||
|
) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param initialFilter This filter will be called to remove unnecessary data BEFORE [scenarioReceiver] call
|
||||||
|
* @param subcontextUpdatesFilter This filter will be applied to each update inside of [scenarioReceiver]. For example,
|
||||||
|
* this filter will be used if you will call [dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.waitContentMessage].
|
||||||
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
||||||
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
||||||
|
* to combinate several filters
|
||||||
|
* @param markerFactory Will be used to identify different "stream". [scenarioReceiver] will be called synchronously
|
||||||
|
* in one "stream". Output of [markerFactory] will be used as a key for "stream"
|
||||||
|
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||||
|
* data
|
||||||
|
*/
|
||||||
|
suspend fun <BC : BehaviourContext> BC.onForumTopicReopened(
|
||||||
|
initialFilter: SimpleFilter<SupergroupEventMessage<ForumTopicReopened>>? = null,
|
||||||
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, SupergroupEventMessage<ForumTopicReopened>, Update>? = MessageFilterByChat,
|
||||||
|
markerFactory: MarkerFactory<in ChatEventMessage<ForumTopicReopened>, Any> = ByChatMessageMarkerFactory,
|
||||||
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, SupergroupEventMessage<ForumTopicReopened>>
|
||||||
|
) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
|
||||||
|
|||||||
@@ -13,11 +13,20 @@ internal suspend inline fun <BC : BehaviourContext, reified T> BC.on(
|
|||||||
noinline subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, T, Update>? = null,
|
noinline subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, T, Update>? = null,
|
||||||
noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, T>,
|
noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, T>,
|
||||||
noinline updateToData: (Update) -> List<T>?
|
noinline updateToData: (Update) -> List<T>?
|
||||||
) = flowsUpdatesFilter.expectFlow(bot) {
|
) = flowsUpdatesFilter.expectFlow(
|
||||||
updateToData(it) ?.mapNotNull { data ->
|
bot,
|
||||||
if (initialFilter ?.invoke(data) != false) it to data else null
|
filter = initialFilter ?.let {
|
||||||
} ?: emptyList()
|
{
|
||||||
}.subscribeSafelyWithoutExceptionsAsync(
|
updateToData(it) ?.mapNotNull { data ->
|
||||||
|
if (initialFilter(data)) it to data else null
|
||||||
|
} ?: emptyList()
|
||||||
|
}
|
||||||
|
} ?: {
|
||||||
|
updateToData(it) ?.mapNotNull { data ->
|
||||||
|
it to data
|
||||||
|
} ?: emptyList()
|
||||||
|
}
|
||||||
|
).subscribeSafelyWithoutExceptionsAsync(
|
||||||
scope,
|
scope,
|
||||||
{ markerFactory(it.second) }
|
{ markerFactory(it.second) }
|
||||||
) { (update, triggerData) ->
|
) { (update, triggerData) ->
|
||||||
|
|||||||
@@ -0,0 +1,164 @@
|
|||||||
|
@file:Suppress("unused")
|
||||||
|
|
||||||
|
package dev.inmo.tgbotapi.extensions.behaviour_builder.triggers_handling
|
||||||
|
|
||||||
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.*
|
||||||
|
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.utils.baseSentMessageUpdateOrNull
|
||||||
|
import dev.inmo.tgbotapi.extensions.utils.commonMessageOrNull
|
||||||
|
import dev.inmo.tgbotapi.extensions.utils.withContentOrNull
|
||||||
|
import dev.inmo.tgbotapi.types.message.abstracts.CommonMessage
|
||||||
|
import dev.inmo.tgbotapi.types.message.content.*
|
||||||
|
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
||||||
|
import dev.inmo.tgbotapi.utils.PreviewFeature
|
||||||
|
|
||||||
|
@PreviewFeature
|
||||||
|
internal suspend inline fun <BC : BehaviourContext, reified T : MediaGroupPartContent> BC.buildMediaGroupMessagesTrigger(
|
||||||
|
initialFilter: SimpleFilter<MediaGroupMessage<T>>? = null,
|
||||||
|
noinline subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MediaGroupMessage<T>, Update>? = null,
|
||||||
|
markerFactory: MarkerFactory<in MediaGroupMessage<T>, Any> = ByChatMessageMarkerFactory,
|
||||||
|
noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MediaGroupMessage<T>>
|
||||||
|
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
|
||||||
|
it.baseSentMessageUpdateOrNull() ?.data ?.commonMessageOrNull() ?.withContentOrNull<MediaGroupContent<*>>() ?.let {
|
||||||
|
if (it.content.group.all { it.content is T }) {
|
||||||
|
listOf(it as MediaGroupMessage<T>)
|
||||||
|
} else {
|
||||||
|
null
|
||||||
|
}
|
||||||
|
} ?: emptyList()
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param initialFilter This filter will be called to remove unnecessary data BEFORE [scenarioReceiver] call
|
||||||
|
* @param subcontextUpdatesFilter This filter will be applied to each update inside of [scenarioReceiver]. For example,
|
||||||
|
* this filter will be used if you will call [dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.waitContentMessage].
|
||||||
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
||||||
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
||||||
|
* to combinate several filters
|
||||||
|
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously
|
||||||
|
* in one "stream". Output of [markerFactory] will be used as a key for "stream"
|
||||||
|
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||||
|
* data
|
||||||
|
*/
|
||||||
|
suspend fun <BC : BehaviourContext> BC.onMediaGroupMessages(
|
||||||
|
initialFilter: SimpleFilter<MediaGroupMessage<MediaGroupPartContent>>? = null,
|
||||||
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MediaGroupMessage<MediaGroupPartContent>, Update>? = null,
|
||||||
|
markerFactory: MarkerFactory<in MediaGroupMessage<MediaGroupPartContent>, Any> = ByChatMessageMarkerFactory,
|
||||||
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MediaGroupMessage<MediaGroupPartContent>>
|
||||||
|
) = buildMediaGroupMessagesTrigger(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param initialFilter This filter will be called to remove unnecessary data BEFORE [scenarioReceiver] call
|
||||||
|
* @param subcontextUpdatesFilter This filter will be applied to each update inside of [scenarioReceiver]. For example,
|
||||||
|
* this filter will be used if you will call [dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.waitContentMessage].
|
||||||
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
||||||
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
||||||
|
* to combinate several filters
|
||||||
|
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously
|
||||||
|
* in one "stream". Output of [markerFactory] will be used as a key for "stream"
|
||||||
|
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||||
|
* data
|
||||||
|
*/
|
||||||
|
suspend fun <BC : BehaviourContext> BC.onPlaylistMessages(
|
||||||
|
initialFilter: SimpleFilter<MediaGroupMessage<AudioMediaGroupPartContent>>? = null,
|
||||||
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MediaGroupMessage<AudioMediaGroupPartContent>, Update>? = null,
|
||||||
|
markerFactory: MarkerFactory<in MediaGroupMessage<AudioMediaGroupPartContent>, Any> = ByChatMessageMarkerFactory,
|
||||||
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MediaGroupMessage<AudioMediaGroupPartContent>>
|
||||||
|
) = buildMediaGroupMessagesTrigger(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param initialFilter This filter will be called to remove unnecessary data BEFORE [scenarioReceiver] call
|
||||||
|
* @param subcontextUpdatesFilter This filter will be applied to each update inside of [scenarioReceiver]. For example,
|
||||||
|
* this filter will be used if you will call [dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.waitContentMessage].
|
||||||
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
||||||
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
||||||
|
* to combinate several filters
|
||||||
|
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously
|
||||||
|
* in one "stream". Output of [markerFactory] will be used as a key for "stream"
|
||||||
|
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||||
|
* data
|
||||||
|
*/
|
||||||
|
suspend fun <BC : BehaviourContext> BC.onDocumentsGroupMessages(
|
||||||
|
initialFilter: SimpleFilter<MediaGroupMessage<DocumentMediaGroupPartContent>>? = null,
|
||||||
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MediaGroupMessage<DocumentMediaGroupPartContent>, Update>? = null,
|
||||||
|
markerFactory: MarkerFactory<in MediaGroupMessage<DocumentMediaGroupPartContent>, Any> = ByChatMessageMarkerFactory,
|
||||||
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MediaGroupMessage<DocumentMediaGroupPartContent>>
|
||||||
|
) = buildMediaGroupMessagesTrigger(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param initialFilter This filter will be called to remove unnecessary data BEFORE [scenarioReceiver] call
|
||||||
|
* @param subcontextUpdatesFilter This filter will be applied to each update inside of [scenarioReceiver]. For example,
|
||||||
|
* this filter will be used if you will call [dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.waitContentMessage].
|
||||||
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
||||||
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
||||||
|
* to combinate several filters
|
||||||
|
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously
|
||||||
|
* in one "stream". Output of [markerFactory] will be used as a key for "stream"
|
||||||
|
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||||
|
* data
|
||||||
|
*/
|
||||||
|
suspend fun <BC : BehaviourContext> BC.onVisualGalleryMessages(
|
||||||
|
initialFilter: SimpleFilter<MediaGroupMessage<VisualMediaGroupPartContent>>? = null,
|
||||||
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MediaGroupMessage<VisualMediaGroupPartContent>, Update>? = null,
|
||||||
|
markerFactory: MarkerFactory<in MediaGroupMessage<VisualMediaGroupPartContent>, Any> = ByChatMessageMarkerFactory,
|
||||||
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MediaGroupMessage<VisualMediaGroupPartContent>>
|
||||||
|
) = buildMediaGroupMessagesTrigger(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param initialFilter This filter will be called to remove unnecessary data BEFORE [scenarioReceiver] call
|
||||||
|
* @param subcontextUpdatesFilter This filter will be applied to each update inside of [scenarioReceiver]. For example,
|
||||||
|
* this filter will be used if you will call [dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.waitContentMessage].
|
||||||
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
||||||
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
||||||
|
* to combinate several filters
|
||||||
|
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously
|
||||||
|
* in one "stream". Output of [markerFactory] will be used as a key for "stream"
|
||||||
|
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||||
|
* data
|
||||||
|
*/
|
||||||
|
suspend fun <BC : BehaviourContext> BC.onVisualMediaGroupMessages(
|
||||||
|
initialFilter: SimpleFilter<MediaGroupMessage<VisualMediaGroupPartContent>>? = null,
|
||||||
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MediaGroupMessage<VisualMediaGroupPartContent>, Update>? = null,
|
||||||
|
markerFactory: MarkerFactory<in MediaGroupMessage<VisualMediaGroupPartContent>, Any> = ByChatMessageMarkerFactory,
|
||||||
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MediaGroupMessage<VisualMediaGroupPartContent>>
|
||||||
|
) = onVisualGalleryMessages(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param initialFilter This filter will be called to remove unnecessary data BEFORE [scenarioReceiver] call
|
||||||
|
* @param subcontextUpdatesFilter This filter will be applied to each update inside of [scenarioReceiver]. For example,
|
||||||
|
* this filter will be used if you will call [dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.waitContentMessage].
|
||||||
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
||||||
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
||||||
|
* to combinate several filters
|
||||||
|
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously
|
||||||
|
* in one "stream". Output of [markerFactory] will be used as a key for "stream"
|
||||||
|
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||||
|
* data
|
||||||
|
*/
|
||||||
|
suspend fun <BC : BehaviourContext> BC.onPhotoGalleryMessages(
|
||||||
|
initialFilter: SimpleFilter<MediaGroupMessage<PhotoContent>>? = null,
|
||||||
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MediaGroupMessage<PhotoContent>, Update>? = null,
|
||||||
|
markerFactory: MarkerFactory<in MediaGroupMessage<PhotoContent>, Any> = ByChatMessageMarkerFactory,
|
||||||
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MediaGroupMessage<PhotoContent>>
|
||||||
|
) = buildMediaGroupMessagesTrigger(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param initialFilter This filter will be called to remove unnecessary data BEFORE [scenarioReceiver] call
|
||||||
|
* @param subcontextUpdatesFilter This filter will be applied to each update inside of [scenarioReceiver]. For example,
|
||||||
|
* this filter will be used if you will call [dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.waitContentMessage].
|
||||||
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
||||||
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
||||||
|
* to combinate several filters
|
||||||
|
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously
|
||||||
|
* in one "stream". Output of [markerFactory] will be used as a key for "stream"
|
||||||
|
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||||
|
* data
|
||||||
|
*/
|
||||||
|
suspend fun <BC : BehaviourContext> BC.onVideoGalleryMessages(
|
||||||
|
initialFilter: SimpleFilter<MediaGroupMessage<VideoContent>>? = null,
|
||||||
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MediaGroupMessage<VideoContent>, Update>? = null,
|
||||||
|
markerFactory: MarkerFactory<in MediaGroupMessage<VideoContent>, Any> = ByChatMessageMarkerFactory,
|
||||||
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MediaGroupMessage<VideoContent>>
|
||||||
|
) = buildMediaGroupMessagesTrigger(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
|
||||||
@@ -3,28 +3,31 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.behaviour_builder.triggers_handling
|
package dev.inmo.tgbotapi.extensions.behaviour_builder.triggers_handling
|
||||||
|
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.*
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.*
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.filters.MessagesFilterByChat
|
|
||||||
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.AnyMarkerFactory
|
||||||
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.sentMediaGroupUpdateOrNull
|
import dev.inmo.tgbotapi.extensions.utils.baseSentMessageUpdateOrNull
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.MediaGroupMessage
|
import dev.inmo.tgbotapi.extensions.utils.commonMessageOrNull
|
||||||
|
import dev.inmo.tgbotapi.extensions.utils.withContentOrNull
|
||||||
|
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.update.abstracts.Update
|
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
||||||
import dev.inmo.tgbotapi.utils.PreviewFeature
|
import dev.inmo.tgbotapi.utils.PreviewFeature
|
||||||
|
|
||||||
@PreviewFeature
|
@PreviewFeature
|
||||||
internal suspend inline fun <BC : BehaviourContext, reified T : MediaGroupContent> BC.buildMediaGroupTrigger(
|
internal suspend inline fun <BC : BehaviourContext, reified T : MediaGroupPartContent> BC.buildMediaGroupTrigger(
|
||||||
initialFilter: SimpleFilter<List<MediaGroupMessage<T>>>? = null,
|
initialFilter: SimpleFilter<MediaGroupContent<T>>? = null,
|
||||||
noinline subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, List<MediaGroupMessage<T>>, Update>? = MessagesFilterByChat,
|
noinline subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MediaGroupContent<T>, Update>? = null,
|
||||||
markerFactory: MarkerFactory<in List<MediaGroupMessage<T>>, Any> = ByChatMediaGroupMarkerFactory,
|
markerFactory: MarkerFactory<in MediaGroupContent<T>, Any> = AnyMarkerFactory(),
|
||||||
noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, List<MediaGroupMessage<T>>>
|
noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MediaGroupContent<T>>
|
||||||
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
|
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
|
||||||
(it.sentMediaGroupUpdateOrNull() ?.data ?.takeIf { messages ->
|
it.baseSentMessageUpdateOrNull() ?.data ?.commonMessageOrNull() ?.withContentOrNull<MediaGroupContent<*>>() ?.let {
|
||||||
messages.all { message ->
|
if (it.content.group.all { it.content is T }) {
|
||||||
message.content is T
|
listOf(it.content as MediaGroupContent<T>)
|
||||||
|
} else {
|
||||||
|
null
|
||||||
}
|
}
|
||||||
} as? List<MediaGroupMessage<T>>) ?.let(::listOfNotNull)
|
} ?: emptyList()
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -40,10 +43,10 @@ internal suspend inline fun <BC : BehaviourContext, reified T : MediaGroupConten
|
|||||||
* data
|
* data
|
||||||
*/
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onMediaGroup(
|
suspend fun <BC : BehaviourContext> BC.onMediaGroup(
|
||||||
initialFilter: SimpleFilter<List<MediaGroupMessage<MediaGroupContent>>>? = null,
|
initialFilter: SimpleFilter<MediaGroupContent<MediaGroupPartContent>>? = null,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, List<MediaGroupMessage<MediaGroupContent>>, Update>? = MessagesFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MediaGroupContent<MediaGroupPartContent>, Update>? = null,
|
||||||
markerFactory: MarkerFactory<in List<MediaGroupMessage<MediaGroupContent>>, Any> = ByChatMediaGroupMarkerFactory,
|
markerFactory: MarkerFactory<in MediaGroupContent<MediaGroupPartContent>, Any> = AnyMarkerFactory(),
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, List<MediaGroupMessage<MediaGroupContent>>>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MediaGroupContent<MediaGroupPartContent>>
|
||||||
) = buildMediaGroupTrigger(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
|
) = buildMediaGroupTrigger(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -59,10 +62,10 @@ suspend fun <BC : BehaviourContext> BC.onMediaGroup(
|
|||||||
* data
|
* data
|
||||||
*/
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onPlaylist(
|
suspend fun <BC : BehaviourContext> BC.onPlaylist(
|
||||||
initialFilter: SimpleFilter<List<MediaGroupMessage<AudioMediaGroupContent>>>? = null,
|
initialFilter: SimpleFilter<MediaGroupContent<AudioMediaGroupPartContent>>? = null,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, List<MediaGroupMessage<AudioMediaGroupContent>>, Update>? = MessagesFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MediaGroupContent<AudioMediaGroupPartContent>, Update>? = null,
|
||||||
markerFactory: MarkerFactory<in List<MediaGroupMessage<AudioMediaGroupContent>>, Any> = ByChatMediaGroupMarkerFactory,
|
markerFactory: MarkerFactory<in MediaGroupContent<AudioMediaGroupPartContent>, Any> = AnyMarkerFactory(),
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, List<MediaGroupMessage<AudioMediaGroupContent>>>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MediaGroupContent<AudioMediaGroupPartContent>>
|
||||||
) = buildMediaGroupTrigger(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
|
) = buildMediaGroupTrigger(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -78,10 +81,10 @@ suspend fun <BC : BehaviourContext> BC.onPlaylist(
|
|||||||
* data
|
* data
|
||||||
*/
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onDocumentsGroup(
|
suspend fun <BC : BehaviourContext> BC.onDocumentsGroup(
|
||||||
initialFilter: SimpleFilter<List<MediaGroupMessage<DocumentMediaGroupContent>>>? = null,
|
initialFilter: SimpleFilter<MediaGroupContent<DocumentMediaGroupPartContent>>? = null,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, List<MediaGroupMessage<DocumentMediaGroupContent>>, Update>? = MessagesFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MediaGroupContent<DocumentMediaGroupPartContent>, Update>? = null,
|
||||||
markerFactory: MarkerFactory<in List<MediaGroupMessage<DocumentMediaGroupContent>>, Any> = ByChatMediaGroupMarkerFactory,
|
markerFactory: MarkerFactory<in MediaGroupContent<DocumentMediaGroupPartContent>, Any> = AnyMarkerFactory(),
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, List<MediaGroupMessage<DocumentMediaGroupContent>>>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MediaGroupContent<DocumentMediaGroupPartContent>>
|
||||||
) = buildMediaGroupTrigger(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
|
) = buildMediaGroupTrigger(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -97,10 +100,10 @@ suspend fun <BC : BehaviourContext> BC.onDocumentsGroup(
|
|||||||
* data
|
* data
|
||||||
*/
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onVisualGallery(
|
suspend fun <BC : BehaviourContext> BC.onVisualGallery(
|
||||||
initialFilter: SimpleFilter<List<MediaGroupMessage<VisualMediaGroupContent>>>? = null,
|
initialFilter: SimpleFilter<MediaGroupContent<VisualMediaGroupPartContent>>? = null,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, List<MediaGroupMessage<VisualMediaGroupContent>>, Update>? = MessagesFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MediaGroupContent<VisualMediaGroupPartContent>, Update>? = null,
|
||||||
markerFactory: MarkerFactory<in List<MediaGroupMessage<VisualMediaGroupContent>>, Any> = ByChatMediaGroupMarkerFactory,
|
markerFactory: MarkerFactory<in MediaGroupContent<VisualMediaGroupPartContent>, Any> = AnyMarkerFactory(),
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, List<MediaGroupMessage<VisualMediaGroupContent>>>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MediaGroupContent<VisualMediaGroupPartContent>>
|
||||||
) = buildMediaGroupTrigger(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
|
) = buildMediaGroupTrigger(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -116,10 +119,10 @@ suspend fun <BC : BehaviourContext> BC.onVisualGallery(
|
|||||||
* data
|
* data
|
||||||
*/
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onVisualMediaGroup(
|
suspend fun <BC : BehaviourContext> BC.onVisualMediaGroup(
|
||||||
initialFilter: SimpleFilter<List<MediaGroupMessage<VisualMediaGroupContent>>>? = null,
|
initialFilter: SimpleFilter<MediaGroupContent<VisualMediaGroupPartContent>>? = null,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, List<MediaGroupMessage<VisualMediaGroupContent>>, Update>? = MessagesFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MediaGroupContent<VisualMediaGroupPartContent>, Update>? = null,
|
||||||
markerFactory: MarkerFactory<in List<MediaGroupMessage<VisualMediaGroupContent>>, Any> = ByChatMediaGroupMarkerFactory,
|
markerFactory: MarkerFactory<in MediaGroupContent<VisualMediaGroupPartContent>, Any> = AnyMarkerFactory(),
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, List<MediaGroupMessage<VisualMediaGroupContent>>>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MediaGroupContent<VisualMediaGroupPartContent>>
|
||||||
) = onVisualGallery(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
|
) = onVisualGallery(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -135,10 +138,10 @@ suspend fun <BC : BehaviourContext> BC.onVisualMediaGroup(
|
|||||||
* data
|
* data
|
||||||
*/
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onPhotoGallery(
|
suspend fun <BC : BehaviourContext> BC.onPhotoGallery(
|
||||||
initialFilter: SimpleFilter<List<MediaGroupMessage<PhotoContent>>>? = null,
|
initialFilter: SimpleFilter<MediaGroupContent<PhotoContent>>? = null,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, List<MediaGroupMessage<PhotoContent>>, Update>? = MessagesFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MediaGroupContent<PhotoContent>, Update>? = null,
|
||||||
markerFactory: MarkerFactory<in List<MediaGroupMessage<PhotoContent>>, Any> = ByChatMediaGroupMarkerFactory,
|
markerFactory: MarkerFactory<in MediaGroupContent<PhotoContent>, Any> = AnyMarkerFactory(),
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, List<MediaGroupMessage<PhotoContent>>>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MediaGroupContent<PhotoContent>>
|
||||||
) = buildMediaGroupTrigger(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
|
) = buildMediaGroupTrigger(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -154,8 +157,8 @@ suspend fun <BC : BehaviourContext> BC.onPhotoGallery(
|
|||||||
* data
|
* data
|
||||||
*/
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onVideoGallery(
|
suspend fun <BC : BehaviourContext> BC.onVideoGallery(
|
||||||
initialFilter: SimpleFilter<List<MediaGroupMessage<VideoContent>>>? = null,
|
initialFilter: SimpleFilter<MediaGroupContent<VideoContent>>? = null,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, List<MediaGroupMessage<VideoContent>>, Update>? = MessagesFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MediaGroupContent<VideoContent>, Update>? = null,
|
||||||
markerFactory: MarkerFactory<in List<MediaGroupMessage<VideoContent>>, Any> = ByChatMediaGroupMarkerFactory,
|
markerFactory: MarkerFactory<in MediaGroupContent<VideoContent>, Any> = AnyMarkerFactory(),
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, List<MediaGroupMessage<VideoContent>>>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MediaGroupContent<VideoContent>>
|
||||||
) = buildMediaGroupTrigger(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
|
) = buildMediaGroupTrigger(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
|
||||||
|
|||||||
@@ -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]
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user