1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2026-03-18 16:52:23 +00:00

Compare commits

...

108 Commits

Author SHA1 Message Date
744149a674 fill changelog 2026-02-24 15:02:25 +06:00
410183e315 add notes about support of new apis 2026-02-24 14:37:50 +06:00
9776a2474a fix of UniqueGiftModel 2026-02-24 14:09:49 +06:00
aebc571307 upfill changelog 2026-02-24 14:02:37 +06:00
26c11d9d6b add OwnedGifts sealed interface 2026-02-24 12:37:07 +06:00
c9be5041b8 check new fields and other things related to api updates in gifts 2026-02-20 17:49:16 +06:00
f10cfdbe1e add support of getChatGifts and getUserGifts 2026-02-20 17:05:51 +06:00
83b4d2155f add is_burned support 2026-02-20 13:55:19 +06:00
eccc687aec add rarity support 2026-02-20 13:06:53 +06:00
53e79b152e add support of unique gift colors 2026-02-20 12:54:21 +06:00
b9157b1924 completed by chat and completed by user support 2026-02-20 12:45:34 +06:00
e6aaa264f6 improvements of effectId in copyMessage and forwardMessage 2026-02-18 23:37:18 +06:00
e6cb028a71 improve repostStory 2026-02-18 22:55:38 +06:00
10b796c88e fix support of rating info 2026-02-18 22:46:56 +06:00
62a4bf5195 small fill of CHANGELOG and fix of library version 2026-02-18 22:23:42 +06:00
a0bb05ce4a add support of profile audios 2026-02-18 21:22:16 +06:00
e02849ae5e add purchased_paid_media in updates list 2026-02-18 17:52:26 +06:00
4252db489a fix support of paid_message_star_count 2026-02-18 17:18:38 +06:00
ac05fa0fe3 add support of SetMyProfilePhoto and RemoveMyProfilePhoto 2026-02-17 22:05:38 +06:00
bd816b7847 realize ChatOwnerLeft and ChatOwnerChanged 2026-02-17 15:30:25 +06:00
407f2a8bf7 fix serialization of simple keyboard button 2026-02-17 12:09:23 +06:00
10b1c359fa extend support of styles and iconEmojiCustomId 2026-02-16 23:22:04 +06:00
c4f2566b71 add support of style and iconEmojiCustomId 2026-02-16 22:57:45 +06:00
85fb7e42e5 fix RepostStory class 2026-02-16 22:39:18 +06:00
d68c70e898 fix drafts flows signatures 2026-02-16 18:52:41 +06:00
14402f9283 improve drafts flows 2026-02-16 18:48:31 +06:00
b734757062 add drafts flows 2026-02-16 18:24:29 +06:00
fd9ad8dbf1 add drafts 2026-02-16 18:03:05 +06:00
734e6074ef update events triggers 2026-02-16 17:35:46 +06:00
d642a04e01 update forum events 2026-02-16 17:26:35 +06:00
ecd01c9254 classcasts and apiDump 2026-02-16 17:14:28 +06:00
8922b80cff fixes 2026-02-16 17:09:48 +06:00
50a7c9cae2 update forum topic events 2026-02-16 17:08:49 +06:00
f7ee0828ce small improvements 2026-02-16 15:05:37 +06:00
0c87cf95eb improvements(?) in users api 2026-02-16 15:04:33 +06:00
9fea7390e8 add support of extended chat id in private chats 2026-02-15 23:51:39 +06:00
9f0ca8143c update microutils 2026-02-15 21:03:28 +06:00
9d879b90bb fix user rating 2026-02-15 15:14:18 +06:00
2a28f8ab39 fixes in common bot hierarchy 2026-02-15 14:47:47 +06:00
44ce84cb84 fixes? 2026-02-15 13:53:41 +06:00
cea80ccee6 preview version of threads in privats 2026-02-15 13:22:17 +06:00
e1848aa5c9 fix of hasTopicsEnabled and add support of allows_users_to_create_topics 2026-02-15 13:14:18 +06:00
e40424b26a some additions(need to check all this commit) 2026-02-10 16:02:28 +06:00
cc5056b685 make chats to support private forums 2026-01-07 23:19:12 +06:00
9713a668e2 start 31.0.0 2026-01-07 20:45:29 +06:00
90d7bdff56 Merge pull request #1020 from InsanusMokrassar/30.0.2
30.0.2
2025-11-23 17:44:13 +06:00
374f6a93bd hotifx of changelog 2025-11-23 17:43:58 +06:00
28b5fae760 fix of #1019 and improve longPollingFlow 2025-11-23 17:35:59 +06:00
97dae295d6 update dependencies 2025-11-23 16:55:54 +06:00
93597f3940 start 30.0.2 2025-11-23 14:25:58 +06:00
f27caaecde Merge pull request #1014 from InsanusMokrassar/30.0.1
30.0.1
2025-11-07 14:58:22 +06:00
b71b1414b9 fix of target version 2025-10-22 01:52:00 +06:00
f8ceab7640 small hotfix 2025-10-22 01:51:20 +06:00
68897c89c3 start 30.0.1 2025-10-21 23:27:43 +06:00
fb08b7044e Merge pull request #1012 from InsanusMokrassar/30.0.0
30.0.0
2025-10-21 22:25:26 +06:00
7ed021b5bc fill changelog 2025-10-21 22:24:58 +06:00
1cff533265 update dependencies and fix (?) build 2025-10-20 22:44:16 +06:00
8b08e11441 migrate onto 30.0.0 2025-10-20 21:21:31 +06:00
b69c8f1d8f update dependencies
com.github.ben-manes.versions: 0.52.0 -> 0.53.0
2025-10-19 23:33:10 +06:00
fdf393405c start 29.1.0 2025-10-19 22:57:12 +06:00
c951fc3353 Merge pull request #1010 from InsanusMokrassar/29.0.1
29.0.1
2025-10-13 23:10:42 +06:00
02f42c3f52 fix of name for publishing in nexus 2025-10-12 21:46:35 +06:00
0105e46a5f apiDump 2025-10-12 21:22:34 +06:00
325a189ebb fix of #917 2025-10-12 21:09:38 +06:00
1d021c8450 start 29.0.1 2025-10-12 21:07:55 +06:00
6eb9379e0a Merge pull request #998 from InsanusMokrassar/29.0.0
29.0.0
2025-09-25 15:07:02 +06:00
2d97d10ee1 fill changelog and readme 2025-09-25 14:25:22 +06:00
4b7d052ece rewrite firstOf 2025-09-25 14:25:08 +06:00
df512a917b Merge branch 'master' into 29.0.0 2025-09-23 18:21:13 +06:00
67cd836466 Merge pull request #1005 from InsanusMokrassar/28.0.3
28.0.3
2025-09-23 18:17:11 +06:00
3f61cfdefb fix of paid message building 2025-09-23 16:12:40 +06:00
91339fc839 rewrite firstof 2025-09-23 13:37:59 +06:00
2e23f48350 fixes in CommonChannelDirectMessagesEventMessage creating 2025-09-23 12:47:58 +06:00
f6211d33bb change events hierarchy of ChannelDirectMessagesEvent 2025-09-23 12:16:30 +06:00
2ff11ad73c improve messages hierarchy 2025-09-22 12:19:34 +06:00
2695b03968 fix of direct message typing 2025-09-17 23:31:08 +06:00
03d23a938e fixes of inheritance of messages for direct ones 2025-09-17 22:46:51 +06:00
719fb1f4a9 complete adding of suggestedPostParameters 2025-09-17 20:21:55 +06:00
c3c69f3e7f some step 2025-09-17 16:30:41 +06:00
4fb662c560 third stage of suggested_post_parameters implementation 2025-09-15 18:14:51 +06:00
cc967c2981 add suggestedPostParameters in contents 2025-09-15 17:53:59 +06:00
aa7bf426f1 second stage of suggested_post_parameters implementation 2025-09-15 17:49:33 +06:00
0b2735ca1e add support of suggestedPostParameters in requests 2025-09-15 16:46:44 +06:00
48bfa76b9e implemented direct message thread id????? 2025-09-15 12:32:35 +06:00
79a0e202d8 fix of directMessageThreadId passes 2025-09-15 12:32:35 +06:00
152bf2af02 fix of apiDump 2025-09-15 12:32:35 +06:00
0163e5ce8c fix of apiDump 2025-09-15 00:32:25 +06:00
62b4a21650 some progress on support of directMessageThreadId 2025-09-15 00:12:53 +06:00
f312e04c0d add directMessageThreadId parameter in create resend 2025-09-14 23:19:54 +06:00
1c36c0a2f7 add directMessageThreadId in factories of sending classes 2025-09-14 15:14:38 +06:00
bd73852253 let forwardMessage(s) extend OptionallyDirectMessageThreadRequest 2025-09-14 14:48:20 +06:00
fbb2511fca Merge branch 'master' into 29.0.0 2025-09-14 14:43:49 +06:00
8101c4c9fb add publisher_chat support 2025-09-09 18:00:53 +06:00
255416f72a add support of appriveSuggestedPost and declineSuggestedPost 2025-09-09 17:34:48 +06:00
6eb7563c70 add support of is_paid_post field 2025-09-09 17:15:59 +06:00
b9bdf7cc72 add is_paid_post as simple boolean 2025-09-09 17:12:16 +06:00
4a8e1ee7b7 upfix for updating of chat member rights 2025-09-09 17:02:54 +06:00
23bfe02e6f add support of can_manage_direct_messages right 2025-09-09 16:58:47 +06:00
658c19092c Merge branch 'master' into 29.0.0 2025-09-04 16:39:36 +06:00
ebc1c07404 small improvements 2025-09-04 16:09:30 +06:00
989d33acb8 start separate channel direct messages thread id insttead of one merged message thread id 2025-09-03 19:44:42 +06:00
5aa6ac3320 separate messageThreadId with direct_messages_topic in chats creation 2025-08-25 16:48:01 +06:00
048f65b8d4 Partially add DirectMessagesTopic 2025-08-25 16:39:23 +06:00
b69be31362 add a lot of things from update 2025-08-25 15:43:42 +06:00
b92288d7cc add realization of several suggested post events 2025-08-23 16:09:17 +06:00
6c02d57197 add support of reply_to_checklist_task_id 2025-08-19 12:59:29 +06:00
e977c865ea add ReplyParameters#checklistTaskId -.- 2025-08-19 12:30:12 +06:00
18b459fdf8 start 29.0.0 2025-08-19 11:46:36 +06:00
231 changed files with 16084 additions and 5451 deletions

View File

@@ -28,7 +28,7 @@ jobs:
env: env:
GITHUB_USER: ${{ github.actor }} GITHUB_USER: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish to Gitea - name: Publish to InmoNexus
continue-on-error: true continue-on-error: true
run: ./gradlew publishAllPublicationsToInmoNexusRepository run: ./gradlew publishAllPublicationsToInmoNexusRepository
env: env:

View File

@@ -1,5 +1,116 @@
# TelegramBotAPI changelog # TelegramBotAPI changelog
## 31.0.0
**THIS UPDATE CONTAINS ADDING SUPPORT OF [Telegram Bots API 9.3](https://core.telegram.org/bots/api-changelog#december-31-2025)**
**THIS UPDATE CONTAINS ADDING SUPPORT OF [Telegram Bots API 9.4](https://core.telegram.org/bots/api-changelog#february-9-2026)**
**THIS UPDATE CONTAINS BREAKING CHANGES**
* `Version`:
* `MicroUtils`: `0.26.8` -> `0.26.9`
* `Core`:
* **THIS IS BREAKING CHANGE** All media files with sizes changed type of `fileSize` field from `Long` to `FileSize` (value class)
* **THIS IS BREAKING CHANGE** Class `GiftSentOrReceived` have been renamed to `GiftSentOrReceivedEvent` to clarify naming
* **THIS IS BREAKING CHANGE** New interface `OwnedGift` have been created
* **THIS IS BREAKING CHANGE** `OwnedGifts` have changed its generic type to `OwnedGift`
* **THIS IS BREAKING CHANGE** For `CheclistTask` have been made several changes:
* `ChecklistTask.Done` -> `ChecklistTask.Completed`
* `ChecklistTask.Undone` -> `ChecklistTask.Uncompleted`
* Added several inheritors of `ChecklistTask.Completed` - for completed by chat, by user or just completed tasks
* **THIS IS BREAKING CHANGE** `PrivateChat.id` type changed from `UserId` to `IdChatIdentifier`
* **THIS IS BREAKING CHANGE** `ForumChat` no longer extends `SupergroupChat`; new `SupergroupForumChat` interface created for supergroup forums
* **THIS IS BREAKING CHANGE** Added `PrivateForumChat` and `PrivateUserChat` interfaces to support private forums
* Added support of private forums (`ExtendedPrivateForumChatImpl`, `PrivateForumContentMessage`, `PrivateForumEventMessage`)
* Added `ChatOwnerChanged` and `ChatOwnerLeft` chat events
* Added `SetMyProfilePhoto` and `RemoveMyProfilePhoto` requests
* Added `GetUserProfileAudios` request and `UserProfileAudios` type
* Added `GetChatGifts` and `GetUserGifts` requests
* Added `RepostStory` request
* Added `SendMessageDraft` request with `DraftId` and `DraftIdAllocator`
* Added `KeyboardButtonStyle` support and `iconCustomEmojiId` field to keyboard buttons
* Added `style` and `iconCustomEmojiId` fields to `InlineKeyboardButton`
* Added `VideoCodec` and `VideoQuality` types
* Added `Rarity`, `GiftBackground`, `UniqueGiftName`, and `UniqueGiftColors` types for gifts
* Added new fields to `Gift.Regular`: `personalTotalCount`, `personalRemainingCount`, `isPremium`, `hasColors`, `background`, `uniqueGiftVariantCount`
* Added `isBurned` field support in `GiftSentOrReceivedEvent`
* Added `UserRating` type and `rating` field to `ExtendedPrivateChat`
* Added `Level` and `Rating` value classes
* Added `uniqueGiftColors` field to extended chats (channel, group, private)
* Added `paidMessageStarCount` field to `ExtendedGroupChat` and `ExtendedPrivateChat`
* Added `firstProfileAudio` field to `ExtendedPrivateChat`
* Added `purchased_paid_media` to updates list
* Added `effectId` support in `CopyMessage` and `ForwardMessage`
* Added `WithOptionalPaidMessageStarCount` interface
* Fixed serialization of `SimpleKeyboardButton`
* Fixed support of `paidMessageStarCount`
* `API`:
* Added extensions for `SetMyProfilePhoto`, `RemoveMyProfilePhoto`, `GetUserProfileAudios`
* Added extensions for `GetChatGifts` and `GetUserGifts`
* Added extensions for `RepostStory`
* Added extensions for `SendMessageDraft`
* Added `effectId` parameter to `copyMessage` and `forwardMessage` extensions
* Added `GetBusinessAccountGifts` extensions improvements
* `BehaviourBuilder`:
* Updated event triggers for new chat events (`ChatOwnerChanged`, `ChatOwnerLeft`, private forum events)
* Updated expectations for new event types
* `Utils`:
* Regenerated class casts extensions
* Updated `InlineKeyboardBuilder` and `ReplyKeyboardBuilder` with `style` and `iconCustomEmojiId` support
## 30.0.2
* `Version`:
* `Kotlin`: `2.2.20` -> `2.2.21`
* `Ktor`: `3.3.1` -> `3.3.2`
* `KSP`: `2.2.20-2.0.4` -> `2.3.2`
* `MicroUtils`: `0.26.6` -> `0.26.8`
* `KSLog`: `1.5.1` -> `1.5.2`
* `Core`:
* Allow to use `SetWebhook` with `maxAllowedConnections` up to `100000` (fix of [#1019](https://github.com/InsanusMokrassar/ktgbotapi/issues/1019))
* `KSP`:
* Fixed annotation property access for KSP2 compatibility using `withNoSuchElementWorkaround`
* Removed `ksp.useKSP2=false` workaround from `gradle.properties` (KSP2 is now properly supported)
* `Utils`:
* Regenerated class casts extensions
* Allow to use custom `GetUpdates` in `longPollingFlow`
## 30.0.1
* `Core`:
* Potential fix of [#989](https://github.com/InsanusMokrassar/ktgbotapi/issues/989) by:
* In long polling have been added check for causing by unresolved address exception
* Add `TelegramBotPipelinesHandler.onRequestExceptionInLimiter` which will be triggered in ANY exception during
request execution
## 30.0.0
**THIS UPDATE MAY CONTAINS BREAKING CHANGES**
* `Version`:
* `Kotlin`: `2.2.10` -> `2.2.20`
* `Ktor`: `3.2.3` -> `3.3.1`
* `MicroUtils`: `0.26.3` -> `0.26.6`
* `KSLog`: `1.5.0` -> `1.5.1`
* `BehaviourBuilder`:
* `DefaultCustomBehaviourContextAndTypeReceiver` now extends `suspend (BC, U) -> R` instead of `CustomBehaviourContextAndTypeReceiver<BC, R, U>` (no changes in api in fact)
## 29.0.1
* `Core`:
* Fix of [#917](https://github.com/InsanusMokrassar/ktgbotapi/issues/917): all `OrderInfo` fields now have defaults nulls
## 29.0.0
**THIS UPDATE CONTAINS ADDING SUPPORT OF [Telegram Bots API 9.2](https://core.telegram.org/bots/api-changelog#august-15-2025)**
**THIS UPDATE CONTAINS BREAKING CHANGES**
* `Core`:
* Add function `firstOfOrNull(vararg suspend () -> T): T?`
* Change logic of `firstOf` - now it works based on merged flows and __do not require__ `CoroutineScope` as receiver
## 28.0.3 ## 28.0.3
* `Core`: * `Core`:
@@ -18,7 +129,7 @@
* `MicroUtils`: `0.26.2` -> `0.26.3` * `MicroUtils`: `0.26.2` -> `0.26.3`
* `Ktor`: `3.2.2` -> `3.2.3` * `Ktor`: `3.2.2` -> `3.2.3`
* `Core`: * `Core`:
* Let all `OptionallyMessageThreadRequest` inheritors to use `@EncodeDefault` annotation to fix default value passing * Let all `OptionallyMessageThreadRequest` inheritors to use `@EncodeDefault` annotation to fix default value passing
## 28.0.0 ## 28.0.0

View File

@@ -1,4 +1,4 @@
# TelegramBotAPI [![Maven Central Version](https://img.shields.io/maven-central/v/dev.inmo/tgbotapi)](https://central.sonatype.com/artifact/dev.inmo/tgbotapi) [![Supported version](https://img.shields.io/badge/Telegram%20Bot%20API-9.1-blue)](https://core.telegram.org/bots/api-changelog#july-3-2025) # TelegramBotAPI [![Maven Central Version](https://img.shields.io/maven-central/v/dev.inmo/tgbotapi)](https://central.sonatype.com/artifact/dev.inmo/tgbotapi) [![Supported version](https://img.shields.io/badge/Telegram%20Bot%20API-9.4-blue)](https://core.telegram.org/bots/api-changelog#february-9-2026)
| Docs | [![KDocs](https://img.shields.io/static/v1?label=Dokka&message=KDocs&color=blue&logo=kotlin)](https://tgbotapi.inmo.dev/index.html) [![Mini tutorial](https://img.shields.io/static/v1?label=Mk&message=Docs&color=blue&logo=mkdocs)](https://docs.inmo.dev/tgbotapi/index.html) | | Docs | [![KDocs](https://img.shields.io/static/v1?label=Dokka&message=KDocs&color=blue&logo=kotlin)](https://tgbotapi.inmo.dev/index.html) [![Mini tutorial](https://img.shields.io/static/v1?label=Mk&message=Docs&color=blue&logo=mkdocs)](https://docs.inmo.dev/tgbotapi/index.html) |
|:----------------------:|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:| |:----------------------:|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|

View File

@@ -5,8 +5,5 @@ kotlin.js.generate.externals=true
kotlin.incremental=true kotlin.incremental=true
kotlin.incremental.js=true kotlin.incremental.js=true
# https://github.com/google/ksp/issues/2491
ksp.useKSP2=false
library_group=dev.inmo library_group=dev.inmo
library_version=28.0.3 library_version=31.0.0

View File

@@ -1,6 +1,6 @@
[versions] [versions]
kotlin = "2.2.10" kotlin = "2.2.21"
kotlin-serialization = "1.9.0" kotlin-serialization = "1.9.0"
kotlin-coroutines = "1.10.2" kotlin-coroutines = "1.10.2"
@@ -8,21 +8,21 @@ javax-activation = "1.1.1"
korlibs = "5.4.0" korlibs = "5.4.0"
uuid = "0.8.4" uuid = "0.8.4"
ktor = "3.2.3" ktor = "3.3.2"
ksp = "2.2.10-2.0.2" ksp = "2.3.2"
kotlin-poet = "2.2.0" kotlin-poet = "2.2.0"
microutils = "0.26.3" microutils = "0.26.9"
kslog = "1.5.0" kslog = "1.5.2"
versions = "0.52.0" versions = "0.53.0"
github-release-plugin = "2.5.2" github-release-plugin = "2.5.2"
dokka = "2.0.0" dokka = "2.0.0"
validator = "0.18.1" validator = "0.18.1"
nmcp = "1.1.0" nmcp = "1.2.0"
[libraries] [libraries]

File diff suppressed because it is too large Load Diff

View File

@@ -3,12 +3,15 @@ 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.DirectMessageThreadId
import dev.inmo.tgbotapi.types.EffectId
import dev.inmo.tgbotapi.types.MessageId import dev.inmo.tgbotapi.types.MessageId
import dev.inmo.tgbotapi.types.MessageThreadId import dev.inmo.tgbotapi.types.MessageThreadId
import dev.inmo.tgbotapi.types.Seconds import dev.inmo.tgbotapi.types.Seconds
import dev.inmo.tgbotapi.types.chat.Chat import dev.inmo.tgbotapi.types.chat.Chat
import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage
import dev.inmo.tgbotapi.types.message.abstracts.PossiblyForwardedMessage import dev.inmo.tgbotapi.types.message.abstracts.PossiblyForwardedMessage
import dev.inmo.tgbotapi.types.directMessageThreadId
import dev.inmo.tgbotapi.types.threadId import dev.inmo.tgbotapi.types.threadId
public suspend fun TelegramBot.forwardMessage( public suspend fun TelegramBot.forwardMessage(
@@ -16,11 +19,23 @@ public suspend fun TelegramBot.forwardMessage(
toChatId: ChatIdentifier, toChatId: ChatIdentifier,
messageId: MessageId, messageId: MessageId,
threadId: MessageThreadId? = toChatId.threadId, threadId: MessageThreadId? = toChatId.threadId,
directMessageThreadId: DirectMessageThreadId? = toChatId.directMessageThreadId,
startTimestamp: Seconds? = null, startTimestamp: Seconds? = null,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false protectContent: Boolean = false,
effectId: EffectId? = null
): PossiblyForwardedMessage = execute( ): PossiblyForwardedMessage = execute(
ForwardMessage(fromChatId, toChatId, messageId, threadId, startTimestamp, disableNotification, protectContent) ForwardMessage(
fromChatId = fromChatId,
toChatId = toChatId,
messageId = messageId,
threadId = threadId,
directMessageThreadId = directMessageThreadId,
startTimestamp = startTimestamp,
disableNotification = disableNotification,
protectContent = protectContent,
effectId = effectId
)
) )
public suspend fun TelegramBot.forwardMessage( public suspend fun TelegramBot.forwardMessage(
@@ -28,45 +43,105 @@ public suspend fun TelegramBot.forwardMessage(
toChatId: ChatIdentifier, toChatId: ChatIdentifier,
messageId: MessageId, messageId: MessageId,
threadId: MessageThreadId? = toChatId.threadId, threadId: MessageThreadId? = toChatId.threadId,
directMessageThreadId: DirectMessageThreadId? = toChatId.directMessageThreadId,
startTimestamp: Seconds? = null, startTimestamp: Seconds? = null,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false protectContent: Boolean = false,
): PossiblyForwardedMessage = forwardMessage(fromChat.id, toChatId, messageId, threadId, startTimestamp, disableNotification, protectContent) effectId: EffectId? = null
): PossiblyForwardedMessage = forwardMessage(
fromChatId = fromChat.id,
toChatId = toChatId,
messageId = messageId,
threadId = threadId,
directMessageThreadId = directMessageThreadId,
startTimestamp = startTimestamp,
disableNotification = disableNotification,
protectContent = protectContent,
effectId = effectId
)
public suspend fun TelegramBot.forwardMessage( public suspend fun TelegramBot.forwardMessage(
fromChatId: ChatIdentifier, fromChatId: ChatIdentifier,
toChat: Chat, toChat: Chat,
messageId: MessageId, messageId: MessageId,
threadId: MessageThreadId? = toChat.id.threadId, threadId: MessageThreadId? = toChat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = toChat.id.directMessageThreadId,
startTimestamp: Seconds? = null, startTimestamp: Seconds? = null,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false protectContent: Boolean = false,
): PossiblyForwardedMessage = forwardMessage(fromChatId, toChat.id, messageId, threadId, startTimestamp, disableNotification, protectContent) effectId: EffectId? = null
): PossiblyForwardedMessage = forwardMessage(
fromChatId = fromChatId,
toChatId = toChat.id,
messageId = messageId,
threadId = threadId,
directMessageThreadId = directMessageThreadId,
startTimestamp = startTimestamp,
disableNotification = disableNotification,
protectContent = protectContent,
effectId = effectId
)
public suspend fun TelegramBot.forwardMessage( public suspend fun TelegramBot.forwardMessage(
fromChat: Chat, fromChat: Chat,
toChat: Chat, toChat: Chat,
messageId: MessageId, messageId: MessageId,
threadId: MessageThreadId? = toChat.id.threadId, threadId: MessageThreadId? = toChat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = toChat.id.directMessageThreadId,
startTimestamp: Seconds? = null, startTimestamp: Seconds? = null,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false protectContent: Boolean = false,
): PossiblyForwardedMessage = forwardMessage(fromChat.id, toChat.id, messageId, threadId, startTimestamp, disableNotification, protectContent) effectId: EffectId? = null
): PossiblyForwardedMessage = forwardMessage(
fromChatId = fromChat.id,
toChatId = toChat.id,
messageId = messageId,
threadId = threadId,
directMessageThreadId = directMessageThreadId,
startTimestamp = startTimestamp,
disableNotification = disableNotification,
protectContent = protectContent,
effectId = effectId
)
public suspend fun TelegramBot.forwardMessage( public suspend fun TelegramBot.forwardMessage(
toChatId: ChatIdentifier, toChatId: ChatIdentifier,
message: AccessibleMessage, message: AccessibleMessage,
threadId: MessageThreadId? = toChatId.threadId, threadId: MessageThreadId? = toChatId.threadId,
directMessageThreadId: DirectMessageThreadId? = toChatId.directMessageThreadId,
startTimestamp: Seconds? = null, startTimestamp: Seconds? = null,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false protectContent: Boolean = false,
): PossiblyForwardedMessage = forwardMessage(message.chat, toChatId, message.messageId, threadId, startTimestamp, disableNotification, protectContent) effectId: EffectId? = null
): PossiblyForwardedMessage = forwardMessage(
fromChat = message.chat,
toChatId = toChatId,
messageId = message.messageId,
threadId = threadId,
directMessageThreadId = directMessageThreadId,
startTimestamp = startTimestamp,
disableNotification = disableNotification,
protectContent = protectContent,
effectId = effectId
)
public suspend fun TelegramBot.forwardMessage( public suspend fun TelegramBot.forwardMessage(
toChat: Chat, toChat: Chat,
message: AccessibleMessage, message: AccessibleMessage,
threadId: MessageThreadId? = toChat.id.threadId, threadId: MessageThreadId? = toChat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = toChat.id.directMessageThreadId,
startTimestamp: Seconds? = null, startTimestamp: Seconds? = null,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false protectContent: Boolean = false,
): PossiblyForwardedMessage = forwardMessage(message.chat, toChat, message.messageId, threadId, startTimestamp, disableNotification, protectContent) effectId: EffectId? = null
): PossiblyForwardedMessage = forwardMessage(
fromChat = message.chat,
toChat = toChat,
messageId = message.messageId,
threadId = threadId,
directMessageThreadId = directMessageThreadId,
startTimestamp = startTimestamp,
disableNotification = disableNotification,
protectContent = protectContent,
effectId = effectId
)

View File

@@ -13,6 +13,7 @@ public suspend fun TelegramBot.forwardMessages(
fromChatId: ChatIdentifier, fromChatId: ChatIdentifier,
messageIds: List<MessageId>, messageIds: List<MessageId>,
threadId: MessageThreadId? = toChatId.threadId, threadId: MessageThreadId? = toChatId.threadId,
directMessageThreadId: DirectMessageThreadId? = toChatId.directMessageThreadId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
removeCaption: Boolean = false removeCaption: Boolean = false
@@ -23,6 +24,7 @@ public suspend fun TelegramBot.forwardMessages(
fromChatId = fromChatId, fromChatId = fromChatId,
messageIds = it, messageIds = it,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
removeCaption = removeCaption removeCaption = removeCaption
@@ -35,6 +37,7 @@ public suspend fun TelegramBot.forwardMessages(
fromChatId: ChatIdentifier, fromChatId: ChatIdentifier,
messageIds: Array<MessageId>, messageIds: Array<MessageId>,
threadId: MessageThreadId? = toChatId.threadId, threadId: MessageThreadId? = toChatId.threadId,
directMessageThreadId: DirectMessageThreadId? = toChatId.directMessageThreadId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
removeCaption: Boolean = false removeCaption: Boolean = false
@@ -43,6 +46,7 @@ public suspend fun TelegramBot.forwardMessages(
fromChatId = fromChatId, fromChatId = fromChatId,
messageIds = messageIds.toList(), messageIds = messageIds.toList(),
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
removeCaption = removeCaption removeCaption = removeCaption
@@ -52,6 +56,7 @@ public suspend fun TelegramBot.forwardMessages(
toChatId: ChatIdentifier, toChatId: ChatIdentifier,
messagesMetas: List<Message.MetaInfo>, messagesMetas: List<Message.MetaInfo>,
threadId: MessageThreadId? = toChatId.threadId, threadId: MessageThreadId? = toChatId.threadId,
directMessageThreadId: DirectMessageThreadId? = toChatId.directMessageThreadId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
removeCaption: Boolean = false removeCaption: Boolean = false
@@ -61,6 +66,7 @@ public suspend fun TelegramBot.forwardMessages(
fromChatId = chatId, fromChatId = chatId,
messageIds = messages.map { it.messageId }, messageIds = messages.map { it.messageId },
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
removeCaption = removeCaption removeCaption = removeCaption
@@ -72,6 +78,7 @@ public suspend fun TelegramBot.forwardMessages(
toChatId: ChatIdentifier, toChatId: ChatIdentifier,
messages: List<AccessibleMessage>, messages: List<AccessibleMessage>,
threadId: MessageThreadId? = toChatId.threadId, threadId: MessageThreadId? = toChatId.threadId,
directMessageThreadId: DirectMessageThreadId? = toChatId.directMessageThreadId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
removeCaption: Boolean = false removeCaption: Boolean = false
@@ -79,6 +86,7 @@ public suspend fun TelegramBot.forwardMessages(
toChatId = toChatId, toChatId = toChatId,
messagesMetas = messages.map { it.metaInfo }, messagesMetas = messages.map { it.metaInfo },
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
removeCaption = removeCaption removeCaption = removeCaption
@@ -89,6 +97,7 @@ public suspend fun TelegramBot.forward(
fromChatId: ChatIdentifier, fromChatId: ChatIdentifier,
messageIds: List<MessageId>, messageIds: List<MessageId>,
threadId: MessageThreadId? = toChatId.threadId, threadId: MessageThreadId? = toChatId.threadId,
directMessageThreadId: DirectMessageThreadId? = toChatId.directMessageThreadId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
removeCaption: Boolean = false removeCaption: Boolean = false
@@ -97,6 +106,7 @@ public suspend fun TelegramBot.forward(
fromChatId = fromChatId, fromChatId = fromChatId,
messageIds = messageIds, messageIds = messageIds,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
removeCaption = removeCaption removeCaption = removeCaption
@@ -107,6 +117,7 @@ public suspend fun TelegramBot.forward(
fromChatId: ChatIdentifier, fromChatId: ChatIdentifier,
messageIds: Array<MessageId>, messageIds: Array<MessageId>,
threadId: MessageThreadId? = toChatId.threadId, threadId: MessageThreadId? = toChatId.threadId,
directMessageThreadId: DirectMessageThreadId? = toChatId.directMessageThreadId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
removeCaption: Boolean = false removeCaption: Boolean = false
@@ -115,6 +126,7 @@ public suspend fun TelegramBot.forward(
fromChatId = fromChatId, fromChatId = fromChatId,
messageIds = messageIds, messageIds = messageIds,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
removeCaption = removeCaption removeCaption = removeCaption
@@ -124,6 +136,7 @@ public suspend fun TelegramBot.forward(
toChatId: ChatIdentifier, toChatId: ChatIdentifier,
messagesMetas: List<Message.MetaInfo>, messagesMetas: List<Message.MetaInfo>,
threadId: MessageThreadId? = toChatId.threadId, threadId: MessageThreadId? = toChatId.threadId,
directMessageThreadId: DirectMessageThreadId? = toChatId.directMessageThreadId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
removeCaption: Boolean = false removeCaption: Boolean = false
@@ -131,6 +144,7 @@ public suspend fun TelegramBot.forward(
toChatId = toChatId, toChatId = toChatId,
messagesMetas = messagesMetas, messagesMetas = messagesMetas,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
removeCaption = removeCaption removeCaption = removeCaption
@@ -141,6 +155,7 @@ public suspend fun TelegramBot.forward(
toChatId: ChatIdentifier, toChatId: ChatIdentifier,
messages: List<AccessibleMessage>, messages: List<AccessibleMessage>,
threadId: MessageThreadId? = toChatId.threadId, threadId: MessageThreadId? = toChatId.threadId,
directMessageThreadId: DirectMessageThreadId? = toChatId.directMessageThreadId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
removeCaption: Boolean = false removeCaption: Boolean = false
@@ -148,6 +163,7 @@ public suspend fun TelegramBot.forward(
toChatId = toChatId, toChatId = toChatId,
messages = messages, messages = messages,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
removeCaption = removeCaption removeCaption = removeCaption

View File

@@ -15,6 +15,7 @@ import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
import dev.inmo.tgbotapi.types.location.LiveLocation import dev.inmo.tgbotapi.types.location.LiveLocation
import dev.inmo.tgbotapi.types.location.Location import dev.inmo.tgbotapi.types.location.Location
import dev.inmo.tgbotapi.types.message.SuggestedPostParameters
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
import dev.inmo.tgbotapi.types.message.content.LiveLocationContent import dev.inmo.tgbotapi.types.message.content.LiveLocationContent
import dev.inmo.tgbotapi.types.message.content.LocationContent import dev.inmo.tgbotapi.types.message.content.LocationContent
@@ -50,11 +51,13 @@ public suspend fun TelegramBot.handleLiveLocation(
locationsFlow: Flow<EditLiveLocationInfo>, locationsFlow: Flow<EditLiveLocationInfo>,
liveTimeMillis: Long = defaultLivePeriodDelayMillis, liveTimeMillis: Long = defaultLivePeriodDelayMillis,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
sentMessageFlow: FlowCollector<ContentMessage<LiveLocationContent>>? = null sentMessageFlow: FlowCollector<ContentMessage<LiveLocationContent>>? = null
) { ) {
@@ -76,25 +79,27 @@ public suspend fun TelegramBot.handleLiveLocation(
if (capturedLiveLocationMessage == null) { if (capturedLiveLocationMessage == null) {
updateMessageJob ?.start() updateMessageJob ?.start()
currentLiveLocationMessage = send( currentLiveLocationMessage = send(
chatId, chatId = chatId,
it.latitude, latitude = it.latitude,
it.longitude, longitude = it.longitude,
if (liveTimeMillis == indefiniteLivePeriodDelayMillis) { livePeriod = if (liveTimeMillis == indefiniteLivePeriodDelayMillis) {
LiveLocation.INDEFINITE_LIVE_PERIOD LiveLocation.INDEFINITE_LIVE_PERIOD
} else { } else {
ceil(liveTimeMillis.toDouble() / 1000).toInt() ceil(liveTimeMillis.toDouble() / 1000).toInt()
}, },
it.horizontalAccuracy, horizontalAccuracy = it.horizontalAccuracy,
it.heading, heading = it.heading,
it.proximityAlertRadius, proximityAlertRadius = it.proximityAlertRadius,
threadId, threadId = threadId,
businessConnectionId, directMessageThreadId = directMessageThreadId,
disableNotification, businessConnectionId = businessConnectionId,
protectContent, disableNotification = disableNotification,
allowPaidBroadcast, protectContent = protectContent,
effectId, allowPaidBroadcast = allowPaidBroadcast,
replyParameters, effectId = effectId,
it.replyMarkup suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters,
replyMarkup = it.replyMarkup
).also { ).also {
sentMessageFlow ?.emit(it) sentMessageFlow ?.emit(it)
} }
@@ -125,11 +130,13 @@ public suspend fun TelegramBot.handleLiveLocation(
locationsFlow: Flow<Location>, locationsFlow: Flow<Location>,
liveTimeMillis: Long = defaultLivePeriodDelayMillis, liveTimeMillis: Long = defaultLivePeriodDelayMillis,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
sentMessageFlow: FlowCollector<ContentMessage<LiveLocationContent>>? = null sentMessageFlow: FlowCollector<ContentMessage<LiveLocationContent>>? = null
) { ) {
@@ -147,11 +154,13 @@ public suspend fun TelegramBot.handleLiveLocation(
}, },
liveTimeMillis = liveTimeMillis, liveTimeMillis = liveTimeMillis,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
sentMessageFlow = sentMessageFlow sentMessageFlow = sentMessageFlow
) )
@@ -168,11 +177,13 @@ public suspend fun TelegramBot.handleLiveLocation(
locationsFlow: Flow<Pair<Double, Double>>, locationsFlow: Flow<Pair<Double, Double>>,
liveTimeMillis: Long = defaultLivePeriodDelayMillis, liveTimeMillis: Long = defaultLivePeriodDelayMillis,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
sentMessageFlow: FlowCollector<ContentMessage<LiveLocationContent>>? = null sentMessageFlow: FlowCollector<ContentMessage<LiveLocationContent>>? = null
) { ) {
@@ -186,11 +197,13 @@ public suspend fun TelegramBot.handleLiveLocation(
}, },
liveTimeMillis = liveTimeMillis, liveTimeMillis = liveTimeMillis,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
sentMessageFlow = sentMessageFlow sentMessageFlow = sentMessageFlow
) )

View File

@@ -1,3 +1,5 @@
@file:Suppress("KDocUnresolvedReference")
package dev.inmo.tgbotapi.extensions.api package dev.inmo.tgbotapi.extensions.api
import korlibs.time.DateTime import korlibs.time.DateTime
@@ -11,11 +13,13 @@ import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
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.SuggestedPostParameters
import dev.inmo.tgbotapi.types.location.LiveLocation import dev.inmo.tgbotapi.types.location.LiveLocation
import dev.inmo.tgbotapi.types.location.StaticLocation import dev.inmo.tgbotapi.types.location.StaticLocation
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage
import dev.inmo.tgbotapi.types.message.content.LocationContent import dev.inmo.tgbotapi.types.message.content.LocationContent
import dev.inmo.tgbotapi.utils.extensions.directMessageThreadIdOrNull
import dev.inmo.tgbotapi.utils.extensions.threadIdOrNull import dev.inmo.tgbotapi.utils.extensions.threadIdOrNull
import io.ktor.utils.io.core.Closeable import io.ktor.utils.io.core.Closeable
import korlibs.time.millisecondsLong import korlibs.time.millisecondsLong
@@ -96,11 +100,13 @@ public suspend fun TelegramBot.startLiveLocation(
initHeading: Degrees? = null, initHeading: Degrees? = null,
initProximityAlertRadius: Meters? = null, initProximityAlertRadius: Meters? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): LiveLocationProvider { ): LiveLocationProvider {
@@ -115,11 +121,13 @@ public suspend fun TelegramBot.startLiveLocation(
heading = initHeading, heading = initHeading,
proximityAlertRadius = initProximityAlertRadius, proximityAlertRadius = initProximityAlertRadius,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -147,11 +155,13 @@ public suspend fun TelegramBot.startLiveLocation(
initHeading: Degrees? = null, initHeading: Degrees? = null,
initProximityAlertRadius: Meters? = null, initProximityAlertRadius: Meters? = null,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): LiveLocationProvider = startLiveLocation( ): LiveLocationProvider = startLiveLocation(
@@ -164,11 +174,13 @@ public suspend fun TelegramBot.startLiveLocation(
initHeading = initHeading, initHeading = initHeading,
initProximityAlertRadius = initProximityAlertRadius, initProximityAlertRadius = initProximityAlertRadius,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -186,11 +198,13 @@ public suspend fun TelegramBot.startLiveLocation(
initHeading: Degrees? = null, initHeading: Degrees? = null,
initProximityAlertRadius: Meters? = null, initProximityAlertRadius: Meters? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): LiveLocationProvider = startLiveLocation( ): LiveLocationProvider = startLiveLocation(
@@ -203,11 +217,13 @@ public suspend fun TelegramBot.startLiveLocation(
initHeading = initHeading, initHeading = initHeading,
initProximityAlertRadius = initProximityAlertRadius, initProximityAlertRadius = initProximityAlertRadius,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -225,11 +241,13 @@ public suspend fun TelegramBot.startLiveLocation(
initHeading: Degrees? = null, initHeading: Degrees? = null,
initProximityAlertRadius: Meters? = null, initProximityAlertRadius: Meters? = null,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): LiveLocationProvider = startLiveLocation( ): LiveLocationProvider = startLiveLocation(
@@ -242,11 +260,13 @@ public suspend fun TelegramBot.startLiveLocation(
initHeading = initHeading, initHeading = initHeading,
initProximityAlertRadius = initProximityAlertRadius, initProximityAlertRadius = initProximityAlertRadius,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -265,11 +285,13 @@ public suspend inline fun TelegramBot.replyWithLiveLocation(
initHeading: Degrees? = null, initHeading: Degrees? = null,
initProximityAlertRadius: Meters? = null, initProximityAlertRadius: Meters? = null,
threadId: MessageThreadId? = to.threadIdOrNull, threadId: MessageThreadId? = to.threadIdOrNull,
directMessageThreadId: DirectMessageThreadId? = to.directMessageThreadIdOrNull,
businessConnectionId: BusinessConnectionId? = to.businessConnectionId, businessConnectionId: BusinessConnectionId? = to.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): LiveLocationProvider = startLiveLocation( ): LiveLocationProvider = startLiveLocation(
@@ -282,11 +304,13 @@ public suspend inline fun TelegramBot.replyWithLiveLocation(
initHeading = initHeading, initHeading = initHeading,
initProximityAlertRadius = initProximityAlertRadius, initProximityAlertRadius = initProximityAlertRadius,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = ReplyParameters(to.metaInfo, allowSendingWithoutReply = allowSendingWithoutReply), replyParameters = ReplyParameters(to.metaInfo, allowSendingWithoutReply = allowSendingWithoutReply),
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -304,11 +328,13 @@ public suspend inline fun TelegramBot.replyWithLiveLocation(
initHeading: Degrees? = null, initHeading: Degrees? = null,
initProximityAlertRadius: Meters? = null, initProximityAlertRadius: Meters? = null,
threadId: MessageThreadId? = to.threadIdOrNull, threadId: MessageThreadId? = to.threadIdOrNull,
directMessageThreadId: DirectMessageThreadId? = to.directMessageThreadIdOrNull,
businessConnectionId: BusinessConnectionId? = to.businessConnectionId, businessConnectionId: BusinessConnectionId? = to.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): LiveLocationProvider = startLiveLocation( ): LiveLocationProvider = startLiveLocation(
@@ -320,11 +346,13 @@ public suspend inline fun TelegramBot.replyWithLiveLocation(
initHeading = initHeading, initHeading = initHeading,
initProximityAlertRadius = initProximityAlertRadius, initProximityAlertRadius = initProximityAlertRadius,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = ReplyParameters(to.metaInfo, allowSendingWithoutReply = allowSendingWithoutReply), replyParameters = ReplyParameters(to.metaInfo, allowSendingWithoutReply = allowSendingWithoutReply),
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )

View File

@@ -0,0 +1,6 @@
package dev.inmo.tgbotapi.extensions.api.bot
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.bot.RemoveMyProfilePhoto
public suspend fun TelegramBot.removeMyProfilePhoto(): Boolean = execute(RemoveMyProfilePhoto)

View File

@@ -0,0 +1,9 @@
package dev.inmo.tgbotapi.extensions.api.bot
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.bot.SetMyProfilePhoto
import dev.inmo.tgbotapi.requests.business_connection.InputProfilePhoto
public suspend fun TelegramBot.setMyProfilePhoto(
photo: InputProfilePhoto
): Boolean = execute(SetMyProfilePhoto(photo))

View File

@@ -4,7 +4,8 @@ import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.business_connection.GetBusinessAccountGifts import dev.inmo.tgbotapi.requests.business_connection.GetBusinessAccountGifts
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.OwnedGifts import dev.inmo.tgbotapi.types.OwnedGifts
import dev.inmo.tgbotapi.types.gifts.GiftSentOrReceived import dev.inmo.tgbotapi.types.gifts.GiftSentOrReceivedEvent
import dev.inmo.tgbotapi.types.gifts.OwnedGift
import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.flow import kotlinx.coroutines.flow.flow
import kotlin.runCatching import kotlin.runCatching
@@ -14,19 +15,23 @@ public suspend fun TelegramBot.getBusinessAccountGifts(
excludeUnsaved: Boolean = false, excludeUnsaved: Boolean = false,
excludeSaved: Boolean = false, excludeSaved: Boolean = false,
excludeUnlimited: Boolean = false, excludeUnlimited: Boolean = false,
excludeLimited: Boolean = false, excludeLimitedUpgradable: Boolean = false,
excludeLimitedNonUpgradable: Boolean = false,
excludeUnique: Boolean = false, excludeUnique: Boolean = false,
excludeFromBlockchain: Boolean = false,
sortByPrice: Boolean = false, sortByPrice: Boolean = false,
offset: String? = null, offset: String? = null,
limit: Int? = null limit: Int? = null
): OwnedGifts<GiftSentOrReceived.ReceivedInBusinessAccount> = execute( ): OwnedGifts<OwnedGift.OwnedByBusinessAccount> = execute(
GetBusinessAccountGifts( GetBusinessAccountGifts(
businessConnectionId, businessConnectionId,
excludeUnsaved, excludeUnsaved,
excludeSaved, excludeSaved,
excludeUnlimited, excludeUnlimited,
excludeLimited, excludeLimitedUpgradable,
excludeLimitedNonUpgradable,
excludeUnique, excludeUnique,
excludeFromBlockchain,
sortByPrice, sortByPrice,
offset, offset,
limit limit
@@ -43,8 +48,10 @@ public suspend fun TelegramBot.getBusinessAccountGifts(
* @param excludeUnsaved Whether to exclude unsaved gifts * @param excludeUnsaved Whether to exclude unsaved gifts
* @param excludeSaved Whether to exclude saved gifts * @param excludeSaved Whether to exclude saved gifts
* @param excludeUnlimited Whether to exclude unlimited gifts * @param excludeUnlimited Whether to exclude unlimited gifts
* @param excludeLimited Whether to exclude limited gifts * @param excludeLimitedUpgradable Whether to exclude limited upgradable gifts
* @param excludeLimitedNonUpgradable Whether to exclude limited non-upgradable gifts
* @param excludeUnique Whether to exclude unique gifts * @param excludeUnique Whether to exclude unique gifts
* @param excludeFromBlockchain Whether to exclude gifts from blockchain
* @param sortByPrice Whether to sort gifts by price * @param sortByPrice Whether to sort gifts by price
* @param initialOffset The initial offset to start fetching from. If null, starts from the beginning * @param initialOffset The initial offset to start fetching from. If null, starts from the beginning
* @param limit The maximum number of gifts to fetch per request * @param limit The maximum number of gifts to fetch per request
@@ -57,13 +64,15 @@ public fun TelegramBot.getBusinessAccountGiftsFlow(
excludeUnsaved: Boolean = false, excludeUnsaved: Boolean = false,
excludeSaved: Boolean = false, excludeSaved: Boolean = false,
excludeUnlimited: Boolean = false, excludeUnlimited: Boolean = false,
excludeLimited: Boolean = false, excludeLimitedUpgradable: Boolean = false,
excludeLimitedNonUpgradable: Boolean = false,
excludeUnique: Boolean = false, excludeUnique: Boolean = false,
excludeFromBlockchain: Boolean = false,
sortByPrice: Boolean = false, sortByPrice: Boolean = false,
initialOffset: String? = null, initialOffset: String? = null,
limit: Int? = null, limit: Int? = null,
onErrorContinueChecker: suspend (Throwable?) -> Boolean = { false } onErrorContinueChecker: suspend (Throwable?) -> Boolean = { false }
): Flow<OwnedGifts<GiftSentOrReceived.ReceivedInBusinessAccount>> = flow { ): Flow<OwnedGifts<OwnedGift.OwnedByBusinessAccount>> = flow {
var currentOffset = initialOffset var currentOffset = initialOffset
do { do {
val response = runCatching { val response = runCatching {
@@ -72,8 +81,10 @@ public fun TelegramBot.getBusinessAccountGiftsFlow(
excludeUnsaved, excludeUnsaved,
excludeSaved, excludeSaved,
excludeUnlimited, excludeUnlimited,
excludeLimited, excludeLimitedUpgradable,
excludeLimitedNonUpgradable,
excludeUnique, excludeUnique,
excludeFromBlockchain,
sortByPrice, sortByPrice,
currentOffset, currentOffset,
limit limit

View File

@@ -117,6 +117,17 @@ public suspend fun TelegramBot.getChat(
chat: PrivateChatImpl chat: PrivateChatImpl
): ExtendedPrivateChatImpl = getChat(chat.id) as ExtendedPrivateChatImpl ): ExtendedPrivateChatImpl = getChat(chat.id) as ExtendedPrivateChatImpl
/**
* Will cast incoming [dev.inmo.tgbotapi.types.chat.ExtendedChat] to a
* [ExtendedPrivateForumChatImpl] with unsafe operator "as"
*
* @throws ClassCastException
*/
@PreviewFeature
public suspend fun TelegramBot.getChat(
chat: PrivateForumChatImpl
): ExtendedPrivateForumChatImpl = getChat(chat.id) as ExtendedPrivateForumChatImpl
/** /**
* Will cast incoming [dev.inmo.tgbotapi.types.chat.ExtendedChat] to a * Will cast incoming [dev.inmo.tgbotapi.types.chat.ExtendedChat] to a
* [ExtendedUser] with unsafe operator "as" * [ExtendedUser] with unsafe operator "as"

View File

@@ -2,7 +2,6 @@ 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.PromoteChannelAdministrator import dev.inmo.tgbotapi.requests.chat.members.PromoteChannelAdministrator
import dev.inmo.tgbotapi.requests.chat.members.PromoteChatMember
import dev.inmo.tgbotapi.types.IdChatIdentifier import dev.inmo.tgbotapi.types.IdChatIdentifier
import dev.inmo.tgbotapi.types.ChatIdentifier import dev.inmo.tgbotapi.types.ChatIdentifier
import dev.inmo.tgbotapi.types.TelegramDate import dev.inmo.tgbotapi.types.TelegramDate
@@ -26,7 +25,8 @@ public suspend fun TelegramBot.promoteChannelAdministrator(
canManageChat: Boolean? = null, canManageChat: Boolean? = null,
canPostStories: Boolean? = null, canPostStories: Boolean? = null,
canEditStories: Boolean? = null, canEditStories: Boolean? = null,
canDeleteStories: Boolean? = null canDeleteStories: Boolean? = null,
canManageDirectMessages: Boolean? = null,
): Boolean = execute( ): Boolean = execute(
PromoteChannelAdministrator( PromoteChannelAdministrator(
chatId = chatId, chatId = chatId,
@@ -44,7 +44,8 @@ public suspend fun TelegramBot.promoteChannelAdministrator(
canManageChat = canManageChat, canManageChat = canManageChat,
canPostStories = canPostStories, canPostStories = canPostStories,
canEditStories = canEditStories, canEditStories = canEditStories,
canDeleteStories = canDeleteStories canDeleteStories = canDeleteStories,
canManageDirectMessages = canManageDirectMessages,
) )
) )
@@ -64,7 +65,8 @@ public suspend fun TelegramBot.promoteChannelAdministrator(
canManageChat: Boolean? = null, canManageChat: Boolean? = null,
canPostStories: Boolean? = null, canPostStories: Boolean? = null,
canEditStories: Boolean? = null, canEditStories: Boolean? = null,
canDeleteStories: Boolean? = null canDeleteStories: Boolean? = null,
canManageDirectMessages: Boolean? = null,
): Boolean = promoteChannelAdministrator( ): Boolean = promoteChannelAdministrator(
chat.id, chat.id,
userId, userId,
@@ -81,7 +83,8 @@ public suspend fun TelegramBot.promoteChannelAdministrator(
canManageChat = canManageChat, canManageChat = canManageChat,
canPostStories = canPostStories, canPostStories = canPostStories,
canEditStories = canEditStories, canEditStories = canEditStories,
canDeleteStories = canDeleteStories canDeleteStories = canDeleteStories,
canManageDirectMessages = canManageDirectMessages,
) )
public suspend fun TelegramBot.promoteChannelAdministrator( public suspend fun TelegramBot.promoteChannelAdministrator(
@@ -100,7 +103,8 @@ public suspend fun TelegramBot.promoteChannelAdministrator(
canManageChat: Boolean? = null, canManageChat: Boolean? = null,
canPostStories: Boolean? = null, canPostStories: Boolean? = null,
canEditStories: Boolean? = null, canEditStories: Boolean? = null,
canDeleteStories: Boolean? = null canDeleteStories: Boolean? = null,
canManageDirectMessages: Boolean? = null,
): Boolean = promoteChannelAdministrator( ): Boolean = promoteChannelAdministrator(
chatId, chatId,
user.id, user.id,
@@ -117,7 +121,8 @@ public suspend fun TelegramBot.promoteChannelAdministrator(
canManageChat = canManageChat, canManageChat = canManageChat,
canPostStories = canPostStories, canPostStories = canPostStories,
canEditStories = canEditStories, canEditStories = canEditStories,
canDeleteStories = canDeleteStories canDeleteStories = canDeleteStories,
canManageDirectMessages = canManageDirectMessages,
) )
public suspend fun TelegramBot.promoteChannelAdministrator( public suspend fun TelegramBot.promoteChannelAdministrator(
@@ -136,7 +141,8 @@ public suspend fun TelegramBot.promoteChannelAdministrator(
canManageChat: Boolean? = null, canManageChat: Boolean? = null,
canPostStories: Boolean? = null, canPostStories: Boolean? = null,
canEditStories: Boolean? = null, canEditStories: Boolean? = null,
canDeleteStories: Boolean? = null canDeleteStories: Boolean? = null,
canManageDirectMessages: Boolean? = null,
): Boolean = promoteChannelAdministrator( ): Boolean = promoteChannelAdministrator(
chat.id, chat.id,
user.id, user.id,
@@ -153,5 +159,6 @@ public suspend fun TelegramBot.promoteChannelAdministrator(
canManageChat = canManageChat, canManageChat = canManageChat,
canPostStories = canPostStories, canPostStories = canPostStories,
canEditStories = canEditStories, canEditStories = canEditStories,
canDeleteStories = canDeleteStories canDeleteStories = canDeleteStories,
canManageDirectMessages = canManageDirectMessages,
) )

View File

@@ -26,7 +26,8 @@ public suspend fun TelegramBot.promoteChatMember(
canManageTopics: Boolean? = null, canManageTopics: Boolean? = null,
canPostStories: Boolean? = null, canPostStories: Boolean? = null,
canEditStories: Boolean? = null, canEditStories: Boolean? = null,
canDeleteStories: Boolean? = null canDeleteStories: Boolean? = null,
canManageDirectMessages: Boolean? = null
): Boolean = execute( ): Boolean = execute(
PromoteChatMember( PromoteChatMember(
chatId = chatId, chatId = chatId,
@@ -46,7 +47,8 @@ public suspend fun TelegramBot.promoteChatMember(
canManageTopics = canManageTopics, canManageTopics = canManageTopics,
canPostStories = canPostStories, canPostStories = canPostStories,
canEditStories = canEditStories, canEditStories = canEditStories,
canDeleteStories = canDeleteStories canDeleteStories = canDeleteStories,
canManageDirectMessages = canManageDirectMessages,
) )
) )
@@ -69,7 +71,8 @@ public suspend fun TelegramBot.promoteChatMember(
canManageTopics: Boolean? = null, canManageTopics: Boolean? = null,
canPostStories: Boolean? = null, canPostStories: Boolean? = null,
canEditStories: Boolean? = null, canEditStories: Boolean? = null,
canDeleteStories: Boolean? = null canDeleteStories: Boolean? = null,
canManageDirectMessages: Boolean? = null
): Boolean = promoteChatMember( ): Boolean = promoteChatMember(
chat.id, chat.id,
userId, userId,
@@ -88,7 +91,8 @@ public suspend fun TelegramBot.promoteChatMember(
canManageTopics = canManageTopics, canManageTopics = canManageTopics,
canPostStories = canPostStories, canPostStories = canPostStories,
canEditStories = canEditStories, canEditStories = canEditStories,
canDeleteStories = canDeleteStories canDeleteStories = canDeleteStories,
canManageDirectMessages = canManageDirectMessages,
) )
@Warning("This method is too common. Use it with caution") @Warning("This method is too common. Use it with caution")
@@ -110,7 +114,8 @@ public suspend fun TelegramBot.promoteChatMember(
canManageTopics: Boolean? = null, canManageTopics: Boolean? = null,
canPostStories: Boolean? = null, canPostStories: Boolean? = null,
canEditStories: Boolean? = null, canEditStories: Boolean? = null,
canDeleteStories: Boolean? = null canDeleteStories: Boolean? = null,
canManageDirectMessages: Boolean? = null
): Boolean = promoteChatMember( ): Boolean = promoteChatMember(
chatId, chatId,
user.id, user.id,
@@ -129,7 +134,8 @@ public suspend fun TelegramBot.promoteChatMember(
canManageTopics = canManageTopics, canManageTopics = canManageTopics,
canPostStories = canPostStories, canPostStories = canPostStories,
canEditStories = canEditStories, canEditStories = canEditStories,
canDeleteStories = canDeleteStories canDeleteStories = canDeleteStories,
canManageDirectMessages = canManageDirectMessages,
) )
@Warning("This method is too common. Use it with caution") @Warning("This method is too common. Use it with caution")
@@ -151,7 +157,8 @@ public suspend fun TelegramBot.promoteChatMember(
canManageTopics: Boolean? = null, canManageTopics: Boolean? = null,
canPostStories: Boolean? = null, canPostStories: Boolean? = null,
canEditStories: Boolean? = null, canEditStories: Boolean? = null,
canDeleteStories: Boolean? = null canDeleteStories: Boolean? = null,
canManageDirectMessages: Boolean? = null
): Boolean = promoteChatMember( ): Boolean = promoteChatMember(
chat.id, chat.id,
user.id, user.id,
@@ -170,5 +177,6 @@ public suspend fun TelegramBot.promoteChatMember(
canManageTopics = canManageTopics, canManageTopics = canManageTopics,
canPostStories = canPostStories, canPostStories = canPostStories,
canEditStories = canEditStories, canEditStories = canEditStories,
canDeleteStories = canDeleteStories canDeleteStories = canDeleteStories,
canManageDirectMessages = canManageDirectMessages,
) )

View File

@@ -0,0 +1,23 @@
package dev.inmo.tgbotapi.extensions.api.get
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.get.GetUserProfileAudios
import dev.inmo.tgbotapi.types.chat.CommonUser
import dev.inmo.tgbotapi.types.UserId
import dev.inmo.tgbotapi.types.UserProfileAudios
public suspend fun TelegramBot.getUserProfileAudios(
userId: UserId,
offset: Int? = null,
limit: Int? = null
): UserProfileAudios = execute(
GetUserProfileAudios(
userId = userId, offset = offset, limit = limit
)
)
public suspend fun TelegramBot.getUserProfileAudios(
user: CommonUser,
offset: Int? = null,
limit: Int? = null
): UserProfileAudios = getUserProfileAudios(userId = user.id, offset = offset, limit = limit)

View File

@@ -0,0 +1,83 @@
package dev.inmo.tgbotapi.extensions.api.gifts
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.gifts.GetChatGifts
import dev.inmo.tgbotapi.types.ChatIdentifier
import dev.inmo.tgbotapi.types.OwnedGifts
import dev.inmo.tgbotapi.types.gifts.GiftSentOrReceivedEvent
import dev.inmo.tgbotapi.types.gifts.OwnedGift
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.flow
public suspend fun TelegramBot.getChatGifts(
chatId: ChatIdentifier,
excludeUnsaved: Boolean = false,
excludeSaved: Boolean = false,
excludeUnlimited: Boolean = false,
excludeLimitedUpgradable: Boolean = false,
excludeLimitedNonUpgradable: Boolean = false,
excludeFromBlockchain: Boolean = false,
excludeUnique: Boolean = false,
sortByPrice: Boolean = false,
offset: String? = null,
limit: Int? = null
): OwnedGifts<OwnedGift.Common> = execute(
GetChatGifts(
chatId,
excludeUnsaved,
excludeSaved,
excludeUnlimited,
excludeLimitedUpgradable,
excludeLimitedNonUpgradable,
excludeFromBlockchain,
excludeUnique,
sortByPrice,
offset,
limit
)
)
public fun TelegramBot.getChatGiftsFlow(
chatId: ChatIdentifier,
excludeUnsaved: Boolean = false,
excludeSaved: Boolean = false,
excludeUnlimited: Boolean = false,
excludeLimitedUpgradable: Boolean = false,
excludeLimitedNonUpgradable: Boolean = false,
excludeFromBlockchain: Boolean = false,
excludeUnique: Boolean = false,
sortByPrice: Boolean = false,
initialOffset: String? = null,
limit: Int? = null,
onErrorContinueChecker: suspend (Throwable?) -> Boolean = { false }
): Flow<OwnedGifts<OwnedGift.Common>> = flow {
var currentOffset = initialOffset
do {
val response = runCatching {
getChatGifts(
chatId,
excludeUnsaved,
excludeSaved,
excludeUnlimited,
excludeLimitedUpgradable,
excludeLimitedNonUpgradable,
excludeFromBlockchain,
excludeUnique,
sortByPrice,
currentOffset,
limit
)
}
if (response.isSuccess) {
val result = response.getOrThrow()
emit(result)
currentOffset = result.nextOffset
} else {
if (onErrorContinueChecker(response.exceptionOrNull())) {
continue
} else {
break
}
}
} while (currentOffset != null)
}

View File

@@ -0,0 +1,75 @@
package dev.inmo.tgbotapi.extensions.api.gifts
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.gifts.GetUserGifts
import dev.inmo.tgbotapi.types.OwnedGifts
import dev.inmo.tgbotapi.types.UserId
import dev.inmo.tgbotapi.types.gifts.GiftSentOrReceivedEvent
import dev.inmo.tgbotapi.types.gifts.OwnedGift
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.flow
public suspend fun TelegramBot.getUserGifts(
userId: UserId,
excludeUnlimited: Boolean = false,
excludeLimitedUpgradable: Boolean = false,
excludeLimitedNonUpgradable: Boolean = false,
excludeFromBlockchain: Boolean = false,
excludeUnique: Boolean = false,
sortByPrice: Boolean = false,
offset: String? = null,
limit: Int? = null
): OwnedGifts<OwnedGift.Common> = execute(
GetUserGifts(
userId,
excludeUnlimited,
excludeLimitedUpgradable,
excludeLimitedNonUpgradable,
excludeFromBlockchain,
excludeUnique,
sortByPrice,
offset,
limit
)
)
public fun TelegramBot.getUserGiftsFlow(
userId: UserId,
excludeUnlimited: Boolean = false,
excludeLimitedUpgradable: Boolean = false,
excludeLimitedNonUpgradable: Boolean = false,
excludeFromBlockchain: Boolean = false,
excludeUnique: Boolean = false,
sortByPrice: Boolean = false,
initialOffset: String? = null,
limit: Int? = null,
onErrorContinueChecker: suspend (Throwable?) -> Boolean = { false }
): Flow<OwnedGifts<OwnedGift.Common>> = flow {
var currentOffset = initialOffset
do {
val response = runCatching {
getUserGifts(
userId,
excludeUnlimited,
excludeLimitedUpgradable,
excludeLimitedNonUpgradable,
excludeFromBlockchain,
excludeUnique,
sortByPrice,
currentOffset,
limit
)
}
if (response.isSuccess) {
val result = response.getOrThrow()
emit(result)
currentOffset = result.nextOffset
} else {
if (onErrorContinueChecker(response.exceptionOrNull())) {
continue
} else {
break
}
}
} while (currentOffset != null)
}

View File

@@ -1,3 +1,5 @@
@file:Suppress("KDocUnresolvedReference")
package dev.inmo.tgbotapi.extensions.api.send package dev.inmo.tgbotapi.extensions.api.send
import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.bot.TelegramBot
@@ -5,6 +7,7 @@ import dev.inmo.tgbotapi.requests.send.CopyMessage
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
import dev.inmo.tgbotapi.types.message.ParseMode import dev.inmo.tgbotapi.types.message.ParseMode
import dev.inmo.tgbotapi.types.message.SuggestedPostParameters
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.abstracts.AccessibleMessage import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage
@@ -21,10 +24,13 @@ public suspend inline fun TelegramBot.copyMessage(
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
showCaptionAboveMedia: Boolean = false, showCaptionAboveMedia: Boolean = false,
threadId: MessageThreadId? = toChatId.threadId, threadId: MessageThreadId? = toChatId.threadId,
directMessageThreadId: DirectMessageThreadId? = toChatId.directMessageThreadId,
startTimestamp: Seconds? = null, startTimestamp: Seconds? = null,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): MessageId = execute( ): MessageId = execute(
@@ -36,10 +42,13 @@ public suspend inline fun TelegramBot.copyMessage(
parseMode = parseMode, parseMode = parseMode,
showCaptionAboveMedia = showCaptionAboveMedia, showCaptionAboveMedia = showCaptionAboveMedia,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
startTimestamp = startTimestamp, startTimestamp = startTimestamp,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -57,10 +66,13 @@ public suspend inline fun TelegramBot.copyMessage(
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
showCaptionAboveMedia: Boolean = false, showCaptionAboveMedia: Boolean = false,
threadId: MessageThreadId? = toChatId.threadId, threadId: MessageThreadId? = toChatId.threadId,
directMessageThreadId: DirectMessageThreadId? = toChatId.directMessageThreadId,
startTimestamp: Seconds? = null, startTimestamp: Seconds? = null,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): MessageId = copyMessage( ): MessageId = copyMessage(
@@ -71,10 +83,13 @@ public suspend inline fun TelegramBot.copyMessage(
parseMode = parseMode, parseMode = parseMode,
showCaptionAboveMedia = showCaptionAboveMedia, showCaptionAboveMedia = showCaptionAboveMedia,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
startTimestamp = startTimestamp, startTimestamp = startTimestamp,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -91,10 +106,13 @@ public suspend inline fun TelegramBot.copyMessage(
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
showCaptionAboveMedia: Boolean = false, showCaptionAboveMedia: Boolean = false,
threadId: MessageThreadId? = toChat.id.threadId, threadId: MessageThreadId? = toChat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = toChat.id.directMessageThreadId,
startTimestamp: Seconds? = null, startTimestamp: Seconds? = null,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): MessageId = copyMessage( ): MessageId = copyMessage(
@@ -105,10 +123,13 @@ public suspend inline fun TelegramBot.copyMessage(
parseMode = parseMode, parseMode = parseMode,
showCaptionAboveMedia = showCaptionAboveMedia, showCaptionAboveMedia = showCaptionAboveMedia,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
startTimestamp = startTimestamp, startTimestamp = startTimestamp,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -125,10 +146,13 @@ public suspend inline fun TelegramBot.copyMessage(
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
showCaptionAboveMedia: Boolean = false, showCaptionAboveMedia: Boolean = false,
threadId: MessageThreadId? = toChat.id.threadId, threadId: MessageThreadId? = toChat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = toChat.id.directMessageThreadId,
startTimestamp: Seconds? = null, startTimestamp: Seconds? = null,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): MessageId = copyMessage( ): MessageId = copyMessage(
@@ -139,10 +163,13 @@ public suspend inline fun TelegramBot.copyMessage(
parseMode = parseMode, parseMode = parseMode,
showCaptionAboveMedia = showCaptionAboveMedia, showCaptionAboveMedia = showCaptionAboveMedia,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
startTimestamp = startTimestamp, startTimestamp = startTimestamp,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -159,10 +186,13 @@ public suspend inline fun TelegramBot.copyMessage(
entities: TextSourcesList, entities: TextSourcesList,
showCaptionAboveMedia: Boolean = false, showCaptionAboveMedia: Boolean = false,
threadId: MessageThreadId? = toChatId.threadId, threadId: MessageThreadId? = toChatId.threadId,
directMessageThreadId: DirectMessageThreadId? = toChatId.directMessageThreadId,
startTimestamp: Seconds? = null, startTimestamp: Seconds? = null,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): MessageId = execute( ): MessageId = execute(
@@ -173,10 +203,13 @@ public suspend inline fun TelegramBot.copyMessage(
entities = entities, entities = entities,
showCaptionAboveMedia = showCaptionAboveMedia, showCaptionAboveMedia = showCaptionAboveMedia,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
startTimestamp = startTimestamp, startTimestamp = startTimestamp,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -193,10 +226,13 @@ public suspend inline fun TelegramBot.copyMessage(
entities: TextSourcesList, entities: TextSourcesList,
showCaptionAboveMedia: Boolean = false, showCaptionAboveMedia: Boolean = false,
threadId: MessageThreadId? = toChatId.threadId, threadId: MessageThreadId? = toChatId.threadId,
directMessageThreadId: DirectMessageThreadId? = toChatId.directMessageThreadId,
startTimestamp: Seconds? = null, startTimestamp: Seconds? = null,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): MessageId = copyMessage( ): MessageId = copyMessage(
@@ -206,10 +242,13 @@ public suspend inline fun TelegramBot.copyMessage(
entities = entities, entities = entities,
showCaptionAboveMedia = showCaptionAboveMedia, showCaptionAboveMedia = showCaptionAboveMedia,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
startTimestamp = startTimestamp, startTimestamp = startTimestamp,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -225,10 +264,13 @@ public suspend inline fun TelegramBot.copyMessage(
entities: TextSourcesList, entities: TextSourcesList,
showCaptionAboveMedia: Boolean = false, showCaptionAboveMedia: Boolean = false,
threadId: MessageThreadId? = toChat.id.threadId, threadId: MessageThreadId? = toChat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = toChat.id.directMessageThreadId,
startTimestamp: Seconds? = null, startTimestamp: Seconds? = null,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): MessageId = copyMessage( ): MessageId = copyMessage(
@@ -238,10 +280,13 @@ public suspend inline fun TelegramBot.copyMessage(
entities = entities, entities = entities,
showCaptionAboveMedia = showCaptionAboveMedia, showCaptionAboveMedia = showCaptionAboveMedia,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
startTimestamp = startTimestamp, startTimestamp = startTimestamp,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -257,10 +302,13 @@ public suspend inline fun TelegramBot.copyMessage(
entities: TextSourcesList, entities: TextSourcesList,
showCaptionAboveMedia: Boolean = false, showCaptionAboveMedia: Boolean = false,
threadId: MessageThreadId? = toChat.id.threadId, threadId: MessageThreadId? = toChat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = toChat.id.directMessageThreadId,
startTimestamp: Seconds? = null, startTimestamp: Seconds? = null,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): MessageId = copyMessage( ): MessageId = copyMessage(
@@ -270,10 +318,13 @@ public suspend inline fun TelegramBot.copyMessage(
entities = entities, entities = entities,
showCaptionAboveMedia = showCaptionAboveMedia, showCaptionAboveMedia = showCaptionAboveMedia,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
startTimestamp = startTimestamp, startTimestamp = startTimestamp,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -289,10 +340,13 @@ public suspend inline fun TelegramBot.copyMessage(
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
showCaptionAboveMedia: Boolean = false, showCaptionAboveMedia: Boolean = false,
threadId: MessageThreadId? = toChatId.threadId, threadId: MessageThreadId? = toChatId.threadId,
directMessageThreadId: DirectMessageThreadId? = toChatId.directMessageThreadId,
startTimestamp: Seconds? = null, startTimestamp: Seconds? = null,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): MessageId = copyMessage( ): MessageId = copyMessage(
@@ -303,10 +357,13 @@ public suspend inline fun TelegramBot.copyMessage(
parseMode = parseMode, parseMode = parseMode,
showCaptionAboveMedia = showCaptionAboveMedia, showCaptionAboveMedia = showCaptionAboveMedia,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
startTimestamp = startTimestamp, startTimestamp = startTimestamp,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -322,10 +379,13 @@ public suspend inline fun TelegramBot.copyMessage(
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
showCaptionAboveMedia: Boolean = false, showCaptionAboveMedia: Boolean = false,
threadId: MessageThreadId? = toChat.id.threadId, threadId: MessageThreadId? = toChat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = toChat.id.directMessageThreadId,
startTimestamp: Seconds? = null, startTimestamp: Seconds? = null,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): MessageId = copyMessage( ): MessageId = copyMessage(
@@ -336,10 +396,13 @@ public suspend inline fun TelegramBot.copyMessage(
parseMode = parseMode, parseMode = parseMode,
showCaptionAboveMedia = showCaptionAboveMedia, showCaptionAboveMedia = showCaptionAboveMedia,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
startTimestamp = startTimestamp, startTimestamp = startTimestamp,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -354,10 +417,13 @@ public suspend inline fun TelegramBot.copyMessage(
entities: TextSourcesList, entities: TextSourcesList,
showCaptionAboveMedia: Boolean = false, showCaptionAboveMedia: Boolean = false,
threadId: MessageThreadId? = toChatId.threadId, threadId: MessageThreadId? = toChatId.threadId,
directMessageThreadId: DirectMessageThreadId? = toChatId.directMessageThreadId,
startTimestamp: Seconds? = null, startTimestamp: Seconds? = null,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): MessageId = copyMessage( ): MessageId = copyMessage(
@@ -367,10 +433,13 @@ public suspend inline fun TelegramBot.copyMessage(
entities = entities, entities = entities,
showCaptionAboveMedia = showCaptionAboveMedia, showCaptionAboveMedia = showCaptionAboveMedia,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
startTimestamp = startTimestamp, startTimestamp = startTimestamp,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -385,10 +454,13 @@ public suspend inline fun TelegramBot.copyMessage(
entities: TextSourcesList, entities: TextSourcesList,
showCaptionAboveMedia: Boolean = false, showCaptionAboveMedia: Boolean = false,
threadId: MessageThreadId? = toChat.id.threadId, threadId: MessageThreadId? = toChat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = toChat.id.directMessageThreadId,
startTimestamp: Seconds? = null, startTimestamp: Seconds? = null,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): MessageId = copyMessage( ): MessageId = copyMessage(
@@ -398,263 +470,13 @@ public suspend inline fun TelegramBot.copyMessage(
entities = entities, entities = entities,
showCaptionAboveMedia = showCaptionAboveMedia, showCaptionAboveMedia = showCaptionAboveMedia,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
startTimestamp = startTimestamp, startTimestamp = startTimestamp,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
//
///**
// * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
// * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
// */
//public suspend inline fun TelegramBot.copyMessage(
// toChatId: ChatIdentifier,
// fromChatId: ChatIdentifier,
// messageId: MessageId,
// text: String? = null,
// parseMode: ParseMode? = null,
// showCaptionAboveMedia: Boolean = false,
// threadId: MessageThreadId? = toChatId.threadId,
// disableNotification: Boolean = false,
// protectContent: Boolean = false,
// allowPaidBroadcast: Boolean = false,
// replyParameters: ReplyParameters? = null,
// replyMarkup: KeyboardMarkup? = null
//): MessageId = execute(
// CopyMessage(
// fromChatId,
// messageId,
// toChatId,
// text,
// parseMode,
// showCaptionAboveMedia,
// threadId,
// disableNotification,
// protectContent,
// allowPaidBroadcast,
// replyParameters,
// replyMarkup
// )
//)
//
///**
// * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
// * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
// */
//public suspend inline fun TelegramBot.copyMessage(
// toChatId: ChatIdentifier,
// fromChat: Chat,
// messageId: MessageId,
// text: String? = null,
// parseMode: ParseMode? = null,
// showCaptionAboveMedia: Boolean = false,
// threadId: MessageThreadId? = toChatId.threadId,
// disableNotification: Boolean = false,
// protectContent: Boolean = false,
// allowPaidBroadcast: Boolean = false,
// replyParameters: ReplyParameters? = null,
// replyMarkup: KeyboardMarkup? = null
//): MessageId = copyMessage(
// toChatId,
// fromChat.id,
// messageId,
// text,
// parseMode,
// showCaptionAboveMedia,
// threadId,
// disableNotification,
// protectContent,
// allowPaidBroadcast,
// replyParameters,
// replyMarkup
//)
//
///**
// * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
// * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
// */
//public suspend inline fun TelegramBot.copyMessage(
// toChat: Chat,
// fromChatId: ChatIdentifier,
// messageId: MessageId,
// text: String? = null,
// parseMode: ParseMode? = null,
// showCaptionAboveMedia: Boolean = false,
// threadId: MessageThreadId? = toChat.id.threadId,
// disableNotification: Boolean = false,
// protectContent: Boolean = false,
// allowPaidBroadcast: Boolean = false,
// replyParameters: ReplyParameters? = null,
// replyMarkup: KeyboardMarkup? = null
//): MessageId = copyMessage(
// toChat.id,
// fromChatId,
// messageId,
// text,
// parseMode,
// showCaptionAboveMedia,
// threadId,
// disableNotification,
// protectContent,
// allowPaidBroadcast,
// replyParameters,
// replyMarkup
//)
//
///**
// * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
// * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
// */
//public suspend inline fun TelegramBot.copyMessage(
// toChat: Chat,
// fromChat: Chat,
// messageId: MessageId,
// text: String? = null,
// parseMode: ParseMode? = null,
// showCaptionAboveMedia: Boolean = false,
// threadId: MessageThreadId? = toChat.id.threadId,
// disableNotification: Boolean = false,
// protectContent: Boolean = false,
// allowPaidBroadcast: Boolean = false,
// replyParameters: ReplyParameters? = null,
// replyMarkup: KeyboardMarkup? = null
//): MessageId = copyMessage(
// toChat.id,
// fromChat.id,
// messageId,
// text,
// parseMode,
// showCaptionAboveMedia,
// threadId,
// disableNotification,
// protectContent,
// allowPaidBroadcast,
// replyParameters,
// replyMarkup
//)
//
//
///**
// * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
// * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
// */
//public suspend inline fun TelegramBot.copyMessage(
// toChatId: ChatIdentifier,
// fromChatId: ChatIdentifier,
// messageId: MessageId,
// entities: TextSourcesList,
// showCaptionAboveMedia: Boolean = false,
// threadId: MessageThreadId? = toChatId.threadId,
// disableNotification: Boolean = false,
// protectContent: Boolean = false,
// allowPaidBroadcast: Boolean = false,
// replyParameters: ReplyParameters? = null,
// replyMarkup: KeyboardMarkup? = null
//): MessageId = execute(
// CopyMessage(
// fromChatId,
// messageId,
// toChatId,
// entities,
// showCaptionAboveMedia,
// threadId,
// disableNotification,
// protectContent,
// allowPaidBroadcast,
// replyParameters,
// replyMarkup
// )
//)
//
///**
// * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
// * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
// */
//public suspend inline fun TelegramBot.copyMessage(
// toChatId: ChatIdentifier,
// fromChat: Chat,
// messageId: MessageId,
// entities: TextSourcesList,
// showCaptionAboveMedia: Boolean = false,
// threadId: MessageThreadId? = toChatId.threadId,
// disableNotification: Boolean = false,
// protectContent: Boolean = false,
// allowPaidBroadcast: Boolean = false,
// replyParameters: ReplyParameters? = null,
// replyMarkup: KeyboardMarkup? = null
//): MessageId = copyMessage(
// toChatId,
// fromChat.id,
// messageId,
// entities,
// showCaptionAboveMedia,
// threadId,
// disableNotification,
// protectContent,
// allowPaidBroadcast,
// replyParameters,
// replyMarkup
//)
//
///**
// * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
// * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
// */
//public suspend inline fun TelegramBot.copyMessage(
// toChat: Chat,
// fromChatId: ChatIdentifier,
// messageId: MessageId,
// entities: TextSourcesList,
// showCaptionAboveMedia: Boolean = false,
// threadId: MessageThreadId? = toChat.id.threadId,
// disableNotification: Boolean = false,
// protectContent: Boolean = false,
// allowPaidBroadcast: Boolean = false,
// replyParameters: ReplyParameters? = null,
// replyMarkup: KeyboardMarkup? = null
//): MessageId = copyMessage(
// toChat.id,
// fromChatId,
// messageId,
// entities,
// showCaptionAboveMedia,
// threadId,
// disableNotification,
// protectContent,
// allowPaidBroadcast,
// replyParameters,
// replyMarkup
//)
//
///**
// * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
// * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
// */
//public suspend inline fun TelegramBot.copyMessage(
// toChat: Chat,
// fromChat: Chat,
// messageId: MessageId,
// entities: TextSourcesList,
// showCaptionAboveMedia: Boolean = false,
// threadId: MessageThreadId? = toChat.id.threadId,
// disableNotification: Boolean = false,
// protectContent: Boolean = false,
// allowPaidBroadcast: Boolean = false,
// replyParameters: ReplyParameters? = null,
// replyMarkup: KeyboardMarkup? = null
//): MessageId = copyMessage(
// toChat.id,
// fromChat.id,
// messageId,
// entities,
// showCaptionAboveMedia,
// threadId,
// disableNotification,
// protectContent,
// allowPaidBroadcast,
// replyParameters,
// replyMarkup
//)

View File

@@ -12,6 +12,7 @@ public suspend fun TelegramBot.copyMessages(
fromChatId: ChatIdentifier, fromChatId: ChatIdentifier,
messageIds: List<MessageId>, messageIds: List<MessageId>,
threadId: MessageThreadId? = toChatId.threadId, threadId: MessageThreadId? = toChatId.threadId,
directMessageThreadId: DirectMessageThreadId? = toChatId.directMessageThreadId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
removeCaption: Boolean = false removeCaption: Boolean = false
@@ -22,6 +23,7 @@ public suspend fun TelegramBot.copyMessages(
fromChatId = fromChatId, fromChatId = fromChatId,
messageIds = it, messageIds = it,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
removeCaption = removeCaption removeCaption = removeCaption
@@ -34,6 +36,7 @@ public suspend fun TelegramBot.copyMessages(
fromChatId: ChatIdentifier, fromChatId: ChatIdentifier,
messageIds: Array<MessageId>, messageIds: Array<MessageId>,
threadId: MessageThreadId? = toChatId.threadId, threadId: MessageThreadId? = toChatId.threadId,
directMessageThreadId: DirectMessageThreadId? = toChatId.directMessageThreadId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
removeCaption: Boolean = false removeCaption: Boolean = false
@@ -42,6 +45,7 @@ public suspend fun TelegramBot.copyMessages(
fromChatId = fromChatId, fromChatId = fromChatId,
messageIds = messageIds.toList(), messageIds = messageIds.toList(),
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
removeCaption = removeCaption removeCaption = removeCaption
@@ -51,6 +55,7 @@ public suspend fun TelegramBot.copyMessages(
toChatId: ChatIdentifier, toChatId: ChatIdentifier,
messagesMetas: List<Message.MetaInfo>, messagesMetas: List<Message.MetaInfo>,
threadId: MessageThreadId? = toChatId.threadId, threadId: MessageThreadId? = toChatId.threadId,
directMessageThreadId: DirectMessageThreadId? = toChatId.directMessageThreadId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
removeCaption: Boolean = false removeCaption: Boolean = false
@@ -60,6 +65,7 @@ public suspend fun TelegramBot.copyMessages(
fromChatId = chatId, fromChatId = chatId,
messageIds = messages.map { it.messageId }, messageIds = messages.map { it.messageId },
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
removeCaption = removeCaption removeCaption = removeCaption
@@ -71,6 +77,7 @@ public suspend fun TelegramBot.copyMessages(
toChatId: ChatIdentifier, toChatId: ChatIdentifier,
messages: List<AccessibleMessage>, messages: List<AccessibleMessage>,
threadId: MessageThreadId? = toChatId.threadId, threadId: MessageThreadId? = toChatId.threadId,
directMessageThreadId: DirectMessageThreadId? = toChatId.directMessageThreadId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
removeCaption: Boolean = false removeCaption: Boolean = false
@@ -78,6 +85,7 @@ public suspend fun TelegramBot.copyMessages(
toChatId = toChatId, toChatId = toChatId,
messagesMetas = messages.map { it.metaInfo }, messagesMetas = messages.map { it.metaInfo },
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
removeCaption = removeCaption removeCaption = removeCaption
@@ -88,6 +96,7 @@ public suspend fun TelegramBot.copy(
fromChatId: ChatIdentifier, fromChatId: ChatIdentifier,
messageIds: List<MessageId>, messageIds: List<MessageId>,
threadId: MessageThreadId? = toChatId.threadId, threadId: MessageThreadId? = toChatId.threadId,
directMessageThreadId: DirectMessageThreadId? = toChatId.directMessageThreadId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
removeCaption: Boolean = false removeCaption: Boolean = false
@@ -96,6 +105,7 @@ public suspend fun TelegramBot.copy(
fromChatId = fromChatId, fromChatId = fromChatId,
messageIds = messageIds, messageIds = messageIds,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
removeCaption = removeCaption removeCaption = removeCaption
@@ -106,6 +116,7 @@ public suspend fun TelegramBot.copy(
fromChatId: ChatIdentifier, fromChatId: ChatIdentifier,
messageIds: Array<MessageId>, messageIds: Array<MessageId>,
threadId: MessageThreadId? = toChatId.threadId, threadId: MessageThreadId? = toChatId.threadId,
directMessageThreadId: DirectMessageThreadId? = toChatId.directMessageThreadId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
removeCaption: Boolean = false removeCaption: Boolean = false
@@ -114,6 +125,7 @@ public suspend fun TelegramBot.copy(
fromChatId = fromChatId, fromChatId = fromChatId,
messageIds = messageIds, messageIds = messageIds,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
removeCaption = removeCaption removeCaption = removeCaption
@@ -123,6 +135,7 @@ public suspend fun TelegramBot.copy(
toChatId: ChatIdentifier, toChatId: ChatIdentifier,
messagesMetas: List<Message.MetaInfo>, messagesMetas: List<Message.MetaInfo>,
threadId: MessageThreadId? = toChatId.threadId, threadId: MessageThreadId? = toChatId.threadId,
directMessageThreadId: DirectMessageThreadId? = toChatId.directMessageThreadId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
removeCaption: Boolean = false removeCaption: Boolean = false
@@ -130,6 +143,7 @@ public suspend fun TelegramBot.copy(
toChatId = toChatId, toChatId = toChatId,
messagesMetas = messagesMetas, messagesMetas = messagesMetas,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
removeCaption = removeCaption removeCaption = removeCaption
@@ -140,6 +154,7 @@ public suspend fun TelegramBot.copy(
toChatId: ChatIdentifier, toChatId: ChatIdentifier,
messages: List<AccessibleMessage>, messages: List<AccessibleMessage>,
threadId: MessageThreadId? = toChatId.threadId, threadId: MessageThreadId? = toChatId.threadId,
directMessageThreadId: DirectMessageThreadId? = toChatId.directMessageThreadId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
removeCaption: Boolean = false removeCaption: Boolean = false
@@ -147,6 +162,7 @@ public suspend fun TelegramBot.copy(
toChatId = toChatId, toChatId = toChatId,
messages = messages, messages = messages,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
removeCaption = removeCaption removeCaption = removeCaption

View File

@@ -2,10 +2,12 @@ package dev.inmo.tgbotapi.extensions.api.send
import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
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.content.MessageContent import dev.inmo.tgbotapi.types.message.content.MessageContent
import dev.inmo.tgbotapi.types.message.SuggestedPostParameters
/** /**
* This method will send [content] to the [chatId] as is * This method will send [content] to the [chatId] as is
@@ -15,22 +17,28 @@ public suspend inline fun <T : MessageContent> TelegramBot.resend(
chatId: ChatIdentifier, chatId: ChatIdentifier,
content: T, content: T,
messageThreadId: MessageThreadId? = chatId.threadId, messageThreadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null,
suggestedPostParameters: SuggestedPostParameters? = null
): ContentMessage<T> = execute( ): ContentMessage<T> = execute(
content.createResend( content.createResend(
chatId = chatId, chatId = chatId,
messageThreadId = messageThreadId, messageThreadId = messageThreadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup,
suggestedPostParameters = suggestedPostParameters,
) )
) as ContentMessage<T> ) as ContentMessage<T>
@@ -41,6 +49,8 @@ public suspend inline fun <T : MessageContent> TelegramBot.resend(
chat: Chat, chat: Chat,
content: T, content: T,
messageThreadId: MessageThreadId? = chat.id.threadId, messageThreadId: MessageThreadId? = chat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
@@ -51,6 +61,8 @@ public suspend inline fun <T : MessageContent> TelegramBot.resend(
chatId = chat.id, chatId = chat.id,
content = content, content = content,
messageThreadId = messageThreadId, messageThreadId = messageThreadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
@@ -68,6 +80,8 @@ public suspend inline fun <T : MessageContent> TelegramBot.resend(
chatId: ChatIdentifier, chatId: ChatIdentifier,
message: ContentMessage<T>, message: ContentMessage<T>,
messageThreadId: MessageThreadId? = chatId.threadId, messageThreadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
@@ -78,6 +92,8 @@ public suspend inline fun <T : MessageContent> TelegramBot.resend(
chatId = chatId, chatId = chatId,
content = message.content, content = message.content,
messageThreadId = messageThreadId, messageThreadId = messageThreadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
@@ -95,6 +111,8 @@ public suspend inline fun <T : MessageContent> TelegramBot.resend(
chat: Chat, chat: Chat,
message: ContentMessage<T>, message: ContentMessage<T>,
messageThreadId: MessageThreadId? = chat.id.threadId, messageThreadId: MessageThreadId? = chat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
@@ -105,6 +123,8 @@ public suspend inline fun <T : MessageContent> TelegramBot.resend(
chatId = chat.id, chatId = chat.id,
message = message, message = message,
messageThreadId = messageThreadId, messageThreadId = messageThreadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,

View File

@@ -1,3 +1,5 @@
@file:Suppress("KDocUnresolvedReference")
package dev.inmo.tgbotapi.extensions.api.send package dev.inmo.tgbotapi.extensions.api.send
import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.bot.TelegramBot
@@ -6,6 +8,7 @@ import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
import dev.inmo.tgbotapi.types.chat.Chat import dev.inmo.tgbotapi.types.chat.Chat
import dev.inmo.tgbotapi.types.message.SuggestedPostParameters
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
import dev.inmo.tgbotapi.types.message.content.ContactContent import dev.inmo.tgbotapi.types.message.content.ContactContent
@@ -19,11 +22,13 @@ public suspend fun TelegramBot.sendContact(
firstName: String, firstName: String,
lastName: String? = null, lastName: String? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<ContactContent> = execute( ): ContentMessage<ContactContent> = execute(
@@ -33,11 +38,13 @@ public suspend fun TelegramBot.sendContact(
firstName = firstName, firstName = firstName,
lastName = lastName, lastName = lastName,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -51,11 +58,13 @@ public suspend fun TelegramBot.sendContact(
chatId: ChatIdentifier, chatId: ChatIdentifier,
contact: Contact, contact: Contact,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<ContactContent> = execute( ): ContentMessage<ContactContent> = execute(
@@ -63,11 +72,13 @@ public suspend fun TelegramBot.sendContact(
chatId = chatId, chatId = chatId,
contact = contact, contact = contact,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -83,11 +94,13 @@ public suspend fun TelegramBot.sendContact(
firstName: String, firstName: String,
lastName: String? = null, lastName: String? = null,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<ContactContent> = sendContact( ): ContentMessage<ContactContent> = sendContact(
@@ -96,11 +109,13 @@ public suspend fun TelegramBot.sendContact(
firstName = firstName, firstName = firstName,
lastName = lastName, lastName = lastName,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -113,22 +128,26 @@ public suspend fun TelegramBot.sendContact(
chat: Chat, chat: Chat,
contact: Contact, contact: Contact,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<ContactContent> = sendContact( ): ContentMessage<ContactContent> = sendContact(
chatId = chat.id, chatId = chat.id,
contact = contact, contact = contact,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )

View File

@@ -6,6 +6,7 @@ import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
import dev.inmo.tgbotapi.types.chat.Chat import dev.inmo.tgbotapi.types.chat.Chat
import dev.inmo.tgbotapi.types.message.SuggestedPostParameters
import dev.inmo.tgbotapi.types.dice.DiceAnimationType import dev.inmo.tgbotapi.types.dice.DiceAnimationType
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
import dev.inmo.tgbotapi.types.message.content.DiceContent import dev.inmo.tgbotapi.types.message.content.DiceContent
@@ -18,11 +19,13 @@ public suspend fun TelegramBot.sendDice(
chatId: ChatIdentifier, chatId: ChatIdentifier,
animationType: DiceAnimationType? = null, animationType: DiceAnimationType? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<DiceContent> = execute( ): ContentMessage<DiceContent> = execute(
@@ -30,11 +33,13 @@ public suspend fun TelegramBot.sendDice(
chatId = chatId, chatId = chatId,
animationType = animationType, animationType = animationType,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -48,22 +53,26 @@ public suspend fun TelegramBot.sendDice(
chat: Chat, chat: Chat,
animationType: DiceAnimationType? = null, animationType: DiceAnimationType? = null,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<DiceContent> = sendDice( ): ContentMessage<DiceContent> = sendDice(
chatId = chat.id, chatId = chat.id,
animationType = animationType, animationType = animationType,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )

View File

@@ -6,6 +6,7 @@ import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
import dev.inmo.tgbotapi.types.chat.Chat import dev.inmo.tgbotapi.types.chat.Chat
import dev.inmo.tgbotapi.types.message.SuggestedPostParameters
import dev.inmo.tgbotapi.types.location.Location import dev.inmo.tgbotapi.types.location.Location
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
import dev.inmo.tgbotapi.types.message.content.LiveLocationContent import dev.inmo.tgbotapi.types.message.content.LiveLocationContent
@@ -24,11 +25,13 @@ public suspend fun TelegramBot.sendLocation(
heading: Degrees? = null, heading: Degrees? = null,
proximityAlertRadius: Meters? = null, proximityAlertRadius: Meters? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<LiveLocationContent> = execute( ): ContentMessage<LiveLocationContent> = execute(
@@ -41,11 +44,13 @@ public suspend fun TelegramBot.sendLocation(
heading = heading, heading = heading,
proximityAlertRadius = proximityAlertRadius, proximityAlertRadius = proximityAlertRadius,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -63,11 +68,13 @@ public suspend fun TelegramBot.sendLocation(
heading: Degrees? = null, heading: Degrees? = null,
proximityAlertRadius: Meters? = null, proximityAlertRadius: Meters? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<LiveLocationContent> = sendLocation( ): ContentMessage<LiveLocationContent> = sendLocation(
@@ -79,11 +86,13 @@ public suspend fun TelegramBot.sendLocation(
heading = heading, heading = heading,
proximityAlertRadius = proximityAlertRadius, proximityAlertRadius = proximityAlertRadius,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -101,11 +110,13 @@ public suspend fun TelegramBot.sendLocation(
heading: Degrees? = null, heading: Degrees? = null,
proximityAlertRadius: Meters? = null, proximityAlertRadius: Meters? = null,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<LiveLocationContent> = sendLocation( ): ContentMessage<LiveLocationContent> = sendLocation(
@@ -117,11 +128,13 @@ public suspend fun TelegramBot.sendLocation(
heading = heading, heading = heading,
proximityAlertRadius = proximityAlertRadius, proximityAlertRadius = proximityAlertRadius,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -138,11 +151,13 @@ public suspend fun TelegramBot.sendLocation(
heading: Degrees? = null, heading: Degrees? = null,
proximityAlertRadius: Meters? = null, proximityAlertRadius: Meters? = null,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<LiveLocationContent> = sendLocation( ): ContentMessage<LiveLocationContent> = sendLocation(
@@ -154,11 +169,13 @@ public suspend fun TelegramBot.sendLocation(
heading = heading, heading = heading,
proximityAlertRadius = proximityAlertRadius, proximityAlertRadius = proximityAlertRadius,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -176,11 +193,13 @@ public suspend fun TelegramBot.sendLiveLocation(
heading: Degrees? = null, heading: Degrees? = null,
proximityAlertRadius: Meters? = null, proximityAlertRadius: Meters? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<LiveLocationContent> = sendLocation( ): ContentMessage<LiveLocationContent> = sendLocation(
@@ -192,11 +211,13 @@ public suspend fun TelegramBot.sendLiveLocation(
heading = heading, heading = heading,
proximityAlertRadius = proximityAlertRadius, proximityAlertRadius = proximityAlertRadius,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -213,11 +234,13 @@ public suspend fun TelegramBot.sendLiveLocation(
heading: Degrees? = null, heading: Degrees? = null,
proximityAlertRadius: Meters? = null, proximityAlertRadius: Meters? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<LiveLocationContent> = sendLocation( ): ContentMessage<LiveLocationContent> = sendLocation(
@@ -229,11 +252,13 @@ public suspend fun TelegramBot.sendLiveLocation(
heading = heading, heading = heading,
proximityAlertRadius = proximityAlertRadius, proximityAlertRadius = proximityAlertRadius,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -251,11 +276,13 @@ public suspend fun TelegramBot.sendLiveLocation(
heading: Degrees? = null, heading: Degrees? = null,
proximityAlertRadius: Meters? = null, proximityAlertRadius: Meters? = null,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<LiveLocationContent> = sendLocation( ): ContentMessage<LiveLocationContent> = sendLocation(
@@ -267,11 +294,13 @@ public suspend fun TelegramBot.sendLiveLocation(
heading = heading, heading = heading,
proximityAlertRadius = proximityAlertRadius, proximityAlertRadius = proximityAlertRadius,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -288,11 +317,13 @@ public suspend fun TelegramBot.sendLiveLocation(
heading: Degrees? = null, heading: Degrees? = null,
proximityAlertRadius: Meters? = null, proximityAlertRadius: Meters? = null,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<LiveLocationContent> = sendLocation( ): ContentMessage<LiveLocationContent> = sendLocation(
@@ -304,11 +335,13 @@ public suspend fun TelegramBot.sendLiveLocation(
heading = heading, heading = heading,
proximityAlertRadius = proximityAlertRadius, proximityAlertRadius = proximityAlertRadius,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )

View File

@@ -1,3 +1,5 @@
@file:Suppress("KDocUnresolvedReference")
package dev.inmo.tgbotapi.extensions.api.send package dev.inmo.tgbotapi.extensions.api.send
import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.bot.TelegramBot
@@ -6,6 +8,7 @@ import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
import dev.inmo.tgbotapi.types.message.ParseMode import dev.inmo.tgbotapi.types.message.ParseMode
import dev.inmo.tgbotapi.types.message.SuggestedPostParameters
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.abstracts.ContentMessage import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
@@ -24,11 +27,13 @@ public suspend fun TelegramBot.sendMessage(
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
linkPreviewOptions: LinkPreviewOptions? = null, linkPreviewOptions: LinkPreviewOptions? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<TextContent> = execute( ): ContentMessage<TextContent> = execute(
@@ -38,11 +43,13 @@ public suspend fun TelegramBot.sendMessage(
parseMode = parseMode, parseMode = parseMode,
linkPreviewOptions = linkPreviewOptions, linkPreviewOptions = linkPreviewOptions,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -58,11 +65,13 @@ public suspend fun TelegramBot.sendTextMessage(
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
linkPreviewOptions: LinkPreviewOptions? = null, linkPreviewOptions: LinkPreviewOptions? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<TextContent> = sendMessage( ): ContentMessage<TextContent> = sendMessage(
@@ -71,11 +80,13 @@ public suspend fun TelegramBot.sendTextMessage(
parseMode = parseMode, parseMode = parseMode,
linkPreviewOptions = linkPreviewOptions, linkPreviewOptions = linkPreviewOptions,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -90,11 +101,13 @@ public suspend fun TelegramBot.sendTextMessage(
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
linkPreviewOptions: LinkPreviewOptions? = null, linkPreviewOptions: LinkPreviewOptions? = null,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<TextContent> = sendTextMessage( ): ContentMessage<TextContent> = sendTextMessage(
@@ -103,11 +116,13 @@ public suspend fun TelegramBot.sendTextMessage(
parseMode = parseMode, parseMode = parseMode,
linkPreviewOptions = linkPreviewOptions, linkPreviewOptions = linkPreviewOptions,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -123,11 +138,13 @@ public suspend fun TelegramBot.sendMessage(
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
linkPreviewOptions: LinkPreviewOptions? = null, linkPreviewOptions: LinkPreviewOptions? = null,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<TextContent> = sendMessage( ): ContentMessage<TextContent> = sendMessage(
@@ -136,11 +153,13 @@ public suspend fun TelegramBot.sendMessage(
parseMode = parseMode, parseMode = parseMode,
linkPreviewOptions = linkPreviewOptions, linkPreviewOptions = linkPreviewOptions,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -154,11 +173,13 @@ public suspend fun TelegramBot.sendMessage(
entities: TextSourcesList, entities: TextSourcesList,
linkPreviewOptions: LinkPreviewOptions? = null, linkPreviewOptions: LinkPreviewOptions? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<TextContent> = execute( ): ContentMessage<TextContent> = execute(
@@ -167,11 +188,13 @@ public suspend fun TelegramBot.sendMessage(
entities = entities, entities = entities,
linkPreviewOptions = linkPreviewOptions, linkPreviewOptions = linkPreviewOptions,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -186,11 +209,13 @@ public suspend fun TelegramBot.sendMessage(
separator: TextSource? = null, separator: TextSource? = null,
linkPreviewOptions: LinkPreviewOptions? = null, linkPreviewOptions: LinkPreviewOptions? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null, replyMarkup: KeyboardMarkup? = null,
builderBody: EntitiesBuilderBody builderBody: EntitiesBuilderBody
@@ -199,11 +224,13 @@ public suspend fun TelegramBot.sendMessage(
entities = buildEntities(separator, builderBody), entities = buildEntities(separator, builderBody),
linkPreviewOptions = linkPreviewOptions, linkPreviewOptions = linkPreviewOptions,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -218,11 +245,13 @@ public suspend fun TelegramBot.sendMessage(
separator: String, separator: String,
linkPreviewOptions: LinkPreviewOptions? = null, linkPreviewOptions: LinkPreviewOptions? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null, replyMarkup: KeyboardMarkup? = null,
builderBody: EntitiesBuilderBody builderBody: EntitiesBuilderBody
@@ -231,11 +260,13 @@ public suspend fun TelegramBot.sendMessage(
entities = buildEntities(separator, builderBody), entities = buildEntities(separator, builderBody),
linkPreviewOptions = linkPreviewOptions, linkPreviewOptions = linkPreviewOptions,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -249,11 +280,13 @@ public suspend fun TelegramBot.sendTextMessage(
entities: TextSourcesList, entities: TextSourcesList,
linkPreviewOptions: LinkPreviewOptions? = null, linkPreviewOptions: LinkPreviewOptions? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<TextContent> = sendMessage( ): ContentMessage<TextContent> = sendMessage(
@@ -261,11 +294,13 @@ public suspend fun TelegramBot.sendTextMessage(
entities = entities, entities = entities,
linkPreviewOptions = linkPreviewOptions, linkPreviewOptions = linkPreviewOptions,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -279,11 +314,13 @@ public suspend fun TelegramBot.sendTextMessage(
separator: TextSource? = null, separator: TextSource? = null,
linkPreviewOptions: LinkPreviewOptions? = null, linkPreviewOptions: LinkPreviewOptions? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null, replyMarkup: KeyboardMarkup? = null,
builderBody: EntitiesBuilderBody builderBody: EntitiesBuilderBody
@@ -292,11 +329,13 @@ public suspend fun TelegramBot.sendTextMessage(
entities = buildEntities(separator, builderBody), entities = buildEntities(separator, builderBody),
linkPreviewOptions = linkPreviewOptions, linkPreviewOptions = linkPreviewOptions,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -311,11 +350,13 @@ public suspend fun TelegramBot.sendTextMessage(
separator: String, separator: String,
linkPreviewOptions: LinkPreviewOptions? = null, linkPreviewOptions: LinkPreviewOptions? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null, replyMarkup: KeyboardMarkup? = null,
builderBody: EntitiesBuilderBody builderBody: EntitiesBuilderBody
@@ -324,11 +365,13 @@ public suspend fun TelegramBot.sendTextMessage(
entities = buildEntities(separator, builderBody), entities = buildEntities(separator, builderBody),
linkPreviewOptions = linkPreviewOptions, linkPreviewOptions = linkPreviewOptions,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -342,11 +385,13 @@ public suspend fun TelegramBot.sendMessage(
entities: TextSourcesList, entities: TextSourcesList,
linkPreviewOptions: LinkPreviewOptions? = null, linkPreviewOptions: LinkPreviewOptions? = null,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<TextContent> = sendMessage( ): ContentMessage<TextContent> = sendMessage(
@@ -354,11 +399,13 @@ public suspend fun TelegramBot.sendMessage(
entities = entities, entities = entities,
linkPreviewOptions = linkPreviewOptions, linkPreviewOptions = linkPreviewOptions,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -372,11 +419,13 @@ public suspend fun TelegramBot.sendMessage(
separator: TextSource? = null, separator: TextSource? = null,
linkPreviewOptions: LinkPreviewOptions? = null, linkPreviewOptions: LinkPreviewOptions? = null,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null, replyMarkup: KeyboardMarkup? = null,
builderBody: EntitiesBuilderBody builderBody: EntitiesBuilderBody
@@ -385,11 +434,13 @@ public suspend fun TelegramBot.sendMessage(
entities = buildEntities(separator, builderBody), entities = buildEntities(separator, builderBody),
linkPreviewOptions = linkPreviewOptions, linkPreviewOptions = linkPreviewOptions,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -404,11 +455,13 @@ public suspend fun TelegramBot.sendMessage(
separator: String, separator: String,
linkPreviewOptions: LinkPreviewOptions? = null, linkPreviewOptions: LinkPreviewOptions? = null,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null, replyMarkup: KeyboardMarkup? = null,
builderBody: EntitiesBuilderBody builderBody: EntitiesBuilderBody
@@ -417,11 +470,13 @@ public suspend fun TelegramBot.sendMessage(
entities = buildEntities(separator, builderBody), entities = buildEntities(separator, builderBody),
linkPreviewOptions = linkPreviewOptions, linkPreviewOptions = linkPreviewOptions,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -436,11 +491,13 @@ public suspend fun TelegramBot.sendTextMessage(
entities: TextSourcesList, entities: TextSourcesList,
linkPreviewOptions: LinkPreviewOptions? = null, linkPreviewOptions: LinkPreviewOptions? = null,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<TextContent> = sendTextMessage( ): ContentMessage<TextContent> = sendTextMessage(
@@ -448,11 +505,13 @@ public suspend fun TelegramBot.sendTextMessage(
entities = entities, entities = entities,
linkPreviewOptions = linkPreviewOptions, linkPreviewOptions = linkPreviewOptions,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -466,11 +525,13 @@ public suspend fun TelegramBot.sendTextMessage(
separator: TextSource? = null, separator: TextSource? = null,
linkPreviewOptions: LinkPreviewOptions? = null, linkPreviewOptions: LinkPreviewOptions? = null,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null, replyMarkup: KeyboardMarkup? = null,
builderBody: EntitiesBuilderBody builderBody: EntitiesBuilderBody
@@ -479,11 +540,13 @@ public suspend fun TelegramBot.sendTextMessage(
entities = buildEntities(separator, builderBody), entities = buildEntities(separator, builderBody),
linkPreviewOptions = linkPreviewOptions, linkPreviewOptions = linkPreviewOptions,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -498,11 +561,13 @@ public suspend fun TelegramBot.sendTextMessage(
separator: String, separator: String,
linkPreviewOptions: LinkPreviewOptions? = null, linkPreviewOptions: LinkPreviewOptions? = null,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null, replyMarkup: KeyboardMarkup? = null,
builderBody: EntitiesBuilderBody builderBody: EntitiesBuilderBody
@@ -511,11 +576,13 @@ public suspend fun TelegramBot.sendTextMessage(
entities = buildEntities(separator, builderBody), entities = buildEntities(separator, builderBody),
linkPreviewOptions = linkPreviewOptions, linkPreviewOptions = linkPreviewOptions,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )

View File

@@ -0,0 +1,197 @@
package dev.inmo.tgbotapi.extensions.api.send
import dev.inmo.kslog.common.logger
import dev.inmo.micro_utils.coroutines.runCatchingLogging
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.send.SendMessageDraft
import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
import dev.inmo.tgbotapi.types.message.ParseMode
import dev.inmo.tgbotapi.types.chat.Chat
import dev.inmo.tgbotapi.types.message.MarkdownV2
import dev.inmo.tgbotapi.types.message.textsources.TextSource
import dev.inmo.tgbotapi.utils.DraftIdAllocator
import dev.inmo.tgbotapi.utils.EntitiesBuilderBody
import dev.inmo.tgbotapi.utils.buildEntities
import dev.inmo.tgbotapi.utils.extensions.escapeMarkdownV2Common
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.filter
import kotlinx.coroutines.flow.firstOrNull
import kotlinx.coroutines.flow.map
import kotlin.js.JsName
import kotlin.jvm.JvmName
public suspend fun TelegramBot.sendMessageDraft(
chatId: IdChatIdentifier,
draftId: DraftId,
text: String,
parseMode: ParseMode? = null,
threadId: MessageThreadId? = chatId.threadId
): Boolean = execute(
SendMessageDraft(
chatId = chatId,
draftId = draftId,
text = text,
parseMode = parseMode,
threadId = threadId
)
)
private suspend fun TelegramBot.sendMessageDraftFlow(
messagesFlow: Flow<SendMessageDraft>,
): Boolean {
val done = messagesFlow
.filter { draft ->
val sent = runCatchingLogging(logger = logger) {
execute(draft)
}.getOrElse {
false
}
sent == false
}
.firstOrNull()
return done == null
}
public val GlobalDraftIdAllocator: DraftIdAllocator by lazy { DraftIdAllocator() }
public suspend fun TelegramBot.sendMessageDraftFlow(
chatId: IdChatIdentifier,
messagesFlow: Flow<TextSourcesList>,
threadId: MessageThreadId? = chatId.threadId,
draftId: DraftId? = null,
): Boolean {
val draftId = draftId ?: GlobalDraftIdAllocator.allocate()
return sendMessageDraftFlow(
messagesFlow.map {
SendMessageDraft(chatId = chatId, draftId = draftId, entities = it, threadId = threadId)
}
)
}
public suspend fun TelegramBot.sendMessageDraftFlowWithTextsAndParseMode(
chatId: IdChatIdentifier,
messagesFlow: Flow<Pair<String, ParseMode?>>,
threadId: MessageThreadId? = chatId.threadId,
draftId: DraftId? = null,
): Boolean {
val draftId = draftId ?: GlobalDraftIdAllocator.allocate()
return sendMessageDraftFlow(
messagesFlow.map {
SendMessageDraft(chatId = chatId, draftId = draftId, text = it.first, parseMode = it.second, threadId = threadId)
}
)
}
public suspend fun TelegramBot.sendMessageDraftFlowWithTexts(
chatId: IdChatIdentifier,
messagesFlow: Flow<String>,
threadId: MessageThreadId? = chatId.threadId,
draftId: DraftId? = null,
): Boolean {
val draftId = draftId ?: GlobalDraftIdAllocator.allocate()
return sendMessageDraftFlowWithTextsAndParseMode(
chatId = chatId,
messagesFlow = messagesFlow.map {
it.escapeMarkdownV2Common() to MarkdownV2
},
threadId = threadId,
draftId = draftId
)
}
public suspend fun TelegramBot.sendMessageDraft(
chat: Chat,
draftId: DraftId,
text: String,
parseMode: ParseMode? = null,
threadId: MessageThreadId? = chat.id.threadId
): Boolean = sendMessageDraft(
chatId = chat.id as IdChatIdentifier,
draftId = draftId,
text = text,
parseMode = parseMode,
threadId = threadId
)
public suspend fun TelegramBot.sendMessageDraft(
chatId: IdChatIdentifier,
draftId: DraftId,
entities: TextSourcesList,
threadId: MessageThreadId? = chatId.threadId
): Boolean = execute(
SendMessageDraft(
chatId = chatId,
draftId = draftId,
entities = entities,
threadId = threadId
)
)
public suspend fun TelegramBot.sendMessageDraft(
chat: Chat,
draftId: DraftId,
entities: TextSourcesList,
threadId: MessageThreadId? = chat.id.threadId
): Boolean = sendMessageDraft(
chatId = chat.id as IdChatIdentifier,
draftId = draftId,
entities = entities,
threadId = threadId
)
public suspend fun TelegramBot.sendMessageDraft(
chatId: IdChatIdentifier,
draftId: DraftId,
separator: TextSource? = null,
threadId: MessageThreadId? = chatId.threadId,
builderBody: EntitiesBuilderBody
): Boolean = sendMessageDraft(
chatId = chatId,
draftId = draftId,
entities = buildEntities(separator, builderBody),
threadId = threadId
)
public suspend fun TelegramBot.sendMessageDraft(
chatId: IdChatIdentifier,
draftId: DraftId,
separator: String,
threadId: MessageThreadId? = chatId.threadId,
builderBody: EntitiesBuilderBody
): Boolean = sendMessageDraft(
chatId = chatId,
draftId = draftId,
entities = buildEntities(separator, builderBody),
threadId = threadId
)
public suspend fun TelegramBot.sendMessageDraft(
chat: Chat,
draftId: DraftId,
separator: TextSource? = null,
threadId: MessageThreadId? = chat.id.threadId,
builderBody: EntitiesBuilderBody
): Boolean = sendMessageDraft(
chatId = chat.id as IdChatIdentifier,
draftId = draftId,
separator = separator,
threadId = threadId,
builderBody = builderBody
)
public suspend fun TelegramBot.sendMessageDraft(
chat: Chat,
draftId: DraftId,
separator: String,
threadId: MessageThreadId? = chat.id.threadId,
builderBody: EntitiesBuilderBody
): Boolean = sendMessageDraft(
chatId = chat.id as IdChatIdentifier,
draftId = draftId,
separator = separator,
threadId = threadId,
builderBody = builderBody
)

View File

@@ -1,3 +1,5 @@
@file:Suppress("KDocUnresolvedReference")
package dev.inmo.tgbotapi.extensions.api.send package dev.inmo.tgbotapi.extensions.api.send
import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.bot.TelegramBot
@@ -6,6 +8,7 @@ import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
import dev.inmo.tgbotapi.types.chat.Chat import dev.inmo.tgbotapi.types.chat.Chat
import dev.inmo.tgbotapi.types.message.SuggestedPostParameters
import dev.inmo.tgbotapi.types.location.Location import dev.inmo.tgbotapi.types.location.Location
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
import dev.inmo.tgbotapi.types.message.content.LocationContent import dev.inmo.tgbotapi.types.message.content.LocationContent
@@ -20,11 +23,13 @@ public suspend fun TelegramBot.sendLocation(
latitude: Double, latitude: Double,
longitude: Double, longitude: Double,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<StaticLocationContent> = execute( ): ContentMessage<StaticLocationContent> = execute(
@@ -33,11 +38,13 @@ public suspend fun TelegramBot.sendLocation(
latitude = latitude, latitude = latitude,
longitude = longitude, longitude = longitude,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -51,11 +58,13 @@ public suspend fun TelegramBot.sendLocation(
chatId: ChatIdentifier, chatId: ChatIdentifier,
location: Location, location: Location,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<StaticLocationContent> = sendLocation( ): ContentMessage<StaticLocationContent> = sendLocation(
@@ -63,11 +72,13 @@ public suspend fun TelegramBot.sendLocation(
latitude = location.latitude, latitude = location.latitude,
longitude = location.longitude, longitude = location.longitude,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -81,11 +92,13 @@ public suspend fun TelegramBot.sendLocation(
latitude: Double, latitude: Double,
longitude: Double, longitude: Double,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<StaticLocationContent> = sendLocation( ): ContentMessage<StaticLocationContent> = sendLocation(
@@ -93,11 +106,13 @@ public suspend fun TelegramBot.sendLocation(
latitude = latitude, latitude = latitude,
longitude = longitude, longitude = longitude,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -110,11 +125,13 @@ public suspend fun TelegramBot.sendLocation(
chat: Chat, chat: Chat,
location: Location, location: Location,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<StaticLocationContent> = sendLocation( ): ContentMessage<StaticLocationContent> = sendLocation(
@@ -122,11 +139,13 @@ public suspend fun TelegramBot.sendLocation(
latitude = location.latitude, latitude = location.latitude,
longitude = location.longitude, longitude = location.longitude,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -140,11 +159,13 @@ public suspend fun TelegramBot.sendStaticLocation(
latitude: Double, latitude: Double,
longitude: Double, longitude: Double,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<StaticLocationContent> = sendLocation( ): ContentMessage<StaticLocationContent> = sendLocation(
@@ -152,11 +173,13 @@ public suspend fun TelegramBot.sendStaticLocation(
latitude = latitude, latitude = latitude,
longitude = longitude, longitude = longitude,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -169,11 +192,13 @@ public suspend fun TelegramBot.sendStaticLocation(
chatId: ChatIdentifier, chatId: ChatIdentifier,
location: Location, location: Location,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<StaticLocationContent> = sendLocation( ): ContentMessage<StaticLocationContent> = sendLocation(
@@ -181,11 +206,13 @@ public suspend fun TelegramBot.sendStaticLocation(
latitude = location.latitude, latitude = location.latitude,
longitude = location.longitude, longitude = location.longitude,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -199,11 +226,13 @@ public suspend fun TelegramBot.sendStaticLocation(
latitude: Double, latitude: Double,
longitude: Double, longitude: Double,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<StaticLocationContent> = sendLocation( ): ContentMessage<StaticLocationContent> = sendLocation(
@@ -211,11 +240,13 @@ public suspend fun TelegramBot.sendStaticLocation(
latitude = latitude, latitude = latitude,
longitude = longitude, longitude = longitude,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -228,11 +259,13 @@ public suspend fun TelegramBot.sendStaticLocation(
chat: Chat, chat: Chat,
location: Location, location: Location,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<StaticLocationContent> = sendLocation( ): ContentMessage<StaticLocationContent> = sendLocation(
@@ -240,11 +273,13 @@ public suspend fun TelegramBot.sendStaticLocation(
latitude = location.latitude, latitude = location.latitude,
longitude = location.longitude, longitude = location.longitude,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )

View File

@@ -1,3 +1,5 @@
@file:Suppress("KDocUnresolvedReference")
package dev.inmo.tgbotapi.extensions.api.send package dev.inmo.tgbotapi.extensions.api.send
import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.bot.TelegramBot
@@ -6,6 +8,7 @@ import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
import dev.inmo.tgbotapi.types.chat.Chat import dev.inmo.tgbotapi.types.chat.Chat
import dev.inmo.tgbotapi.types.message.SuggestedPostParameters
import dev.inmo.tgbotapi.types.location.StaticLocation import dev.inmo.tgbotapi.types.location.StaticLocation
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
import dev.inmo.tgbotapi.types.message.content.VenueContent import dev.inmo.tgbotapi.types.message.content.VenueContent
@@ -26,11 +29,13 @@ public suspend fun TelegramBot.sendVenue(
googlePlaceId: GooglePlaceId? = null, googlePlaceId: GooglePlaceId? = null,
googlePlaceType: GooglePlaceType? = null, googlePlaceType: GooglePlaceType? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<VenueContent> = execute( ): ContentMessage<VenueContent> = execute(
@@ -45,11 +50,13 @@ public suspend fun TelegramBot.sendVenue(
googlePlaceId = googlePlaceId, googlePlaceId = googlePlaceId,
googlePlaceType = googlePlaceType, googlePlaceType = googlePlaceType,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -70,11 +77,13 @@ public suspend fun TelegramBot.sendVenue(
googlePlaceId: GooglePlaceId? = null, googlePlaceId: GooglePlaceId? = null,
googlePlaceType: GooglePlaceType? = null, googlePlaceType: GooglePlaceType? = null,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<VenueContent> = sendVenue( ): ContentMessage<VenueContent> = sendVenue(
@@ -88,11 +97,13 @@ public suspend fun TelegramBot.sendVenue(
googlePlaceId = googlePlaceId, googlePlaceId = googlePlaceId,
googlePlaceType = googlePlaceType, googlePlaceType = googlePlaceType,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -111,11 +122,13 @@ public suspend fun TelegramBot.sendVenue(
googlePlaceId: GooglePlaceId? = null, googlePlaceId: GooglePlaceId? = null,
googlePlaceType: GooglePlaceType? = null, googlePlaceType: GooglePlaceType? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<VenueContent> = sendVenue( ): ContentMessage<VenueContent> = sendVenue(
@@ -129,11 +142,13 @@ public suspend fun TelegramBot.sendVenue(
googlePlaceId = googlePlaceId, googlePlaceId = googlePlaceId,
googlePlaceType = googlePlaceType, googlePlaceType = googlePlaceType,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -152,11 +167,13 @@ public suspend fun TelegramBot.sendVenue(
googlePlaceId: GooglePlaceId? = null, googlePlaceId: GooglePlaceId? = null,
googlePlaceType: GooglePlaceType? = null, googlePlaceType: GooglePlaceType? = null,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<VenueContent> = sendVenue( ): ContentMessage<VenueContent> = sendVenue(
@@ -170,11 +187,13 @@ public suspend fun TelegramBot.sendVenue(
googlePlaceId = googlePlaceId, googlePlaceId = googlePlaceId,
googlePlaceType = googlePlaceType, googlePlaceType = googlePlaceType,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -187,11 +206,13 @@ public suspend fun TelegramBot.sendVenue(
chatId: ChatIdentifier, chatId: ChatIdentifier,
venue: Venue, venue: Venue,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<VenueContent> = execute( ): ContentMessage<VenueContent> = execute(
@@ -199,11 +220,13 @@ public suspend fun TelegramBot.sendVenue(
chatId = chatId, chatId = chatId,
venue = venue, venue = venue,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -217,22 +240,26 @@ public suspend fun TelegramBot.sendVenue(
chat: Chat, chat: Chat,
venue: Venue, venue: Venue,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<VenueContent> = sendVenue( ): ContentMessage<VenueContent> = sendVenue(
chatId = chat.id, chatId = chat.id,
venue = venue, venue = venue,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )

View File

@@ -6,6 +6,7 @@ import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
import dev.inmo.tgbotapi.types.chat.Chat import dev.inmo.tgbotapi.types.chat.Chat
import dev.inmo.tgbotapi.types.message.SuggestedPostParameters
import dev.inmo.tgbotapi.types.games.Game import dev.inmo.tgbotapi.types.games.Game
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
import dev.inmo.tgbotapi.types.message.content.GameContent import dev.inmo.tgbotapi.types.message.content.GameContent
@@ -18,11 +19,13 @@ public suspend fun TelegramBot.sendGame(
chatId: ChatIdentifier, chatId: ChatIdentifier,
gameShortName: String, gameShortName: String,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<GameContent> = execute( ): ContentMessage<GameContent> = execute(
@@ -30,11 +33,13 @@ public suspend fun TelegramBot.sendGame(
chatId = chatId, chatId = chatId,
gameShortName = gameShortName, gameShortName = gameShortName,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -48,22 +53,26 @@ public suspend fun TelegramBot.sendGame(
chat: Chat, chat: Chat,
gameShortName: String, gameShortName: String,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<GameContent> = sendGame( ): ContentMessage<GameContent> = sendGame(
chatId = chat.id, chatId = chat.id,
gameShortName = gameShortName, gameShortName = gameShortName,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -76,22 +85,26 @@ public suspend fun TelegramBot.sendGame(
chatId: ChatIdentifier, chatId: ChatIdentifier,
game: Game, game: Game,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<GameContent> = sendGame( ): ContentMessage<GameContent> = sendGame(
chatId = chatId, chatId = chatId,
gameShortName = game.title, gameShortName = game.title,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -104,22 +117,26 @@ public suspend fun TelegramBot.sendGame(
chat: Chat, chat: Chat,
game: Game, game: Game,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<GameContent> = sendGame( ): ContentMessage<GameContent> = sendGame(
chatId = chat.id, chatId = chat.id,
gameShortName = game.title, gameShortName = game.title,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )

View File

@@ -1,3 +1,5 @@
@file:Suppress("KDocUnresolvedReference")
package dev.inmo.tgbotapi.extensions.api.send.media package dev.inmo.tgbotapi.extensions.api.send.media
import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.bot.TelegramBot
@@ -7,6 +9,7 @@ import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
import dev.inmo.tgbotapi.types.message.ParseMode import dev.inmo.tgbotapi.types.message.ParseMode
import dev.inmo.tgbotapi.types.message.SuggestedPostParameters
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.AnimationFile import dev.inmo.tgbotapi.types.files.AnimationFile
@@ -29,11 +32,13 @@ public suspend fun TelegramBot.sendAnimation(
width: Int? = null, width: Int? = null,
height: Int? = null, height: Int? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<AnimationContent> = execute( ): ContentMessage<AnimationContent> = execute(
@@ -49,11 +54,13 @@ public suspend fun TelegramBot.sendAnimation(
width = width, width = width,
height = height, height = height,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -74,11 +81,13 @@ public suspend fun TelegramBot.sendAnimation(
width: Int? = null, width: Int? = null,
height: Int? = null, height: Int? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<AnimationContent> = sendAnimation( ): ContentMessage<AnimationContent> = sendAnimation(
@@ -93,11 +102,13 @@ public suspend fun TelegramBot.sendAnimation(
width = width, width = width,
height = height, height = height,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -118,11 +129,13 @@ public suspend fun TelegramBot.sendAnimation(
width: Int? = null, width: Int? = null,
height: Int? = null, height: Int? = null,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<AnimationContent> = sendAnimation( ): ContentMessage<AnimationContent> = sendAnimation(
@@ -137,11 +150,13 @@ public suspend fun TelegramBot.sendAnimation(
width = width, width = width,
height = height, height = height,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -161,11 +176,13 @@ public suspend fun TelegramBot.sendAnimation(
width: Int? = null, width: Int? = null,
height: Int? = null, height: Int? = null,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<AnimationContent> = sendAnimation( ): ContentMessage<AnimationContent> = sendAnimation(
@@ -179,11 +196,13 @@ public suspend fun TelegramBot.sendAnimation(
width = width, width = width,
height = height, height = height,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -204,11 +223,13 @@ public suspend fun TelegramBot.sendAnimation(
width: Int? = null, width: Int? = null,
height: Int? = null, height: Int? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<AnimationContent> = execute( ): ContentMessage<AnimationContent> = execute(
@@ -223,11 +244,13 @@ public suspend fun TelegramBot.sendAnimation(
width = width, width = width,
height = height, height = height,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -247,11 +270,13 @@ public suspend fun TelegramBot.sendAnimation(
width: Int? = null, width: Int? = null,
height: Int? = null, height: Int? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<AnimationContent> = sendAnimation( ): ContentMessage<AnimationContent> = sendAnimation(
@@ -265,11 +290,13 @@ public suspend fun TelegramBot.sendAnimation(
width = width, width = width,
height = height, height = height,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -289,11 +316,13 @@ public suspend fun TelegramBot.sendAnimation(
width: Int? = null, width: Int? = null,
height: Int? = null, height: Int? = null,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<AnimationContent> = sendAnimation( ): ContentMessage<AnimationContent> = sendAnimation(
@@ -307,11 +336,13 @@ public suspend fun TelegramBot.sendAnimation(
width = width, width = width,
height = height, height = height,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -330,11 +361,13 @@ public suspend fun TelegramBot.sendAnimation(
width: Int? = null, width: Int? = null,
height: Int? = null, height: Int? = null,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<AnimationContent> = sendAnimation( ): ContentMessage<AnimationContent> = sendAnimation(
@@ -347,11 +380,13 @@ public suspend fun TelegramBot.sendAnimation(
width = width, width = width,
height = height, height = height,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )

View File

@@ -7,6 +7,7 @@ import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
import dev.inmo.tgbotapi.types.message.ParseMode import dev.inmo.tgbotapi.types.message.ParseMode
import dev.inmo.tgbotapi.types.message.SuggestedPostParameters
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.AudioFile import dev.inmo.tgbotapi.types.files.AudioFile
@@ -27,11 +28,13 @@ public suspend fun TelegramBot.sendAudio(
performer: String? = null, performer: String? = null,
title: String? = null, title: String? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<AudioContent> = execute( ): ContentMessage<AudioContent> = execute(
@@ -45,11 +48,13 @@ public suspend fun TelegramBot.sendAudio(
performer = performer, performer = performer,
title = title, title = title,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -69,11 +74,13 @@ public suspend fun TelegramBot.sendAudio(
performer: String? = null, performer: String? = null,
title: String? = null, title: String? = null,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<AudioContent> = sendAudio( ): ContentMessage<AudioContent> = sendAudio(
@@ -86,11 +93,13 @@ public suspend fun TelegramBot.sendAudio(
performer = performer, performer = performer,
title = title, title = title,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -106,11 +115,13 @@ public suspend fun TelegramBot.sendAudio(
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
title: String? = audio.title, title: String? = audio.title,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<AudioContent> = sendAudio( ): ContentMessage<AudioContent> = sendAudio(
@@ -123,11 +134,13 @@ public suspend fun TelegramBot.sendAudio(
performer = audio.performer, performer = audio.performer,
title = title, title = title,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -143,11 +156,13 @@ public suspend fun TelegramBot.sendAudio(
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
title: String? = audio.title, title: String? = audio.title,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<AudioContent> = sendAudio( ): ContentMessage<AudioContent> = sendAudio(
@@ -157,11 +172,13 @@ public suspend fun TelegramBot.sendAudio(
parseMode = parseMode, parseMode = parseMode,
title = title, title = title,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -180,11 +197,13 @@ public suspend inline fun TelegramBot.sendAudio(
performer: String? = null, performer: String? = null,
title: String? = null, title: String? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<AudioContent> = execute( ): ContentMessage<AudioContent> = execute(
@@ -197,11 +216,13 @@ public suspend inline fun TelegramBot.sendAudio(
performer = performer, performer = performer,
title = title, title = title,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -220,11 +241,13 @@ public suspend inline fun TelegramBot.sendAudio(
performer: String? = null, performer: String? = null,
title: String? = null, title: String? = null,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<AudioContent> = sendAudio( ): ContentMessage<AudioContent> = sendAudio(
@@ -236,11 +259,13 @@ public suspend inline fun TelegramBot.sendAudio(
performer = performer, performer = performer,
title = title, title = title,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -255,11 +280,13 @@ public suspend inline fun TelegramBot.sendAudio(
entities: TextSourcesList, entities: TextSourcesList,
title: String? = audio.title, title: String? = audio.title,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<AudioContent> = sendAudio( ): ContentMessage<AudioContent> = sendAudio(
@@ -271,11 +298,13 @@ public suspend inline fun TelegramBot.sendAudio(
performer = audio.performer, performer = audio.performer,
title = title, title = title,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -290,11 +319,13 @@ public suspend inline fun TelegramBot.sendAudio(
entities: TextSourcesList, entities: TextSourcesList,
title: String? = audio.title, title: String? = audio.title,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<AudioContent> = sendAudio( ): ContentMessage<AudioContent> = sendAudio(
@@ -303,11 +334,13 @@ public suspend inline fun TelegramBot.sendAudio(
entities = entities, entities = entities,
title = title, title = title,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )

View File

@@ -7,6 +7,7 @@ import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
import dev.inmo.tgbotapi.types.message.ParseMode import dev.inmo.tgbotapi.types.message.ParseMode
import dev.inmo.tgbotapi.types.message.SuggestedPostParameters
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.DocumentFile import dev.inmo.tgbotapi.types.files.DocumentFile
@@ -24,11 +25,13 @@ public suspend fun TelegramBot.sendDocument(
text: String? = null, text: String? = null,
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null, replyMarkup: KeyboardMarkup? = null,
disableContentTypeDetection: Boolean? = null disableContentTypeDetection: Boolean? = null
@@ -40,11 +43,13 @@ public suspend fun TelegramBot.sendDocument(
text = text, text = text,
parseMode = parseMode, parseMode = parseMode,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup, replyMarkup = replyMarkup,
disableContentTypeDetection = disableContentTypeDetection disableContentTypeDetection = disableContentTypeDetection
@@ -62,11 +67,13 @@ public suspend fun TelegramBot.sendDocument(
text: String? = null, text: String? = null,
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null, replyMarkup: KeyboardMarkup? = null,
disableContentTypeDetection: Boolean? = null disableContentTypeDetection: Boolean? = null
@@ -77,11 +84,13 @@ public suspend fun TelegramBot.sendDocument(
text = text, text = text,
parseMode = parseMode, parseMode = parseMode,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup, replyMarkup = replyMarkup,
disableContentTypeDetection = disableContentTypeDetection disableContentTypeDetection = disableContentTypeDetection
@@ -97,11 +106,13 @@ public suspend fun TelegramBot.sendDocument(
text: String? = null, text: String? = null,
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null, replyMarkup: KeyboardMarkup? = null,
disableContentTypeDetection: Boolean? = null disableContentTypeDetection: Boolean? = null
@@ -112,11 +123,13 @@ public suspend fun TelegramBot.sendDocument(
text = text, text = text,
parseMode = parseMode, parseMode = parseMode,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup, replyMarkup = replyMarkup,
disableContentTypeDetection = disableContentTypeDetection disableContentTypeDetection = disableContentTypeDetection
@@ -132,11 +145,13 @@ public suspend fun TelegramBot.sendDocument(
text: String? = null, text: String? = null,
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null, replyMarkup: KeyboardMarkup? = null,
disableContentTypeDetection: Boolean? = null disableContentTypeDetection: Boolean? = null
@@ -146,11 +161,13 @@ public suspend fun TelegramBot.sendDocument(
text = text, text = text,
parseMode = parseMode, parseMode = parseMode,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup, replyMarkup = replyMarkup,
disableContentTypeDetection = disableContentTypeDetection disableContentTypeDetection = disableContentTypeDetection
@@ -166,11 +183,13 @@ public suspend inline fun TelegramBot.sendDocument(
thumb: InputFile? = null, thumb: InputFile? = null,
entities: TextSourcesList, entities: TextSourcesList,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null, replyMarkup: KeyboardMarkup? = null,
disableContentTypeDetection: Boolean? = null disableContentTypeDetection: Boolean? = null
@@ -181,11 +200,13 @@ public suspend inline fun TelegramBot.sendDocument(
thumbnail = thumb, thumbnail = thumb,
entities = entities, entities = entities,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup, replyMarkup = replyMarkup,
disableContentTypeDetection = disableContentTypeDetection disableContentTypeDetection = disableContentTypeDetection
@@ -202,11 +223,13 @@ public suspend inline fun TelegramBot.sendDocument(
thumb: InputFile? = null, thumb: InputFile? = null,
entities: TextSourcesList, entities: TextSourcesList,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null, replyMarkup: KeyboardMarkup? = null,
disableContentTypeDetection: Boolean? = null disableContentTypeDetection: Boolean? = null
@@ -216,11 +239,13 @@ public suspend inline fun TelegramBot.sendDocument(
thumb = thumb, thumb = thumb,
entities = entities, entities = entities,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup, replyMarkup = replyMarkup,
disableContentTypeDetection = disableContentTypeDetection disableContentTypeDetection = disableContentTypeDetection
@@ -235,11 +260,13 @@ public suspend inline fun TelegramBot.sendDocument(
document: DocumentFile, document: DocumentFile,
entities: TextSourcesList, entities: TextSourcesList,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null, replyMarkup: KeyboardMarkup? = null,
disableContentTypeDetection: Boolean? = null disableContentTypeDetection: Boolean? = null
@@ -249,11 +276,13 @@ public suspend inline fun TelegramBot.sendDocument(
thumb = document.thumbnail ?.fileId, thumb = document.thumbnail ?.fileId,
entities = entities, entities = entities,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup, replyMarkup = replyMarkup,
disableContentTypeDetection = disableContentTypeDetection disableContentTypeDetection = disableContentTypeDetection
@@ -268,11 +297,13 @@ public suspend inline fun TelegramBot.sendDocument(
document: DocumentFile, document: DocumentFile,
entities: TextSourcesList, entities: TextSourcesList,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null, replyMarkup: KeyboardMarkup? = null,
disableContentTypeDetection: Boolean? = null disableContentTypeDetection: Boolean? = null
@@ -281,11 +312,13 @@ public suspend inline fun TelegramBot.sendDocument(
document = document, document = document,
entities = entities, entities = entities,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup, replyMarkup = replyMarkup,
disableContentTypeDetection = disableContentTypeDetection disableContentTypeDetection = disableContentTypeDetection

View File

@@ -8,6 +8,7 @@ import dev.inmo.tgbotapi.types.media.*
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.content.* import dev.inmo.tgbotapi.types.message.content.*
import dev.inmo.tgbotapi.types.message.SuggestedPostParameters
import dev.inmo.tgbotapi.utils.RiskFeature import dev.inmo.tgbotapi.utils.RiskFeature
import kotlin.jvm.JvmName import kotlin.jvm.JvmName
@@ -19,22 +20,26 @@ public suspend fun TelegramBot.sendMediaGroup(
chatId: ChatIdentifier, chatId: ChatIdentifier,
media: List<MediaGroupMemberTelegramMedia>, media: List<MediaGroupMemberTelegramMedia>,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null replyParameters: ReplyParameters? = null
): ContentMessage<MediaGroupContent<MediaGroupPartContent>> = execute( ): ContentMessage<MediaGroupContent<MediaGroupPartContent>> = execute(
SendMediaGroup<MediaGroupPartContent>( SendMediaGroup<MediaGroupPartContent>(
chatId = chatId, chatId = chatId,
media = media, media = media,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters replyParameters = replyParameters
) )
) )
@@ -47,21 +52,25 @@ public suspend fun TelegramBot.sendMediaGroup(
chat: Chat, chat: Chat,
media: List<MediaGroupMemberTelegramMedia>, media: List<MediaGroupMemberTelegramMedia>,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null replyParameters: ReplyParameters? = null
): ContentMessage<MediaGroupContent<MediaGroupPartContent>> = sendMediaGroup( ): ContentMessage<MediaGroupContent<MediaGroupPartContent>> = sendMediaGroup(
chatId = chat.id, chatId = chat.id,
media = media, media = media,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters replyParameters = replyParameters
) )
@@ -74,21 +83,25 @@ public suspend fun TelegramBot.sendMediaGroup(
chatId: ChatIdentifier, chatId: ChatIdentifier,
media: List<MediaGroupPartContent>, media: List<MediaGroupPartContent>,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null replyParameters: ReplyParameters? = null
): ContentMessage<MediaGroupContent<MediaGroupPartContent>> = sendMediaGroup( ): ContentMessage<MediaGroupContent<MediaGroupPartContent>> = sendMediaGroup(
chatId = chatId, chatId = chatId,
media = media.map { it.toMediaGroupMemberTelegramMedia() }, media = media.map { it.toMediaGroupMemberTelegramMedia() },
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters replyParameters = replyParameters
) )
@@ -101,21 +114,25 @@ public suspend fun TelegramBot.sendMediaGroup(
chat: Chat, chat: Chat,
media: List<MediaGroupPartContent>, media: List<MediaGroupPartContent>,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null replyParameters: ReplyParameters? = null
): ContentMessage<MediaGroupContent<MediaGroupPartContent>> = sendMediaGroup( ): ContentMessage<MediaGroupContent<MediaGroupPartContent>> = sendMediaGroup(
chatId = chat.id, chatId = chat.id,
media = media, media = media,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters replyParameters = replyParameters
) )
@@ -126,22 +143,26 @@ public suspend fun TelegramBot.sendPlaylist(
chatId: ChatIdentifier, chatId: ChatIdentifier,
media: List<AudioMediaGroupMemberTelegramMedia>, media: List<AudioMediaGroupMemberTelegramMedia>,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null replyParameters: ReplyParameters? = null
): ContentMessage<MediaGroupContent<AudioContent>> = execute( ): ContentMessage<MediaGroupContent<AudioContent>> = execute(
SendPlaylist( SendPlaylist(
chatId = chatId, chatId = chatId,
media = media, media = media,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters replyParameters = replyParameters
) )
) )
@@ -153,21 +174,25 @@ public suspend fun TelegramBot.sendPlaylist(
chat: Chat, chat: Chat,
media: List<AudioMediaGroupMemberTelegramMedia>, media: List<AudioMediaGroupMemberTelegramMedia>,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null replyParameters: ReplyParameters? = null
): ContentMessage<MediaGroupContent<AudioContent>> = sendPlaylist( ): ContentMessage<MediaGroupContent<AudioContent>> = sendPlaylist(
chatId = chat.id, chatId = chat.id,
media = media, media = media,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters replyParameters = replyParameters
) )
@@ -179,21 +204,25 @@ public suspend fun TelegramBot.sendPlaylist(
chatId: ChatIdentifier, chatId: ChatIdentifier,
media: List<AudioContent>, media: List<AudioContent>,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null replyParameters: ReplyParameters? = null
): ContentMessage<MediaGroupContent<AudioContent>> = sendPlaylist( ): ContentMessage<MediaGroupContent<AudioContent>> = sendPlaylist(
chatId = chatId, chatId = chatId,
media = media.map { it.toMediaGroupMemberTelegramMedia() }, media = media.map { it.toMediaGroupMemberTelegramMedia() },
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters replyParameters = replyParameters
) )
@@ -205,21 +234,25 @@ public suspend fun TelegramBot.sendPlaylist(
chat: Chat, chat: Chat,
media: List<AudioContent>, media: List<AudioContent>,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null replyParameters: ReplyParameters? = null
): ContentMessage<MediaGroupContent<AudioContent>> = sendPlaylist( ): ContentMessage<MediaGroupContent<AudioContent>> = sendPlaylist(
chatId = chat.id, chatId = chat.id,
media = media, media = media,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters replyParameters = replyParameters
) )
@@ -230,22 +263,26 @@ public suspend fun TelegramBot.sendDocumentsGroup(
chatId: ChatIdentifier, chatId: ChatIdentifier,
media: List<DocumentMediaGroupMemberTelegramMedia>, media: List<DocumentMediaGroupMemberTelegramMedia>,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null replyParameters: ReplyParameters? = null
): ContentMessage<MediaGroupContent<DocumentContent>> = execute( ): ContentMessage<MediaGroupContent<DocumentContent>> = execute(
SendDocumentsGroup( SendDocumentsGroup(
chatId = chatId, chatId = chatId,
media = media, media = media,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters replyParameters = replyParameters
) )
) )
@@ -257,21 +294,25 @@ public suspend fun TelegramBot.sendDocumentsGroup(
chat: Chat, chat: Chat,
media: List<DocumentMediaGroupMemberTelegramMedia>, media: List<DocumentMediaGroupMemberTelegramMedia>,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null replyParameters: ReplyParameters? = null
): ContentMessage<MediaGroupContent<DocumentContent>> = sendDocumentsGroup( ): ContentMessage<MediaGroupContent<DocumentContent>> = sendDocumentsGroup(
chatId = chat.id, chatId = chat.id,
media = media, media = media,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters replyParameters = replyParameters
) )
@@ -283,21 +324,25 @@ public suspend fun TelegramBot.sendDocumentsGroup(
chatId: ChatIdentifier, chatId: ChatIdentifier,
media: List<DocumentContent>, media: List<DocumentContent>,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null replyParameters: ReplyParameters? = null
): ContentMessage<MediaGroupContent<DocumentContent>> = sendDocumentsGroup( ): ContentMessage<MediaGroupContent<DocumentContent>> = sendDocumentsGroup(
chatId = chatId, chatId = chatId,
media = media.map { it.toMediaGroupMemberTelegramMedia() }, media = media.map { it.toMediaGroupMemberTelegramMedia() },
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters replyParameters = replyParameters
) )
@@ -309,21 +354,25 @@ public suspend fun TelegramBot.sendDocumentsGroup(
chat: Chat, chat: Chat,
media: List<DocumentContent>, media: List<DocumentContent>,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null replyParameters: ReplyParameters? = null
): ContentMessage<MediaGroupContent<DocumentContent>> = sendDocumentsGroup( ): ContentMessage<MediaGroupContent<DocumentContent>> = sendDocumentsGroup(
chatId = chat.id, chatId = chat.id,
media = media, media = media,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters replyParameters = replyParameters
) )
@@ -334,22 +383,26 @@ public suspend fun TelegramBot.sendVisualMediaGroup(
chatId: ChatIdentifier, chatId: ChatIdentifier,
media: List<VisualMediaGroupMemberTelegramMedia>, media: List<VisualMediaGroupMemberTelegramMedia>,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null replyParameters: ReplyParameters? = null
): ContentMessage<MediaGroupContent<VisualMediaGroupPartContent>> = execute( ): ContentMessage<MediaGroupContent<VisualMediaGroupPartContent>> = execute(
SendVisualMediaGroup( SendVisualMediaGroup(
chatId = chatId, chatId = chatId,
media = media, media = media,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters replyParameters = replyParameters
) )
) )
@@ -361,21 +414,25 @@ public suspend fun TelegramBot.sendVisualMediaGroup(
chat: Chat, chat: Chat,
media: List<VisualMediaGroupMemberTelegramMedia>, media: List<VisualMediaGroupMemberTelegramMedia>,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null replyParameters: ReplyParameters? = null
): ContentMessage<MediaGroupContent<VisualMediaGroupPartContent>> = sendVisualMediaGroup( ): ContentMessage<MediaGroupContent<VisualMediaGroupPartContent>> = sendVisualMediaGroup(
chatId = chat.id, chatId = chat.id,
media = media, media = media,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters replyParameters = replyParameters
) )
@@ -387,21 +444,25 @@ public suspend fun TelegramBot.sendVisualMediaGroup(
chatId: ChatIdentifier, chatId: ChatIdentifier,
media: List<VisualMediaGroupPartContent>, media: List<VisualMediaGroupPartContent>,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null replyParameters: ReplyParameters? = null
): ContentMessage<MediaGroupContent<VisualMediaGroupPartContent>> = sendVisualMediaGroup( ): ContentMessage<MediaGroupContent<VisualMediaGroupPartContent>> = sendVisualMediaGroup(
chatId = chatId, chatId = chatId,
media = media.map { it.toMediaGroupMemberTelegramMedia() }, media = media.map { it.toMediaGroupMemberTelegramMedia() },
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters replyParameters = replyParameters
) )
@@ -413,20 +474,24 @@ public suspend fun TelegramBot.sendVisualMediaGroup(
chat: Chat, chat: Chat,
media: List<VisualMediaGroupPartContent>, media: List<VisualMediaGroupPartContent>,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null replyParameters: ReplyParameters? = null
): ContentMessage<MediaGroupContent<VisualMediaGroupPartContent>> = sendVisualMediaGroup( ): ContentMessage<MediaGroupContent<VisualMediaGroupPartContent>> = sendVisualMediaGroup(
chatId = chat.id, chatId = chat.id,
media = media, media = media,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters replyParameters = replyParameters
) )

View File

@@ -1,3 +1,5 @@
@file:Suppress("KDocUnresolvedReference")
package dev.inmo.tgbotapi.extensions.api.send.media package dev.inmo.tgbotapi.extensions.api.send.media
import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.bot.TelegramBot
@@ -6,6 +8,7 @@ import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
import dev.inmo.tgbotapi.types.message.ParseMode import dev.inmo.tgbotapi.types.message.ParseMode
import dev.inmo.tgbotapi.types.message.SuggestedPostParameters
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.media.TelegramPaidMedia import dev.inmo.tgbotapi.types.media.TelegramPaidMedia
@@ -25,10 +28,12 @@ public suspend fun TelegramBot.sendPaidMedia(
payload: PaidMediaPayload? = null, payload: PaidMediaPayload? = null,
showCaptionAboveMedia: Boolean = false, showCaptionAboveMedia: Boolean = false,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<PaidMediaInfoContent> = execute( ): ContentMessage<PaidMediaInfoContent> = execute(
@@ -41,10 +46,12 @@ public suspend fun TelegramBot.sendPaidMedia(
payload = payload, payload = payload,
showCaptionAboveMedia = showCaptionAboveMedia, showCaptionAboveMedia = showCaptionAboveMedia,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -63,10 +70,12 @@ public suspend fun TelegramBot.sendPaidMedia(
payload: PaidMediaPayload? = null, payload: PaidMediaPayload? = null,
showCaptionAboveMedia: Boolean = false, showCaptionAboveMedia: Boolean = false,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<PaidMediaInfoContent> = sendPaidMedia( ): ContentMessage<PaidMediaInfoContent> = sendPaidMedia(
@@ -78,10 +87,12 @@ public suspend fun TelegramBot.sendPaidMedia(
payload = payload, payload = payload,
showCaptionAboveMedia = showCaptionAboveMedia, showCaptionAboveMedia = showCaptionAboveMedia,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -99,10 +110,12 @@ public suspend inline fun TelegramBot.sendPaidMedia(
payload: PaidMediaPayload? = null, payload: PaidMediaPayload? = null,
showCaptionAboveMedia: Boolean = false, showCaptionAboveMedia: Boolean = false,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<PaidMediaInfoContent> = execute( ): ContentMessage<PaidMediaInfoContent> = execute(
@@ -114,10 +127,12 @@ public suspend inline fun TelegramBot.sendPaidMedia(
payload = payload, payload = payload,
showCaptionAboveMedia = showCaptionAboveMedia, showCaptionAboveMedia = showCaptionAboveMedia,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -135,10 +150,12 @@ public suspend inline fun TelegramBot.sendPaidMedia(
payload: PaidMediaPayload? = null, payload: PaidMediaPayload? = null,
showCaptionAboveMedia: Boolean = false, showCaptionAboveMedia: Boolean = false,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<PaidMediaInfoContent> = sendPaidMedia( ): ContentMessage<PaidMediaInfoContent> = sendPaidMedia(
@@ -149,10 +166,12 @@ public suspend inline fun TelegramBot.sendPaidMedia(
payload = payload, payload = payload,
showCaptionAboveMedia = showCaptionAboveMedia, showCaptionAboveMedia = showCaptionAboveMedia,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )

View File

@@ -1,3 +1,5 @@
@file:Suppress("KDocUnresolvedReference")
package dev.inmo.tgbotapi.extensions.api.send.media package dev.inmo.tgbotapi.extensions.api.send.media
import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.bot.TelegramBot
@@ -7,6 +9,7 @@ import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
import dev.inmo.tgbotapi.types.message.ParseMode import dev.inmo.tgbotapi.types.message.ParseMode
import dev.inmo.tgbotapi.types.message.SuggestedPostParameters
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.* import dev.inmo.tgbotapi.types.files.*
@@ -25,11 +28,13 @@ public suspend fun TelegramBot.sendPhoto(
showCaptionAboveMedia: Boolean = false, showCaptionAboveMedia: Boolean = false,
spoilered: Boolean = false, spoilered: Boolean = false,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<PhotoContent> = execute( ): ContentMessage<PhotoContent> = execute(
@@ -41,11 +46,13 @@ public suspend fun TelegramBot.sendPhoto(
showCaptionAboveMedia = showCaptionAboveMedia, showCaptionAboveMedia = showCaptionAboveMedia,
spoilered = spoilered, spoilered = spoilered,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -63,11 +70,13 @@ public suspend fun TelegramBot.sendPhoto(
showCaptionAboveMedia: Boolean = false, showCaptionAboveMedia: Boolean = false,
spoilered: Boolean = false, spoilered: Boolean = false,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<PhotoContent> = sendPhoto( ): ContentMessage<PhotoContent> = sendPhoto(
@@ -78,11 +87,13 @@ public suspend fun TelegramBot.sendPhoto(
showCaptionAboveMedia = showCaptionAboveMedia, showCaptionAboveMedia = showCaptionAboveMedia,
spoilered = spoilered, spoilered = spoilered,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -99,11 +110,13 @@ public suspend fun TelegramBot.sendPhoto(
showCaptionAboveMedia: Boolean = false, showCaptionAboveMedia: Boolean = false,
spoilered: Boolean = false, spoilered: Boolean = false,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<PhotoContent> = sendPhoto( ): ContentMessage<PhotoContent> = sendPhoto(
@@ -114,11 +127,13 @@ public suspend fun TelegramBot.sendPhoto(
showCaptionAboveMedia = showCaptionAboveMedia, showCaptionAboveMedia = showCaptionAboveMedia,
spoilered = spoilered, spoilered = spoilered,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -135,11 +150,13 @@ public suspend fun TelegramBot.sendPhoto(
showCaptionAboveMedia: Boolean = false, showCaptionAboveMedia: Boolean = false,
spoilered: Boolean = false, spoilered: Boolean = false,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<PhotoContent> = sendPhoto( ): ContentMessage<PhotoContent> = sendPhoto(
@@ -150,11 +167,13 @@ public suspend fun TelegramBot.sendPhoto(
showCaptionAboveMedia = showCaptionAboveMedia, showCaptionAboveMedia = showCaptionAboveMedia,
spoilered = spoilered, spoilered = spoilered,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -171,11 +190,13 @@ public suspend fun TelegramBot.sendPhoto(
showCaptionAboveMedia: Boolean = false, showCaptionAboveMedia: Boolean = false,
spoilered: Boolean = false, spoilered: Boolean = false,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<PhotoContent> = sendPhoto( ): ContentMessage<PhotoContent> = sendPhoto(
@@ -186,11 +207,13 @@ public suspend fun TelegramBot.sendPhoto(
showCaptionAboveMedia = showCaptionAboveMedia, showCaptionAboveMedia = showCaptionAboveMedia,
spoilered = spoilered, spoilered = spoilered,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -207,11 +230,13 @@ public suspend fun TelegramBot.sendPhoto(
showCaptionAboveMedia: Boolean = false, showCaptionAboveMedia: Boolean = false,
spoilered: Boolean = false, spoilered: Boolean = false,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<PhotoContent> = sendPhoto( ): ContentMessage<PhotoContent> = sendPhoto(
@@ -222,11 +247,13 @@ public suspend fun TelegramBot.sendPhoto(
showCaptionAboveMedia = showCaptionAboveMedia, showCaptionAboveMedia = showCaptionAboveMedia,
spoilered = spoilered, spoilered = spoilered,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -243,11 +270,13 @@ public suspend inline fun TelegramBot.sendPhoto(
showCaptionAboveMedia: Boolean = false, showCaptionAboveMedia: Boolean = false,
spoilered: Boolean = false, spoilered: Boolean = false,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<PhotoContent> = execute( ): ContentMessage<PhotoContent> = execute(
@@ -258,11 +287,13 @@ public suspend inline fun TelegramBot.sendPhoto(
showCaptionAboveMedia = showCaptionAboveMedia, showCaptionAboveMedia = showCaptionAboveMedia,
spoilered = spoilered, spoilered = spoilered,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -279,11 +310,13 @@ public suspend inline fun TelegramBot.sendPhoto(
showCaptionAboveMedia: Boolean = false, showCaptionAboveMedia: Boolean = false,
spoilered: Boolean = false, spoilered: Boolean = false,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<PhotoContent> = sendPhoto( ): ContentMessage<PhotoContent> = sendPhoto(
@@ -293,11 +326,13 @@ public suspend inline fun TelegramBot.sendPhoto(
showCaptionAboveMedia = showCaptionAboveMedia, showCaptionAboveMedia = showCaptionAboveMedia,
spoilered = spoilered, spoilered = spoilered,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -313,11 +348,13 @@ public suspend inline fun TelegramBot.sendPhoto(
showCaptionAboveMedia: Boolean = false, showCaptionAboveMedia: Boolean = false,
spoilered: Boolean = false, spoilered: Boolean = false,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<PhotoContent> = sendPhoto( ): ContentMessage<PhotoContent> = sendPhoto(
@@ -327,11 +364,13 @@ public suspend inline fun TelegramBot.sendPhoto(
showCaptionAboveMedia = showCaptionAboveMedia, showCaptionAboveMedia = showCaptionAboveMedia,
spoilered = spoilered, spoilered = spoilered,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -347,11 +386,13 @@ public suspend inline fun TelegramBot.sendPhoto(
showCaptionAboveMedia: Boolean = false, showCaptionAboveMedia: Boolean = false,
spoilered: Boolean = false, spoilered: Boolean = false,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<PhotoContent> = sendPhoto( ): ContentMessage<PhotoContent> = sendPhoto(
@@ -361,11 +402,13 @@ public suspend inline fun TelegramBot.sendPhoto(
showCaptionAboveMedia = showCaptionAboveMedia, showCaptionAboveMedia = showCaptionAboveMedia,
spoilered = spoilered, spoilered = spoilered,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -381,11 +424,13 @@ public suspend inline fun TelegramBot.sendPhoto(
showCaptionAboveMedia: Boolean = false, showCaptionAboveMedia: Boolean = false,
spoilered: Boolean = false, spoilered: Boolean = false,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<PhotoContent> = sendPhoto( ): ContentMessage<PhotoContent> = sendPhoto(
@@ -395,11 +440,13 @@ public suspend inline fun TelegramBot.sendPhoto(
showCaptionAboveMedia = showCaptionAboveMedia, showCaptionAboveMedia = showCaptionAboveMedia,
spoilered = spoilered, spoilered = spoilered,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -415,11 +462,13 @@ public suspend inline fun TelegramBot.sendPhoto(
showCaptionAboveMedia: Boolean = false, showCaptionAboveMedia: Boolean = false,
spoilered: Boolean = false, spoilered: Boolean = false,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<PhotoContent> = sendPhoto( ): ContentMessage<PhotoContent> = sendPhoto(
@@ -429,11 +478,13 @@ public suspend inline fun TelegramBot.sendPhoto(
showCaptionAboveMedia = showCaptionAboveMedia, showCaptionAboveMedia = showCaptionAboveMedia,
spoilered = spoilered, spoilered = spoilered,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )

View File

@@ -1,3 +1,5 @@
@file:Suppress("KDocUnresolvedReference")
package dev.inmo.tgbotapi.extensions.api.send.media package dev.inmo.tgbotapi.extensions.api.send.media
import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.bot.TelegramBot
@@ -10,6 +12,7 @@ import dev.inmo.tgbotapi.types.chat.Chat
import dev.inmo.tgbotapi.types.files.Sticker import dev.inmo.tgbotapi.types.files.Sticker
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
import dev.inmo.tgbotapi.types.message.content.StickerContent import dev.inmo.tgbotapi.types.message.content.StickerContent
import dev.inmo.tgbotapi.types.message.SuggestedPostParameters
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@@ -19,12 +22,14 @@ public suspend fun TelegramBot.sendSticker(
chatId: ChatIdentifier, chatId: ChatIdentifier,
sticker: InputFile, sticker: InputFile,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
emoji: String? = null, emoji: String? = null,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<StickerContent> = execute( ): ContentMessage<StickerContent> = execute(
@@ -32,12 +37,14 @@ public suspend fun TelegramBot.sendSticker(
chatId = chatId, chatId = chatId,
sticker = sticker, sticker = sticker,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
emoji = emoji, emoji = emoji,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -51,24 +58,28 @@ public suspend fun TelegramBot.sendSticker(
chat: Chat, chat: Chat,
sticker: InputFile, sticker: InputFile,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
emoji: String? = null, emoji: String? = null,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<StickerContent> = sendSticker( ): ContentMessage<StickerContent> = sendSticker(
chatId = chat.id, chatId = chat.id,
sticker = sticker, sticker = sticker,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
emoji = emoji, emoji = emoji,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -81,24 +92,28 @@ public suspend fun TelegramBot.sendSticker(
chatId: ChatIdentifier, chatId: ChatIdentifier,
sticker: Sticker, sticker: Sticker,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
emoji: String? = null, emoji: String? = null,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<StickerContent> = sendSticker( ): ContentMessage<StickerContent> = sendSticker(
chatId = chatId, chatId = chatId,
sticker = sticker.fileId, sticker = sticker.fileId,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
emoji = emoji, emoji = emoji,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -111,24 +126,28 @@ public suspend fun TelegramBot.sendSticker(
chat: Chat, chat: Chat,
sticker: Sticker, sticker: Sticker,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
emoji: String? = null, emoji: String? = null,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<StickerContent> = sendSticker( ): ContentMessage<StickerContent> = sendSticker(
chat = chat, chat = chat,
sticker = sticker.fileId, sticker = sticker.fileId,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
emoji = emoji, emoji = emoji,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )

View File

@@ -1,3 +1,5 @@
@file:Suppress("KDocUnresolvedReference")
package dev.inmo.tgbotapi.extensions.api.send.media package dev.inmo.tgbotapi.extensions.api.send.media
import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.bot.TelegramBot
@@ -7,6 +9,7 @@ import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
import dev.inmo.tgbotapi.types.message.ParseMode import dev.inmo.tgbotapi.types.message.ParseMode
import dev.inmo.tgbotapi.types.message.SuggestedPostParameters
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.VideoFile import dev.inmo.tgbotapi.types.files.VideoFile
@@ -31,11 +34,13 @@ public suspend fun TelegramBot.sendVideo(
width: Int? = null, width: Int? = null,
height: Int? = null, height: Int? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<VideoContent> = execute( ): ContentMessage<VideoContent> = execute(
@@ -54,11 +59,13 @@ public suspend fun TelegramBot.sendVideo(
height = height, height = height,
supportStreaming = null, supportStreaming = null,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -76,11 +83,13 @@ public suspend fun TelegramBot.sendVideo(
showCaptionAboveMedia: Boolean = false, showCaptionAboveMedia: Boolean = false,
spoilered: Boolean = false, spoilered: Boolean = false,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<VideoContent> = sendVideo( ): ContentMessage<VideoContent> = sendVideo(
@@ -97,11 +106,13 @@ public suspend fun TelegramBot.sendVideo(
width = video.width, width = video.width,
height = video.height, height = video.height,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -124,11 +135,13 @@ public suspend fun TelegramBot.sendVideo(
width: Int? = null, width: Int? = null,
height: Int? = null, height: Int? = null,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<VideoContent> = sendVideo( ): ContentMessage<VideoContent> = sendVideo(
@@ -145,11 +158,13 @@ public suspend fun TelegramBot.sendVideo(
width = width, width = width,
height = height, height = height,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -167,11 +182,13 @@ public suspend fun TelegramBot.sendVideo(
showCaptionAboveMedia: Boolean = false, showCaptionAboveMedia: Boolean = false,
spoilered: Boolean = false, spoilered: Boolean = false,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<VideoContent> = sendVideo( ): ContentMessage<VideoContent> = sendVideo(
@@ -182,11 +199,13 @@ public suspend fun TelegramBot.sendVideo(
showCaptionAboveMedia = showCaptionAboveMedia, showCaptionAboveMedia = showCaptionAboveMedia,
spoilered = spoilered, spoilered = spoilered,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -208,11 +227,13 @@ public suspend inline fun TelegramBot.sendVideo(
width: Int? = null, width: Int? = null,
height: Int? = null, height: Int? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<VideoContent> = execute( ): ContentMessage<VideoContent> = execute(
@@ -230,11 +251,13 @@ public suspend inline fun TelegramBot.sendVideo(
height = height, height = height,
supportStreaming = null, supportStreaming = null,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -251,11 +274,13 @@ public suspend inline fun TelegramBot.sendVideo(
showCaptionAboveMedia: Boolean = false, showCaptionAboveMedia: Boolean = false,
spoilered: Boolean = false, spoilered: Boolean = false,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<VideoContent> = sendVideo( ): ContentMessage<VideoContent> = sendVideo(
@@ -271,11 +296,13 @@ public suspend inline fun TelegramBot.sendVideo(
width = video.width, width = video.width,
height = video.height, height = video.height,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -297,11 +324,13 @@ public suspend inline fun TelegramBot.sendVideo(
width: Int? = null, width: Int? = null,
height: Int? = null, height: Int? = null,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<VideoContent> = sendVideo( ): ContentMessage<VideoContent> = sendVideo(
@@ -317,11 +346,13 @@ public suspend inline fun TelegramBot.sendVideo(
width = width, width = width,
height = height, height = height,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -338,11 +369,13 @@ public suspend inline fun TelegramBot.sendVideo(
showCaptionAboveMedia: Boolean = false, showCaptionAboveMedia: Boolean = false,
spoilered: Boolean = false, spoilered: Boolean = false,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<VideoContent> = sendVideo( ): ContentMessage<VideoContent> = sendVideo(
@@ -352,11 +385,13 @@ public suspend inline fun TelegramBot.sendVideo(
showCaptionAboveMedia = showCaptionAboveMedia, showCaptionAboveMedia = showCaptionAboveMedia,
spoilered = spoilered, spoilered = spoilered,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )

View File

@@ -7,6 +7,7 @@ import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
import dev.inmo.tgbotapi.types.chat.Chat import dev.inmo.tgbotapi.types.chat.Chat
import dev.inmo.tgbotapi.types.message.SuggestedPostParameters
import dev.inmo.tgbotapi.types.files.VideoNoteFile import dev.inmo.tgbotapi.types.files.VideoNoteFile
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
import dev.inmo.tgbotapi.types.message.content.VideoNoteContent import dev.inmo.tgbotapi.types.message.content.VideoNoteContent
@@ -22,11 +23,13 @@ public suspend fun TelegramBot.sendVideoNote(
duration: Long? = null, duration: Long? = null,
size: Int? = null, size: Int? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<VideoNoteContent> = execute( ): ContentMessage<VideoNoteContent> = execute(
@@ -37,11 +40,13 @@ public suspend fun TelegramBot.sendVideoNote(
duration = duration, duration = duration,
size = size, size = size,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -55,11 +60,13 @@ public suspend fun TelegramBot.sendVideoNote(
chatId: ChatIdentifier, chatId: ChatIdentifier,
videoNote: VideoNoteFile, videoNote: VideoNoteFile,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<VideoNoteContent> = sendVideoNote( ): ContentMessage<VideoNoteContent> = sendVideoNote(
@@ -69,11 +76,13 @@ public suspend fun TelegramBot.sendVideoNote(
duration = videoNote.duration, duration = videoNote.duration,
size = videoNote.width, size = videoNote.width,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -89,11 +98,13 @@ public suspend fun TelegramBot.sendVideoNote(
duration: Long? = null, duration: Long? = null,
size: Int? = null, size: Int? = null,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<VideoNoteContent> = sendVideoNote( ): ContentMessage<VideoNoteContent> = sendVideoNote(
@@ -103,11 +114,13 @@ public suspend fun TelegramBot.sendVideoNote(
duration = duration, duration = duration,
size = size, size = size,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -120,22 +133,26 @@ public suspend fun TelegramBot.sendVideoNote(
chat: Chat, chat: Chat,
videoNote: VideoNoteFile, videoNote: VideoNoteFile,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<VideoNoteContent> = sendVideoNote( ): ContentMessage<VideoNoteContent> = sendVideoNote(
chatId = chat.id, chatId = chat.id,
videoNote = videoNote, videoNote = videoNote,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )

View File

@@ -7,6 +7,7 @@ import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
import dev.inmo.tgbotapi.types.message.ParseMode import dev.inmo.tgbotapi.types.message.ParseMode
import dev.inmo.tgbotapi.types.message.SuggestedPostParameters
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.VoiceFile import dev.inmo.tgbotapi.types.files.VoiceFile
@@ -24,11 +25,13 @@ public suspend fun TelegramBot.sendVoice(
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
duration: Long? = null, duration: Long? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<VoiceContent> = execute( ): ContentMessage<VoiceContent> = execute(
@@ -39,11 +42,13 @@ public suspend fun TelegramBot.sendVoice(
parseMode = parseMode, parseMode = parseMode,
duration = duration, duration = duration,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -60,11 +65,13 @@ public suspend fun TelegramBot.sendVoice(
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
duration: Long? = null, duration: Long? = null,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<VoiceContent> = sendVoice( ): ContentMessage<VoiceContent> = sendVoice(
@@ -74,11 +81,13 @@ public suspend fun TelegramBot.sendVoice(
parseMode = parseMode, parseMode = parseMode,
duration = duration, duration = duration,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -93,11 +102,13 @@ public suspend fun TelegramBot.sendVoice(
text: String? = null, text: String? = null,
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<VoiceContent> = sendVoice( ): ContentMessage<VoiceContent> = sendVoice(
@@ -107,11 +118,13 @@ public suspend fun TelegramBot.sendVoice(
parseMode = parseMode, parseMode = parseMode,
duration = voice.duration, duration = voice.duration,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -126,11 +139,13 @@ public suspend fun TelegramBot.sendVoice(
text: String? = null, text: String? = null,
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<VoiceContent> = sendVoice( ): ContentMessage<VoiceContent> = sendVoice(
@@ -139,11 +154,13 @@ public suspend fun TelegramBot.sendVoice(
text = text, text = text,
parseMode = parseMode, parseMode = parseMode,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -159,11 +176,13 @@ public suspend inline fun TelegramBot.sendVoice(
entities: TextSourcesList, entities: TextSourcesList,
duration: Long? = null, duration: Long? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<VoiceContent> = execute( ): ContentMessage<VoiceContent> = execute(
@@ -172,12 +191,14 @@ public suspend inline fun TelegramBot.sendVoice(
voice = voice, voice = voice,
entities = entities, entities = entities,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
duration = duration, duration = duration,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -193,11 +214,13 @@ public suspend inline fun TelegramBot.sendVoice(
entities: TextSourcesList, entities: TextSourcesList,
duration: Long? = null, duration: Long? = null,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<VoiceContent> = sendVoice( ): ContentMessage<VoiceContent> = sendVoice(
@@ -206,11 +229,13 @@ public suspend inline fun TelegramBot.sendVoice(
entities = entities, entities = entities,
duration = duration, duration = duration,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -224,11 +249,13 @@ public suspend inline fun TelegramBot.sendVoice(
voice: VoiceFile, voice: VoiceFile,
entities: TextSourcesList, entities: TextSourcesList,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<VoiceContent> = sendVoice( ): ContentMessage<VoiceContent> = sendVoice(
@@ -237,11 +264,13 @@ public suspend inline fun TelegramBot.sendVoice(
entities = entities, entities = entities,
duration = voice.duration, duration = voice.duration,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -254,11 +283,13 @@ public suspend inline fun TelegramBot.sendVoice(
voice: VoiceFile, voice: VoiceFile,
entities: TextSourcesList, entities: TextSourcesList,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<VoiceContent> = sendVoice( ): ContentMessage<VoiceContent> = sendVoice(
@@ -266,11 +297,13 @@ public suspend inline fun TelegramBot.sendVoice(
voice = voice, voice = voice,
entities = entities, entities = entities,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )

View File

@@ -1,3 +1,5 @@
@file:Suppress("KDocUnresolvedReference")
package dev.inmo.tgbotapi.extensions.api.send.payments package dev.inmo.tgbotapi.extensions.api.send.payments
import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.bot.TelegramBot
@@ -5,11 +7,11 @@ import dev.inmo.tgbotapi.requests.send.payments.SendInvoice
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
import dev.inmo.tgbotapi.types.chat.CommonUser import dev.inmo.tgbotapi.types.chat.CommonUser
import dev.inmo.tgbotapi.types.message.SuggestedPostParameters
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
import dev.inmo.tgbotapi.types.message.content.InvoiceContent import dev.inmo.tgbotapi.types.message.content.InvoiceContent
import dev.inmo.tgbotapi.types.payments.LabeledPrice import dev.inmo.tgbotapi.types.payments.LabeledPrice
import dev.inmo.tgbotapi.types.payments.abstracts.Currency import dev.inmo.tgbotapi.types.payments.abstracts.Currency
import dev.inmo.tgbotapi.types.payments.abstracts.XTR
/** /**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
@@ -35,10 +37,12 @@ public suspend fun TelegramBot.sendInvoice(
shouldSendEmailToProvider: Boolean = false, shouldSendEmailToProvider: Boolean = false,
priceDependOnShipAddress: Boolean = false, priceDependOnShipAddress: Boolean = false,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: InlineKeyboardMarkup? = null replyMarkup: InlineKeyboardMarkup? = null
): ContentMessage<InvoiceContent> = execute( ): ContentMessage<InvoiceContent> = execute(
@@ -62,10 +66,12 @@ public suspend fun TelegramBot.sendInvoice(
shouldSendEmailToProvider = shouldSendEmailToProvider, shouldSendEmailToProvider = shouldSendEmailToProvider,
priceDependOnShipAddress = priceDependOnShipAddress, priceDependOnShipAddress = priceDependOnShipAddress,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -98,6 +104,7 @@ public suspend fun TelegramBot.sendInvoice(
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: InlineKeyboardMarkup? = null replyMarkup: InlineKeyboardMarkup? = null
): ContentMessage<InvoiceContent> = sendInvoice( ): ContentMessage<InvoiceContent> = sendInvoice(
@@ -120,10 +127,12 @@ public suspend fun TelegramBot.sendInvoice(
shouldSendEmailToProvider = shouldSendEmailToProvider, shouldSendEmailToProvider = shouldSendEmailToProvider,
priceDependOnShipAddress = priceDependOnShipAddress, priceDependOnShipAddress = priceDependOnShipAddress,
threadId = null, threadId = null,
directMessageThreadId = null,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -142,10 +151,12 @@ public suspend fun TelegramBot.sendInvoice(
startParameter: StartParameter? = null, startParameter: StartParameter? = null,
providerData: String? = null, providerData: String? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: InlineKeyboardMarkup? = null replyMarkup: InlineKeyboardMarkup? = null
): ContentMessage<InvoiceContent> = execute( ): ContentMessage<InvoiceContent> = execute(
@@ -158,10 +169,12 @@ public suspend fun TelegramBot.sendInvoice(
startParameter = startParameter, startParameter = startParameter,
providerData = providerData, providerData = providerData,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -183,6 +196,7 @@ public suspend fun TelegramBot.sendInvoice(
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: InlineKeyboardMarkup? = null replyMarkup: InlineKeyboardMarkup? = null
): ContentMessage<InvoiceContent> = sendInvoice( ): ContentMessage<InvoiceContent> = sendInvoice(
@@ -194,10 +208,12 @@ public suspend fun TelegramBot.sendInvoice(
startParameter = startParameter, startParameter = startParameter,
providerData = providerData, providerData = providerData,
threadId = null, threadId = null,
directMessageThreadId = null,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )

View File

@@ -6,6 +6,7 @@ import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
import dev.inmo.tgbotapi.types.message.ParseMode import dev.inmo.tgbotapi.types.message.ParseMode
import dev.inmo.tgbotapi.types.message.SuggestedPostParameters
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
import dev.inmo.tgbotapi.types.message.content.PollContent import dev.inmo.tgbotapi.types.message.content.PollContent
import dev.inmo.tgbotapi.types.message.textsources.TextSource import dev.inmo.tgbotapi.types.message.textsources.TextSource
@@ -26,11 +27,13 @@ public suspend fun TelegramBot.sendQuizPoll(
openPeriod: LongSeconds? = null, openPeriod: LongSeconds? = null,
closeDate: LongSeconds? = null, closeDate: LongSeconds? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<PollContent> = execute( ): ContentMessage<PollContent> = execute(
@@ -47,11 +50,13 @@ public suspend fun TelegramBot.sendQuizPoll(
openPeriod = openPeriod, openPeriod = openPeriod,
closeDate = closeDate, closeDate = closeDate,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -69,11 +74,13 @@ public suspend fun TelegramBot.sendQuizPoll(
openPeriod: LongSeconds? = null, openPeriod: LongSeconds? = null,
closeDate: LongSeconds? = null, closeDate: LongSeconds? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<PollContent> = execute( ): ContentMessage<PollContent> = execute(
@@ -89,11 +96,13 @@ public suspend fun TelegramBot.sendQuizPoll(
openPeriod = openPeriod, openPeriod = openPeriod,
closeDate = closeDate, closeDate = closeDate,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -111,11 +120,13 @@ public suspend fun TelegramBot.sendQuizPoll(
openPeriod: LongSeconds? = null, openPeriod: LongSeconds? = null,
closeDate: LongSeconds? = null, closeDate: LongSeconds? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<PollContent> = execute( ): ContentMessage<PollContent> = execute(
@@ -131,11 +142,13 @@ public suspend fun TelegramBot.sendQuizPoll(
openPeriod = openPeriod, openPeriod = openPeriod,
closeDate = closeDate, closeDate = closeDate,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -153,11 +166,13 @@ public suspend fun TelegramBot.sendQuizPoll(
openPeriod: LongSeconds? = null, openPeriod: LongSeconds? = null,
closeDate: LongSeconds? = null, closeDate: LongSeconds? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<PollContent> = execute( ): ContentMessage<PollContent> = execute(
@@ -172,11 +187,13 @@ public suspend fun TelegramBot.sendQuizPoll(
openPeriod = openPeriod, openPeriod = openPeriod,
closeDate = closeDate, closeDate = closeDate,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -194,11 +211,13 @@ public suspend fun TelegramBot.sendQuizPoll(
isAnonymous: Boolean = true, isAnonymous: Boolean = true,
isClosed: Boolean = false, isClosed: Boolean = false,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<PollContent> = execute( ): ContentMessage<PollContent> = execute(
@@ -214,11 +233,13 @@ public suspend fun TelegramBot.sendQuizPoll(
isAnonymous = isAnonymous, isAnonymous = isAnonymous,
isClosed = isClosed, isClosed = isClosed,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -235,11 +256,13 @@ public suspend fun TelegramBot.sendQuizPoll(
isAnonymous: Boolean = true, isAnonymous: Boolean = true,
isClosed: Boolean = false, isClosed: Boolean = false,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<PollContent> = execute( ): ContentMessage<PollContent> = execute(
@@ -254,11 +277,13 @@ public suspend fun TelegramBot.sendQuizPoll(
isAnonymous = isAnonymous, isAnonymous = isAnonymous,
isClosed = isClosed, isClosed = isClosed,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -275,11 +300,13 @@ public suspend fun TelegramBot.sendQuizPoll(
isAnonymous: Boolean = true, isAnonymous: Boolean = true,
isClosed: Boolean = false, isClosed: Boolean = false,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<PollContent> = execute( ): ContentMessage<PollContent> = execute(
@@ -294,11 +321,13 @@ public suspend fun TelegramBot.sendQuizPoll(
isAnonymous = isAnonymous, isAnonymous = isAnonymous,
isClosed = isClosed, isClosed = isClosed,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -314,11 +343,13 @@ public suspend fun TelegramBot.sendQuizPoll(
isAnonymous: Boolean = true, isAnonymous: Boolean = true,
isClosed: Boolean = false, isClosed: Boolean = false,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<PollContent> = execute( ): ContentMessage<PollContent> = execute(
@@ -332,11 +363,13 @@ public suspend fun TelegramBot.sendQuizPoll(
isAnonymous = isAnonymous, isAnonymous = isAnonymous,
isClosed = isClosed, isClosed = isClosed,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )

View File

@@ -6,6 +6,7 @@ import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
import dev.inmo.tgbotapi.types.message.ParseMode import dev.inmo.tgbotapi.types.message.ParseMode
import dev.inmo.tgbotapi.types.message.SuggestedPostParameters
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
import dev.inmo.tgbotapi.types.message.content.PollContent import dev.inmo.tgbotapi.types.message.content.PollContent
import dev.inmo.tgbotapi.types.message.textsources.TextSource import dev.inmo.tgbotapi.types.message.textsources.TextSource
@@ -24,11 +25,13 @@ public suspend fun TelegramBot.sendRegularPoll(
openPeriod: LongSeconds? = null, openPeriod: LongSeconds? = null,
closeDate: LongSeconds? = null, closeDate: LongSeconds? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<PollContent> = execute( ): ContentMessage<PollContent> = execute(
@@ -43,13 +46,15 @@ public suspend fun TelegramBot.sendRegularPoll(
openPeriod = openPeriod, openPeriod = openPeriod,
closeDate = closeDate, closeDate = closeDate,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
replyParameters = replyParameters, suggestedPostParameters = suggestedPostParameters,
replyMarkup = replyMarkup replyParameters = replyParameters,
replyMarkup = replyMarkup
) )
) )
@@ -63,11 +68,13 @@ public suspend fun TelegramBot.sendRegularPoll(
openPeriod: LongSeconds? = null, openPeriod: LongSeconds? = null,
closeDate: LongSeconds? = null, closeDate: LongSeconds? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<PollContent> = execute( ): ContentMessage<PollContent> = execute(
@@ -81,13 +88,15 @@ public suspend fun TelegramBot.sendRegularPoll(
openPeriod = openPeriod, openPeriod = openPeriod,
closeDate = closeDate, closeDate = closeDate,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
replyParameters = replyParameters, suggestedPostParameters = suggestedPostParameters,
replyMarkup = replyMarkup replyParameters = replyParameters,
replyMarkup = replyMarkup
) )
) )
@@ -101,11 +110,13 @@ public suspend fun TelegramBot.sendRegularPoll(
isClosed: Boolean = false, isClosed: Boolean = false,
allowMultipleAnswers: Boolean = false, allowMultipleAnswers: Boolean = false,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<PollContent> = execute( ): ContentMessage<PollContent> = execute(
@@ -119,13 +130,15 @@ public suspend fun TelegramBot.sendRegularPoll(
isClosed = isClosed, isClosed = isClosed,
allowMultipleAnswers = allowMultipleAnswers, allowMultipleAnswers = allowMultipleAnswers,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
replyParameters = replyParameters, suggestedPostParameters = suggestedPostParameters,
replyMarkup = replyMarkup replyParameters = replyParameters,
replyMarkup = replyMarkup
) )
) )
@@ -138,11 +151,13 @@ public suspend fun TelegramBot.sendRegularPoll(
isClosed: Boolean = false, isClosed: Boolean = false,
allowMultipleAnswers: Boolean = false, allowMultipleAnswers: Boolean = false,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): ContentMessage<PollContent> = execute( ): ContentMessage<PollContent> = execute(
@@ -155,12 +170,14 @@ public suspend fun TelegramBot.sendRegularPoll(
isClosed = isClosed, isClosed = isClosed,
allowMultipleAnswers = allowMultipleAnswers, allowMultipleAnswers = allowMultipleAnswers,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
replyParameters = replyParameters, suggestedPostParameters = suggestedPostParameters,
replyMarkup = replyMarkup replyParameters = replyParameters,
replyMarkup = replyMarkup
) )
) )

View File

@@ -0,0 +1,45 @@
package dev.inmo.tgbotapi.extensions.api.stories
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.stories.RepostStory
import dev.inmo.tgbotapi.types.BusinessChatId
import dev.inmo.tgbotapi.types.IdChatIdentifier
import dev.inmo.tgbotapi.types.Seconds
import dev.inmo.tgbotapi.types.StoryId
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.stories.Story
public suspend fun TelegramBot.repostStory(
businessConnectionId: BusinessConnectionId,
fromChatId: IdChatIdentifier,
storyId: StoryId,
activePeriod: Seconds,
postToChatPage: Boolean = false,
protectContent: Boolean = false,
): Story = execute(
RepostStory(
businessConnectionId = businessConnectionId,
fromChatId = fromChatId,
storyId = storyId,
activePeriod = activePeriod,
postToChatPage = postToChatPage,
protectContent = protectContent
)
)
public suspend fun TelegramBot.repostStory(
fromChatId: BusinessChatId,
storyId: StoryId,
activePeriod: Seconds,
postToChatPage: Boolean = false,
protectContent: Boolean = false,
): Story = execute(
RepostStory(
businessConnectionId = fromChatId.businessConnectionId,
fromChatId = fromChatId,
storyId = storyId,
activePeriod = activePeriod,
postToChatPage = postToChatPage,
protectContent = protectContent
)
)

View File

@@ -0,0 +1,28 @@
package dev.inmo.tgbotapi.extensions.api.suggested
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.suggested.ApproveSuggestedPost
import dev.inmo.tgbotapi.types.IdChatIdentifier
import dev.inmo.tgbotapi.types.MessageId
import dev.inmo.tgbotapi.types.TelegramDate
import dev.inmo.tgbotapi.types.chat.Chat
import dev.inmo.tgbotapi.types.message.abstracts.Message
public suspend fun TelegramBot.approveSuggestedPost(
chatId: IdChatIdentifier,
messageId: MessageId,
sendDate: TelegramDate? = null,
): Boolean = execute(
ApproveSuggestedPost(chatId, messageId, sendDate)
)
public suspend fun TelegramBot.approveSuggestedPost(
chat: Chat,
messageId: MessageId,
sendDate: TelegramDate? = null,
): Boolean = approveSuggestedPost(chat.id, messageId, sendDate)
public suspend fun TelegramBot.approveSuggestedPost(
message: Message,
sendDate: TelegramDate? = null,
): Boolean = approveSuggestedPost(message.chat, message.messageId, sendDate)

View File

@@ -0,0 +1,29 @@
package dev.inmo.tgbotapi.extensions.api.suggested
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.suggested.ApproveSuggestedPost
import dev.inmo.tgbotapi.requests.suggested.DeclineSuggestedPost
import dev.inmo.tgbotapi.types.IdChatIdentifier
import dev.inmo.tgbotapi.types.MessageId
import dev.inmo.tgbotapi.types.TelegramDate
import dev.inmo.tgbotapi.types.chat.Chat
import dev.inmo.tgbotapi.types.message.abstracts.Message
public suspend fun TelegramBot.declineSuggestedPost(
chatId: IdChatIdentifier,
messageId: MessageId,
comment: String? = null,
): Boolean = execute(
DeclineSuggestedPost(chatId, messageId, comment)
)
public suspend fun TelegramBot.declineSuggestedPost(
chat: Chat,
messageId: MessageId,
comment: String? = null,
): Boolean = declineSuggestedPost(chat.id, messageId, comment)
public suspend fun TelegramBot.declineSuggestedPost(
message: Message,
comment: String? = null,
): Boolean = declineSuggestedPost(message.chat, message.messageId, comment)

View File

@@ -632,6 +632,10 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/W
public static synthetic fun waitChatBoostAdded$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow; public static synthetic fun waitChatBoostAdded$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
public static final fun waitChatEvents (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow; public static final fun waitChatEvents (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
public static synthetic fun waitChatEvents$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow; public static synthetic fun waitChatEvents$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
public static final fun waitChatOwnerChanged (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
public static synthetic fun waitChatOwnerChanged$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
public static final fun waitChatOwnerLeft (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
public static synthetic fun waitChatOwnerLeft$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
public static final fun waitChatShared (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow; public static final fun waitChatShared (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
public static synthetic fun waitChatShared$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow; public static synthetic fun waitChatShared$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
public static final fun waitChatSharedRequest (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow; public static final fun waitChatSharedRequest (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
@@ -692,6 +696,16 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/W
public static synthetic fun waitRegularGiftSentOrReceived$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow; public static synthetic fun waitRegularGiftSentOrReceived$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
public static final fun waitSuccessfulPaymentEvents (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow; public static final fun waitSuccessfulPaymentEvents (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
public static synthetic fun waitSuccessfulPaymentEvents$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow; public static synthetic fun waitSuccessfulPaymentEvents$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
public static final fun waitSuggestedPostApprovalFailed (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
public static synthetic fun waitSuggestedPostApprovalFailed$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
public static final fun waitSuggestedPostApproved (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
public static synthetic fun waitSuggestedPostApproved$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
public static final fun waitSuggestedPostDeclined (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
public static synthetic fun waitSuggestedPostDeclined$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
public static final fun waitSuggestedPostPaid (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
public static synthetic fun waitSuggestedPostPaid$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
public static final fun waitSuggestedPostRefunded (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
public static synthetic fun waitSuggestedPostRefunded$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
public static final fun waitSupergroupChatCreatedEvents (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow; public static final fun waitSupergroupChatCreatedEvents (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
public static synthetic fun waitSupergroupChatCreatedEvents$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow; public static synthetic fun waitSupergroupChatCreatedEvents$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
public static final fun waitSupergroupEvents (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow; public static final fun waitSupergroupEvents (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
@@ -737,6 +751,10 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/W
public static synthetic fun waitChatBoostAddedEventsMessages$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow; public static synthetic fun waitChatBoostAddedEventsMessages$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
public static final fun waitChatEventsMessages (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow; public static final fun waitChatEventsMessages (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
public static synthetic fun waitChatEventsMessages$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow; public static synthetic fun waitChatEventsMessages$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
public static final fun waitChatOwnerChangedEventsMessages (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
public static synthetic fun waitChatOwnerChangedEventsMessages$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
public static final fun waitChatOwnerLeftEventsMessages (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
public static synthetic fun waitChatOwnerLeftEventsMessages$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
public static final fun waitChatSharedEventsMessages (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow; public static final fun waitChatSharedEventsMessages (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
public static synthetic fun waitChatSharedEventsMessages$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow; public static synthetic fun waitChatSharedEventsMessages$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
public static final fun waitChatSharedRequestEventsMessages (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow; public static final fun waitChatSharedRequestEventsMessages (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
@@ -863,31 +881,31 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/W
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitMentionKt { public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitMentionKt {
public static final fun filterMentions (Lkotlinx/coroutines/flow/Flow;Ldev/inmo/tgbotapi/types/chat/User;)Lkotlinx/coroutines/flow/Flow; public static final fun filterMentions (Lkotlinx/coroutines/flow/Flow;Ldev/inmo/tgbotapi/types/chat/User;)Lkotlinx/coroutines/flow/Flow;
public static final fun filterMentions-eC7Nk8U (Lkotlinx/coroutines/flow/Flow;Ljava/lang/String;)Lkotlinx/coroutines/flow/Flow; public static final fun filterMentions-eC7Nk8U (Lkotlinx/coroutines/flow/Flow;Ljava/lang/String;)Lkotlinx/coroutines/flow/Flow;
public static final fun filterTextMentions-WiG6Fm4 (Lkotlinx/coroutines/flow/Flow;J)Lkotlinx/coroutines/flow/Flow; public static final fun filterTextMentions (Lkotlinx/coroutines/flow/Flow;Ldev/inmo/tgbotapi/types/IdChatIdentifier;)Lkotlinx/coroutines/flow/Flow;
public static final fun isWithMention (Ldev/inmo/tgbotapi/types/message/content/TextedContent;Ldev/inmo/tgbotapi/types/chat/User;)Z public static final fun isWithMention (Ldev/inmo/tgbotapi/types/message/content/TextedContent;Ldev/inmo/tgbotapi/types/chat/User;)Z
public static final fun isWithMention-eC7Nk8U (Ldev/inmo/tgbotapi/types/message/content/TextedContent;Ljava/lang/String;)Z public static final fun isWithMention-eC7Nk8U (Ldev/inmo/tgbotapi/types/message/content/TextedContent;Ljava/lang/String;)Z
public static final fun isWithTextMention-WiG6Fm4 (Ldev/inmo/tgbotapi/types/message/content/TextedContent;J)Z public static final fun isWithTextMention (Ldev/inmo/tgbotapi/types/message/content/TextedContent;Ldev/inmo/tgbotapi/types/IdChatIdentifier;)Z
public static final fun waitContentWithMentions (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/chat/User;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow; public static final fun waitContentWithMentions (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/chat/User;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
public static synthetic fun waitContentWithMentions$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/chat/User;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow; public static synthetic fun waitContentWithMentions$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/chat/User;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
public static final fun waitContentWithMentions-QGcck-U (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow; public static final fun waitContentWithMentions-QGcck-U (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
public static synthetic fun waitContentWithMentions-QGcck-U$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow; public static synthetic fun waitContentWithMentions-QGcck-U$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
public static final fun waitContentWithTextMentions-nc95W0g (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;JLdev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow; public static final fun waitContentWithTextMentions (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
public static synthetic fun waitContentWithTextMentions-nc95W0g$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;JLdev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow; public static synthetic fun waitContentWithTextMentions$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
} }
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitMentionMessageKt { public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitMentionMessageKt {
public static final fun filterMentionsMessages (Lkotlinx/coroutines/flow/Flow;Ldev/inmo/tgbotapi/types/chat/User;)Lkotlinx/coroutines/flow/Flow; public static final fun filterMentionsMessages (Lkotlinx/coroutines/flow/Flow;Ldev/inmo/tgbotapi/types/chat/User;)Lkotlinx/coroutines/flow/Flow;
public static final fun filterMentionsMessages-eC7Nk8U (Lkotlinx/coroutines/flow/Flow;Ljava/lang/String;)Lkotlinx/coroutines/flow/Flow; public static final fun filterMentionsMessages-eC7Nk8U (Lkotlinx/coroutines/flow/Flow;Ljava/lang/String;)Lkotlinx/coroutines/flow/Flow;
public static final fun filterTextMentionsMessages-WiG6Fm4 (Lkotlinx/coroutines/flow/Flow;J)Lkotlinx/coroutines/flow/Flow; public static final fun filterTextMentionsMessages (Lkotlinx/coroutines/flow/Flow;Ldev/inmo/tgbotapi/types/IdChatIdentifier;)Lkotlinx/coroutines/flow/Flow;
public static final fun isWithMention (Ldev/inmo/tgbotapi/types/message/abstracts/CommonMessage;Ldev/inmo/tgbotapi/types/chat/User;)Z public static final fun isWithMention (Ldev/inmo/tgbotapi/types/message/abstracts/CommonMessage;Ldev/inmo/tgbotapi/types/chat/User;)Z
public static final fun isWithMention-eC7Nk8U (Ldev/inmo/tgbotapi/types/message/abstracts/CommonMessage;Ljava/lang/String;)Z public static final fun isWithMention-eC7Nk8U (Ldev/inmo/tgbotapi/types/message/abstracts/CommonMessage;Ljava/lang/String;)Z
public static final fun isWithTextMention-WiG6Fm4 (Ldev/inmo/tgbotapi/types/message/abstracts/CommonMessage;J)Z public static final fun isWithTextMention (Ldev/inmo/tgbotapi/types/message/abstracts/CommonMessage;Ldev/inmo/tgbotapi/types/IdChatIdentifier;)Z
public static final fun waitContentMessageWithMentions (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/chat/User;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow; public static final fun waitContentMessageWithMentions (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/chat/User;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
public static synthetic fun waitContentMessageWithMentions$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/chat/User;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow; public static synthetic fun waitContentMessageWithMentions$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/chat/User;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
public static final fun waitContentMessageWithMentions-QGcck-U (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow; public static final fun waitContentMessageWithMentions-QGcck-U (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
public static synthetic fun waitContentMessageWithMentions-QGcck-U$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow; public static synthetic fun waitContentMessageWithMentions-QGcck-U$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
public static final fun waitContentMessageWithTextMentions-nc95W0g (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;JLdev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow; public static final fun waitContentMessageWithTextMentions (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
public static synthetic fun waitContentMessageWithTextMentions-nc95W0g$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;JLdev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow; public static synthetic fun waitContentMessageWithTextMentions$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
} }
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitPaidMediaPurchasedKt { public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitPaidMediaPurchasedKt {
@@ -1348,6 +1366,10 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handl
public static synthetic fun onChatBoostAdded$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job; public static synthetic fun onChatBoostAdded$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
public static final fun onChatEvent (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job; public static final fun onChatEvent (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
public static synthetic fun onChatEvent$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job; public static synthetic fun onChatEvent$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
public static final fun onChatOwnerChanged (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
public static synthetic fun onChatOwnerChanged$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
public static final fun onChatOwnerLeft (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
public static synthetic fun onChatOwnerLeft$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
public static final fun onChatShared (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job; public static final fun onChatShared (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
public static synthetic fun onChatShared$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job; public static synthetic fun onChatShared$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
public static final fun onChatSharedRequest (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job; public static final fun onChatSharedRequest (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
@@ -1398,6 +1420,10 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handl
public static synthetic fun onPinnedMessage$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job; public static synthetic fun onPinnedMessage$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
public static final fun onPrivateEvent (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job; public static final fun onPrivateEvent (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
public static synthetic fun onPrivateEvent$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job; public static synthetic fun onPrivateEvent$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
public static final fun onPrivateForumTopicCreated (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
public static synthetic fun onPrivateForumTopicCreated$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
public static final fun onPrivateForumTopicEdited (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
public static synthetic fun onPrivateForumTopicEdited$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
public static final fun onProximityAlertTriggered (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job; public static final fun onProximityAlertTriggered (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
public static synthetic fun onProximityAlertTriggered$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job; public static synthetic fun onProximityAlertTriggered$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
public static final fun onPublicChatEvent (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job; public static final fun onPublicChatEvent (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
@@ -1408,6 +1434,16 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handl
public static synthetic fun onRegularGiftSentOrReceived$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job; public static synthetic fun onRegularGiftSentOrReceived$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
public static final fun onSuccessfulPayment (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job; public static final fun onSuccessfulPayment (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
public static synthetic fun onSuccessfulPayment$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job; public static synthetic fun onSuccessfulPayment$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
public static final fun onSuggestedPostApprovalFailed (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
public static synthetic fun onSuggestedPostApprovalFailed$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
public static final fun onSuggestedPostApproved (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
public static synthetic fun onSuggestedPostApproved$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
public static final fun onSuggestedPostDeclined (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
public static synthetic fun onSuggestedPostDeclined$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
public static final fun onSuggestedPostPaid (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
public static synthetic fun onSuggestedPostPaid$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
public static final fun onSuggestedPostRefunded (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
public static synthetic fun onSuggestedPostRefunded$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
public static final fun onSupergroupChatCreated (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job; public static final fun onSupergroupChatCreated (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
public static synthetic fun onSupergroupChatCreated$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job; public static synthetic fun onSupergroupChatCreated$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
public static final fun onSupergroupEvent (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job; public static final fun onSupergroupEvent (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
@@ -1530,28 +1566,28 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handl
public static synthetic fun onMentionWithVoiceContent$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/chat/User;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job; public static synthetic fun onMentionWithVoiceContent$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/chat/User;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
public static final fun onMentionWithVoiceContent-KtuvvGA (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job; public static final fun onMentionWithVoiceContent-KtuvvGA (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
public static synthetic fun onMentionWithVoiceContent-KtuvvGA$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job; public static synthetic fun onMentionWithVoiceContent-KtuvvGA$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
public static final fun onTextMentionWithAnimationContent-VjR9mJc (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;JLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job; public static final fun onTextMentionWithAnimationContent (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
public static synthetic fun onTextMentionWithAnimationContent-VjR9mJc$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;JLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job; public static synthetic fun onTextMentionWithAnimationContent$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
public static final fun onTextMentionWithAnyContent-VjR9mJc (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;JLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job; public static final fun onTextMentionWithAnyContent (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
public static synthetic fun onTextMentionWithAnyContent-VjR9mJc$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;JLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job; public static synthetic fun onTextMentionWithAnyContent$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
public static final fun onTextMentionWithAudioContent-VjR9mJc (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;JLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job; public static final fun onTextMentionWithAudioContent (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
public static synthetic fun onTextMentionWithAudioContent-VjR9mJc$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;JLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job; public static synthetic fun onTextMentionWithAudioContent$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
public static final fun onTextMentionWithDocumentContent-VjR9mJc (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;JLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job; public static final fun onTextMentionWithDocumentContent (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
public static synthetic fun onTextMentionWithDocumentContent-VjR9mJc$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;JLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job; public static synthetic fun onTextMentionWithDocumentContent$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
public static final fun onTextMentionWithMediaGroupContent-VjR9mJc (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;JLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job; public static final fun onTextMentionWithMediaGroupContent (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
public static synthetic fun onTextMentionWithMediaGroupContent-VjR9mJc$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;JLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job; public static synthetic fun onTextMentionWithMediaGroupContent$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
public static final fun onTextMentionWithMediaGroupPartContent-VjR9mJc (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;JLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job; public static final fun onTextMentionWithMediaGroupPartContent (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
public static synthetic fun onTextMentionWithMediaGroupPartContent-VjR9mJc$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;JLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job; public static synthetic fun onTextMentionWithMediaGroupPartContent$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
public static final fun onTextMentionWithPhotoContent-VjR9mJc (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;JLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job; public static final fun onTextMentionWithPhotoContent (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
public static synthetic fun onTextMentionWithPhotoContent-VjR9mJc$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;JLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job; public static synthetic fun onTextMentionWithPhotoContent$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
public static final fun onTextMentionWithTextContent-VjR9mJc (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;JLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job; public static final fun onTextMentionWithTextContent (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
public static synthetic fun onTextMentionWithTextContent-VjR9mJc$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;JLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job; public static synthetic fun onTextMentionWithTextContent$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
public static final fun onTextMentionWithVideoContent-VjR9mJc (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;JLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job; public static final fun onTextMentionWithVideoContent (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
public static synthetic fun onTextMentionWithVideoContent-VjR9mJc$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;JLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job; public static synthetic fun onTextMentionWithVideoContent$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
public static final fun onTextMentionWithVisualMediaGroupPartContent-VjR9mJc (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;JLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job; public static final fun onTextMentionWithVisualMediaGroupPartContent (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
public static synthetic fun onTextMentionWithVisualMediaGroupPartContent-VjR9mJc$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;JLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job; public static synthetic fun onTextMentionWithVisualMediaGroupPartContent$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
public static final fun onTextMentionWithVoiceContent-VjR9mJc (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;JLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job; public static final fun onTextMentionWithVoiceContent (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
public static synthetic fun onTextMentionWithVoiceContent-VjR9mJc$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;JLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job; public static synthetic fun onTextMentionWithVoiceContent$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
} }
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/PaidMediaPurchasedTriggersKt { public final class dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/PaidMediaPurchasedTriggersKt {
@@ -1783,8 +1819,8 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_f
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/ByUserIdChosenInlineResultMarkerFactory : dev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory { public final class dev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/ByUserIdChosenInlineResultMarkerFactory : dev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory {
public static final field INSTANCE Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/ByUserIdChosenInlineResultMarkerFactory; public static final field INSTANCE Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/ByUserIdChosenInlineResultMarkerFactory;
public fun invoke (Ldev/inmo/tgbotapi/types/InlineQueries/ChosenInlineResult/ChosenInlineResult;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public synthetic fun invoke (Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public synthetic fun invoke (Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public fun invoke-IODSwXc (Ldev/inmo/tgbotapi/types/InlineQueries/ChosenInlineResult/ChosenInlineResult;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
} }
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/ByUserInlineQueryMarkerFactory : dev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory { public final class dev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/ByUserInlineQueryMarkerFactory : dev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory {

View File

@@ -5,12 +5,12 @@ package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
import dev.inmo.tgbotapi.extensions.utils.* import dev.inmo.tgbotapi.extensions.utils.*
import dev.inmo.tgbotapi.requests.abstracts.Request import dev.inmo.tgbotapi.requests.abstracts.Request
import dev.inmo.tgbotapi.types.ChannelDirectMessagesConfigurationChanged import dev.inmo.tgbotapi.types.DirectMessagesConfigurationChanged
import dev.inmo.tgbotapi.types.PaidMessagePriceChanged import dev.inmo.tgbotapi.types.PaidMessagePriceChanged
import dev.inmo.tgbotapi.types.chat.ChatBackground import dev.inmo.tgbotapi.types.chat.ChatBackground
import dev.inmo.tgbotapi.types.checklists.ChecklistTasksAdded import dev.inmo.tgbotapi.types.checklists.ChecklistTasksAdded
import dev.inmo.tgbotapi.types.checklists.ChecklistTasksDone import dev.inmo.tgbotapi.types.checklists.ChecklistTasksDone
import dev.inmo.tgbotapi.types.gifts.GiftSentOrReceived import dev.inmo.tgbotapi.types.gifts.GiftSentOrReceivedEvent
import dev.inmo.tgbotapi.types.giveaway.GiveawayCreated import dev.inmo.tgbotapi.types.giveaway.GiveawayCreated
import dev.inmo.tgbotapi.types.giveaway.GiveawayPrivateResults import dev.inmo.tgbotapi.types.giveaway.GiveawayPrivateResults
import dev.inmo.tgbotapi.types.message.ChatEvents.* import dev.inmo.tgbotapi.types.message.ChatEvents.*
@@ -22,6 +22,11 @@ import dev.inmo.tgbotapi.types.message.ChatEvents.forum.ForumTopicReopened
import dev.inmo.tgbotapi.types.message.ChatEvents.forum.GeneralForumTopicHidden import dev.inmo.tgbotapi.types.message.ChatEvents.forum.GeneralForumTopicHidden
import dev.inmo.tgbotapi.types.message.ChatEvents.forum.GeneralForumTopicUnhidden import dev.inmo.tgbotapi.types.message.ChatEvents.forum.GeneralForumTopicUnhidden
import dev.inmo.tgbotapi.types.message.ChatEvents.forum.WriteAccessAllowed import dev.inmo.tgbotapi.types.message.ChatEvents.forum.WriteAccessAllowed
import dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostApprovalFailed
import dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostApproved
import dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostDeclined
import dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostPaid
import dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostRefunded
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.RefundedPaymentEvent import dev.inmo.tgbotapi.types.message.payments.RefundedPaymentEvent
@@ -233,6 +238,16 @@ fun BehaviourContext.waitChatBoostAdded(
errorFactory: NullableRequestBuilder<*> = { null } errorFactory: NullableRequestBuilder<*> = { null }
) = waitEvents<ChatBoostAdded>(initRequest, errorFactory) ) = waitEvents<ChatBoostAdded>(initRequest, errorFactory)
fun BehaviourContext.waitChatOwnerLeft(
initRequest: Request<*>? = null,
errorFactory: NullableRequestBuilder<*> = { null }
) = waitEvents<ChatOwnerLeft>(initRequest, errorFactory)
fun BehaviourContext.waitChatOwnerChanged(
initRequest: Request<*>? = null,
errorFactory: NullableRequestBuilder<*> = { null }
) = waitEvents<ChatOwnerChanged>(initRequest, errorFactory)
fun BehaviourContext.waitChatBackgroundSet( fun BehaviourContext.waitChatBackgroundSet(
initRequest: Request<*>? = null, initRequest: Request<*>? = null,
errorFactory: NullableRequestBuilder<*> = { null } errorFactory: NullableRequestBuilder<*> = { null }
@@ -261,12 +276,12 @@ fun BehaviourContext.waitPaidMessagePriceChanged(
fun BehaviourContext.waitRegularGiftSentOrReceived( fun BehaviourContext.waitRegularGiftSentOrReceived(
initRequest: Request<*>? = null, initRequest: Request<*>? = null,
errorFactory: NullableRequestBuilder<*> = { null } errorFactory: NullableRequestBuilder<*> = { null }
) = waitEvents<GiftSentOrReceived.Regular>(initRequest, errorFactory) ) = waitEvents<GiftSentOrReceivedEvent.RegularGift>(initRequest, errorFactory)
fun BehaviourContext.waitUniqueGiftSentOrReceived( fun BehaviourContext.waitUniqueGiftSentOrReceived(
initRequest: Request<*>? = null, initRequest: Request<*>? = null,
errorFactory: NullableRequestBuilder<*> = { null } errorFactory: NullableRequestBuilder<*> = { null }
) = waitEvents<GiftSentOrReceived.Unique>(initRequest, errorFactory) ) = waitEvents<GiftSentOrReceivedEvent.UniqueGift>(initRequest, errorFactory)
fun BehaviourContext.waitChecklistTasksDone( fun BehaviourContext.waitChecklistTasksDone(
initRequest: Request<*>? = null, initRequest: Request<*>? = null,
@@ -281,4 +296,29 @@ fun BehaviourContext.waitChecklistTasksAdded(
fun BehaviourContext.waitChannelDirectMessagesConfigurationChanged( fun BehaviourContext.waitChannelDirectMessagesConfigurationChanged(
initRequest: Request<*>? = null, initRequest: Request<*>? = null,
errorFactory: NullableRequestBuilder<*> = { null } errorFactory: NullableRequestBuilder<*> = { null }
) = waitEvents<ChannelDirectMessagesConfigurationChanged>(initRequest, errorFactory) ) = waitEvents<DirectMessagesConfigurationChanged>(initRequest, errorFactory)
fun BehaviourContext.waitSuggestedPostApprovalFailed(
initRequest: Request<*>? = null,
errorFactory: NullableRequestBuilder<*> = { null }
) = waitEvents<SuggestedPostApprovalFailed>(initRequest, errorFactory)
fun BehaviourContext.waitSuggestedPostRefunded(
initRequest: Request<*>? = null,
errorFactory: NullableRequestBuilder<*> = { null }
) = waitEvents<SuggestedPostRefunded>(initRequest, errorFactory)
fun BehaviourContext.waitSuggestedPostDeclined(
initRequest: Request<*>? = null,
errorFactory: NullableRequestBuilder<*> = { null }
) = waitEvents<SuggestedPostDeclined>(initRequest, errorFactory)
fun BehaviourContext.waitSuggestedPostPaid(
initRequest: Request<*>? = null,
errorFactory: NullableRequestBuilder<*> = { null }
) = waitEvents<SuggestedPostPaid>(initRequest, errorFactory)
fun BehaviourContext.waitSuggestedPostApproved(
initRequest: Request<*>? = null,
errorFactory: NullableRequestBuilder<*> = { null }
) = waitEvents<SuggestedPostApproved>(initRequest, errorFactory)

View File

@@ -7,7 +7,7 @@ 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.PaidMessagePriceChanged import dev.inmo.tgbotapi.types.PaidMessagePriceChanged
import dev.inmo.tgbotapi.types.chat.ChatBackground import dev.inmo.tgbotapi.types.chat.ChatBackground
import dev.inmo.tgbotapi.types.gifts.GiftSentOrReceived import dev.inmo.tgbotapi.types.gifts.GiftSentOrReceivedEvent
import dev.inmo.tgbotapi.types.message.ChatEvents.* import dev.inmo.tgbotapi.types.message.ChatEvents.*
import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.* import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.*
import dev.inmo.tgbotapi.types.message.ChatEvents.forum.ForumTopicClosed import dev.inmo.tgbotapi.types.message.ChatEvents.forum.ForumTopicClosed
@@ -222,6 +222,16 @@ fun BehaviourContext.waitChatBoostAddedEventsMessages(
errorFactory: NullableRequestBuilder<*> = { null } errorFactory: NullableRequestBuilder<*> = { null }
) = waitEventsMessages<ChatBoostAdded>(initRequest, errorFactory) ) = waitEventsMessages<ChatBoostAdded>(initRequest, errorFactory)
fun BehaviourContext.waitChatOwnerLeftEventsMessages(
initRequest: Request<*>? = null,
errorFactory: NullableRequestBuilder<*> = { null }
) = waitEventsMessages<ChatOwnerLeft>(initRequest, errorFactory)
fun BehaviourContext.waitChatOwnerChangedEventsMessages(
initRequest: Request<*>? = null,
errorFactory: NullableRequestBuilder<*> = { null }
) = waitEventsMessages<ChatOwnerChanged>(initRequest, errorFactory)
fun BehaviourContext.waitChatBackgroundSetEventsMessages( fun BehaviourContext.waitChatBackgroundSetEventsMessages(
initRequest: Request<*>? = null, initRequest: Request<*>? = null,
errorFactory: NullableRequestBuilder<*> = { null } errorFactory: NullableRequestBuilder<*> = { null }
@@ -235,9 +245,9 @@ fun BehaviourContext.waitPaidMessagePriceChangedMessages(
fun BehaviourContext.waitRegularGiftSentOrReceivedMessages( fun BehaviourContext.waitRegularGiftSentOrReceivedMessages(
initRequest: Request<*>? = null, initRequest: Request<*>? = null,
errorFactory: NullableRequestBuilder<*> = { null } errorFactory: NullableRequestBuilder<*> = { null }
) = waitEventsMessages<GiftSentOrReceived.Regular>(initRequest, errorFactory) ) = waitEventsMessages<GiftSentOrReceivedEvent.RegularGift>(initRequest, errorFactory)
fun BehaviourContext.waitUniqueGiftSentOrReceivedMessages( fun BehaviourContext.waitUniqueGiftSentOrReceivedMessages(
initRequest: Request<*>? = null, initRequest: Request<*>? = null,
errorFactory: NullableRequestBuilder<*> = { null } errorFactory: NullableRequestBuilder<*> = { null }
) = waitEventsMessages<GiftSentOrReceived.Unique>(initRequest, errorFactory) ) = waitEventsMessages<GiftSentOrReceivedEvent.UniqueGift>(initRequest, errorFactory)

View File

@@ -10,12 +10,12 @@ import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.Mar
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times
import dev.inmo.tgbotapi.extensions.utils.baseSentMessageUpdateOrNull import dev.inmo.tgbotapi.extensions.utils.baseSentMessageUpdateOrNull
import dev.inmo.tgbotapi.extensions.utils.chatEventMessageOrNull import dev.inmo.tgbotapi.extensions.utils.chatEventMessageOrNull
import dev.inmo.tgbotapi.types.ChannelDirectMessagesConfigurationChanged import dev.inmo.tgbotapi.types.DirectMessagesConfigurationChanged
import dev.inmo.tgbotapi.types.PaidMessagePriceChanged import dev.inmo.tgbotapi.types.PaidMessagePriceChanged
import dev.inmo.tgbotapi.types.chat.ChatBackground import dev.inmo.tgbotapi.types.chat.ChatBackground
import dev.inmo.tgbotapi.types.checklists.ChecklistTasksAdded import dev.inmo.tgbotapi.types.checklists.ChecklistTasksAdded
import dev.inmo.tgbotapi.types.checklists.ChecklistTasksDone import dev.inmo.tgbotapi.types.checklists.ChecklistTasksDone
import dev.inmo.tgbotapi.types.gifts.GiftSentOrReceived import dev.inmo.tgbotapi.types.gifts.GiftSentOrReceivedEvent
import dev.inmo.tgbotapi.types.giveaway.GiveawayCreated import dev.inmo.tgbotapi.types.giveaway.GiveawayCreated
import dev.inmo.tgbotapi.types.giveaway.GiveawayPrivateResults import dev.inmo.tgbotapi.types.giveaway.GiveawayPrivateResults
import dev.inmo.tgbotapi.types.message.ChannelEventMessage import dev.inmo.tgbotapi.types.message.ChannelEventMessage
@@ -28,8 +28,14 @@ import dev.inmo.tgbotapi.types.message.ChatEvents.forum.ForumTopicReopened
import dev.inmo.tgbotapi.types.message.ChatEvents.forum.GeneralForumTopicHidden import dev.inmo.tgbotapi.types.message.ChatEvents.forum.GeneralForumTopicHidden
import dev.inmo.tgbotapi.types.message.ChatEvents.forum.GeneralForumTopicUnhidden import dev.inmo.tgbotapi.types.message.ChatEvents.forum.GeneralForumTopicUnhidden
import dev.inmo.tgbotapi.types.message.ChatEvents.forum.WriteAccessAllowed import dev.inmo.tgbotapi.types.message.ChatEvents.forum.WriteAccessAllowed
import dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostApprovalFailed
import dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostApproved
import dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostDeclined
import dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostPaid
import dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostRefunded
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.ChannelDirectMessagesEventMessage
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.abstracts.SupergroupEventMessage
import dev.inmo.tgbotapi.types.message.payments.RefundedPaymentEvent import dev.inmo.tgbotapi.types.message.payments.RefundedPaymentEvent
@@ -652,6 +658,27 @@ fun <BC : BehaviourContext> BC.onForumTopicCreated(
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, SupergroupEventMessage<ForumTopicCreated>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, SupergroupEventMessage<ForumTopicCreated>>
) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, additionalSubcontextInitialAction, scenarioReceiver) ) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, additionalSubcontextInitialAction, scenarioReceiver)
/**
* @param initialFilter This filter will be called to remove unnecessary data BEFORE [scenarioReceiver] call
* @param subcontextUpdatesFilter This filter will be applied to each update inside of [scenarioReceiver]. For example,
* this filter will be used if you will call [dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.waitContentMessage].
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data
*/
fun <BC : BehaviourContext> BC.onPrivateForumTopicCreated(
initialFilter: SimpleFilter<PrivateEventMessage<ForumTopicCreated>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, PrivateEventMessage<ForumTopicCreated>, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in ChatEventMessage<ForumTopicCreated>, Any>? = ByChatMessageMarkerFactory,
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, ChatEventMessage<ForumTopicCreated>>? = null,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, PrivateEventMessage<ForumTopicCreated>>
) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, additionalSubcontextInitialAction, scenarioReceiver)
/** /**
* @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,
@@ -695,6 +722,28 @@ fun <BC : BehaviourContext> BC.onForumTopicEdited(
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, SupergroupEventMessage<ForumTopicEdited>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, SupergroupEventMessage<ForumTopicEdited>>
) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, additionalSubcontextInitialAction, scenarioReceiver) ) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, additionalSubcontextInitialAction, scenarioReceiver)
/**
* @param initialFilter This filter will be called to remove unnecessary data BEFORE [scenarioReceiver] call
* @param subcontextUpdatesFilter This filter will be applied to each update inside of [scenarioReceiver]. For example,
* this filter will be used if you will call [dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.waitContentMessage].
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data
*/
fun <BC : BehaviourContext> BC.onPrivateForumTopicEdited(
initialFilter: SimpleFilter<PrivateEventMessage<ForumTopicEdited>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, PrivateEventMessage<ForumTopicEdited>, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in ChatEventMessage<ForumTopicEdited>, Any>? = ByChatMessageMarkerFactory,
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, ChatEventMessage<ForumTopicEdited>>? = null,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, PrivateEventMessage<ForumTopicEdited>>
) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, additionalSubcontextInitialAction, scenarioReceiver)
/** /**
* @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,
@@ -961,6 +1010,50 @@ fun <BC : BehaviourContext> BC.onChatBoostAdded(
) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, additionalSubcontextInitialAction, scenarioReceiver) ) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, additionalSubcontextInitialAction, scenarioReceiver)
/**
* @param initialFilter This filter will be called to remove unnecessary data BEFORE [scenarioReceiver] call
* @param subcontextUpdatesFilter This filter will be applied to each update inside of [scenarioReceiver]. For example,
* this filter will be used if you will call [dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.waitContentMessage].
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data
*/
fun <BC : BehaviourContext> BC.onChatOwnerLeft(
initialFilter: SimpleFilter<ChatEventMessage<ChatOwnerLeft>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<ChatOwnerLeft>, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in ChatEventMessage<ChatOwnerLeft>, Any>? = ByChatMessageMarkerFactory,
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, ChatEventMessage<ChatOwnerLeft>>? = null,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<ChatOwnerLeft>>
) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, additionalSubcontextInitialAction, scenarioReceiver)
/**
* @param initialFilter This filter will be called to remove unnecessary data BEFORE [scenarioReceiver] call
* @param subcontextUpdatesFilter This filter will be applied to each update inside of [scenarioReceiver]. For example,
* this filter will be used if you will call [dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.waitContentMessage].
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data
*/
fun <BC : BehaviourContext> BC.onChatOwnerChanged(
initialFilter: SimpleFilter<ChatEventMessage<ChatOwnerChanged>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<ChatOwnerChanged>, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in ChatEventMessage<ChatOwnerChanged>, Any>? = ByChatMessageMarkerFactory,
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, ChatEventMessage<ChatOwnerChanged>>? = null,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<ChatOwnerChanged>>
) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, additionalSubcontextInitialAction, scenarioReceiver)
/** /**
* @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,
@@ -1088,11 +1181,11 @@ fun <BC : BehaviourContext> BC.onPaidMessagePriceChanged(
* data * data
*/ */
fun <BC : BehaviourContext> BC.onRegularGiftSentOrReceived( fun <BC : BehaviourContext> BC.onRegularGiftSentOrReceived(
initialFilter: SimpleFilter<ChatEventMessage<GiftSentOrReceived.Regular>>? = null, initialFilter: SimpleFilter<ChatEventMessage<GiftSentOrReceivedEvent.RegularGift>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<GiftSentOrReceived.Regular>, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<GiftSentOrReceivedEvent.RegularGift>, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in ChatEventMessage<GiftSentOrReceived.Regular>, Any>? = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in ChatEventMessage<GiftSentOrReceivedEvent.RegularGift>, Any>? = ByChatMessageMarkerFactory,
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, ChatEventMessage<GiftSentOrReceived.Regular>>? = null, additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, ChatEventMessage<GiftSentOrReceivedEvent.RegularGift>>? = null,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<GiftSentOrReceived.Regular>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<GiftSentOrReceivedEvent.RegularGift>>
) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, additionalSubcontextInitialAction, scenarioReceiver) ) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, additionalSubcontextInitialAction, scenarioReceiver)
@@ -1110,11 +1203,11 @@ fun <BC : BehaviourContext> BC.onRegularGiftSentOrReceived(
* data * data
*/ */
fun <BC : BehaviourContext> BC.onUniqueGiftSentOrReceived( fun <BC : BehaviourContext> BC.onUniqueGiftSentOrReceived(
initialFilter: SimpleFilter<ChatEventMessage<GiftSentOrReceived.Unique>>? = null, initialFilter: SimpleFilter<ChatEventMessage<GiftSentOrReceivedEvent.UniqueGift>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<GiftSentOrReceived.Unique>, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<GiftSentOrReceivedEvent.UniqueGift>, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in ChatEventMessage<GiftSentOrReceived.Unique>, Any>? = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in ChatEventMessage<GiftSentOrReceivedEvent.UniqueGift>, Any>? = ByChatMessageMarkerFactory,
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, ChatEventMessage<GiftSentOrReceived.Unique>>? = null, additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, ChatEventMessage<GiftSentOrReceivedEvent.UniqueGift>>? = null,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<GiftSentOrReceived.Unique>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<GiftSentOrReceivedEvent.UniqueGift>>
) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, additionalSubcontextInitialAction, scenarioReceiver) ) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, additionalSubcontextInitialAction, scenarioReceiver)
@@ -1176,9 +1269,119 @@ fun <BC : BehaviourContext> BC.onChecklistTasksAdded(
* data * data
*/ */
fun <BC : BehaviourContext> BC.onChannelDirectMessagesConfigurationChanged( fun <BC : BehaviourContext> BC.onChannelDirectMessagesConfigurationChanged(
initialFilter: SimpleFilter<ChannelEventMessage<ChannelDirectMessagesConfigurationChanged>>? = null, initialFilter: SimpleFilter<ChannelEventMessage<DirectMessagesConfigurationChanged>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChannelEventMessage<ChannelDirectMessagesConfigurationChanged>, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChannelEventMessage<DirectMessagesConfigurationChanged>, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in ChannelEventMessage<ChannelDirectMessagesConfigurationChanged>, Any>? = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in ChannelEventMessage<DirectMessagesConfigurationChanged>, Any>? = ByChatMessageMarkerFactory,
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, ChannelEventMessage<ChannelDirectMessagesConfigurationChanged>>? = null, additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, ChannelEventMessage<DirectMessagesConfigurationChanged>>? = null,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChannelEventMessage<ChannelDirectMessagesConfigurationChanged>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChannelEventMessage<DirectMessagesConfigurationChanged>>
) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, additionalSubcontextInitialAction, scenarioReceiver)
/**
* @param initialFilter This filter will be called to remove unnecessary data BEFORE [scenarioReceiver] call
* @param subcontextUpdatesFilter This filter will be applied to each update inside of [scenarioReceiver]. For example,
* this filter will be used if you will call [dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.waitContentMessage].
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data
*/
fun <BC : BehaviourContext> BC.onSuggestedPostApproved(
initialFilter: SimpleFilter<ChannelDirectMessagesEventMessage<SuggestedPostApproved>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChannelDirectMessagesEventMessage<SuggestedPostApproved>, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in ChannelDirectMessagesEventMessage<SuggestedPostApproved>, Any>? = ByChatMessageMarkerFactory,
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, ChannelDirectMessagesEventMessage<SuggestedPostApproved>>? = null,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChannelDirectMessagesEventMessage<SuggestedPostApproved>>
) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, additionalSubcontextInitialAction, scenarioReceiver)
/**
* @param initialFilter This filter will be called to remove unnecessary data BEFORE [scenarioReceiver] call
* @param subcontextUpdatesFilter This filter will be applied to each update inside of [scenarioReceiver]. For example,
* this filter will be used if you will call [dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.waitContentMessage].
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data
*/
fun <BC : BehaviourContext> BC.onSuggestedPostApprovalFailed(
initialFilter: SimpleFilter<ChannelDirectMessagesEventMessage<SuggestedPostApprovalFailed>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChannelDirectMessagesEventMessage<SuggestedPostApprovalFailed>, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in ChannelDirectMessagesEventMessage<SuggestedPostApprovalFailed>, Any>? = ByChatMessageMarkerFactory,
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, ChannelDirectMessagesEventMessage<SuggestedPostApprovalFailed>>? = null,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChannelDirectMessagesEventMessage<SuggestedPostApprovalFailed>>
) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, additionalSubcontextInitialAction, scenarioReceiver)
/**
* @param initialFilter This filter will be called to remove unnecessary data BEFORE [scenarioReceiver] call
* @param subcontextUpdatesFilter This filter will be applied to each update inside of [scenarioReceiver]. For example,
* this filter will be used if you will call [dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.waitContentMessage].
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data
*/
fun <BC : BehaviourContext> BC.onSuggestedPostDeclined(
initialFilter: SimpleFilter<ChannelDirectMessagesEventMessage<SuggestedPostDeclined>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChannelDirectMessagesEventMessage<SuggestedPostDeclined>, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in ChannelDirectMessagesEventMessage<SuggestedPostDeclined>, Any>? = ByChatMessageMarkerFactory,
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, ChannelDirectMessagesEventMessage<SuggestedPostDeclined>>? = null,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChannelDirectMessagesEventMessage<SuggestedPostDeclined>>
) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, additionalSubcontextInitialAction, scenarioReceiver)
/**
* @param initialFilter This filter will be called to remove unnecessary data BEFORE [scenarioReceiver] call
* @param subcontextUpdatesFilter This filter will be applied to each update inside of [scenarioReceiver]. For example,
* this filter will be used if you will call [dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.waitContentMessage].
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data
*/
fun <BC : BehaviourContext> BC.onSuggestedPostPaid(
initialFilter: SimpleFilter<ChannelDirectMessagesEventMessage<SuggestedPostPaid>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChannelDirectMessagesEventMessage<SuggestedPostPaid>, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in ChannelDirectMessagesEventMessage<SuggestedPostPaid>, Any>? = ByChatMessageMarkerFactory,
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, ChannelDirectMessagesEventMessage<SuggestedPostPaid>>? = null,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChannelDirectMessagesEventMessage<SuggestedPostPaid>>
) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, additionalSubcontextInitialAction, scenarioReceiver)
/**
* @param initialFilter This filter will be called to remove unnecessary data BEFORE [scenarioReceiver] call
* @param subcontextUpdatesFilter This filter will be applied to each update inside of [scenarioReceiver]. For example,
* this filter will be used if you will call [dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.waitContentMessage].
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data
*/
fun <BC : BehaviourContext> BC.onSuggestedPostRefunded(
initialFilter: SimpleFilter<ChannelDirectMessagesEventMessage<SuggestedPostRefunded>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChannelDirectMessagesEventMessage<SuggestedPostRefunded>, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in ChannelDirectMessagesEventMessage<SuggestedPostRefunded>, Any>? = ByChatMessageMarkerFactory,
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, ChannelDirectMessagesEventMessage<SuggestedPostRefunded>>? = null,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChannelDirectMessagesEventMessage<SuggestedPostRefunded>>
) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, additionalSubcontextInitialAction, scenarioReceiver) ) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, additionalSubcontextInitialAction, scenarioReceiver)

View File

@@ -83,7 +83,7 @@ fun <BC : BehaviourContext, R, U : Update> CustomBehaviourContextAndTypeReceiver
*/ */
class DefaultCustomBehaviourContextAndTypeReceiver<BC : BehaviourContext, R, U : Update>( class DefaultCustomBehaviourContextAndTypeReceiver<BC : BehaviourContext, R, U : Update>(
private val wrapperReceiver: CustomBehaviourContextAndTypeReceiver<BC, R, U> private val wrapperReceiver: CustomBehaviourContextAndTypeReceiver<BC, R, U>
) : CustomBehaviourContextAndTypeReceiver<BC, R, U> { ) : suspend (BC, U) -> R {
private var botInfo: ExtendedBot? = null private var botInfo: ExtendedBot? = null
private val mutex = Mutex() private val mutex = Mutex()

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,7 @@
package dev.inmo.tgbotapi.abstracts.types
import dev.inmo.tgbotapi.types.message.SuggestedPostParameters
interface OptionallyPaidPost {
val suggestedPostParameters: SuggestedPostParameters?
}

View File

@@ -3,9 +3,24 @@ package dev.inmo.tgbotapi.bot.ktor
import dev.inmo.tgbotapi.requests.abstracts.Request import dev.inmo.tgbotapi.requests.abstracts.Request
interface TelegramBotPipelinesHandler { interface TelegramBotPipelinesHandler {
/**
* Will be called when any exception will happen due to the [request] handling inside of limiter block. This method
* will be called for each exception happened during call factory call
*/
suspend fun <T: Any> onRequestExceptionInLimiter(
request: Request<T>,
t: Throwable
): T? = null
/** /**
* Will be called when any exception will happen due to the [request] handling. If returns value - that value * Will be called when any exception will happen due to the [request] handling. If returns value - that value
* will be returned from [dev.inmo.tgbotapi.bot.RequestsExecutor.execute] instead * will be returned from [dev.inmo.tgbotapi.bot.RequestsExecutor.execute] instead. In difference with
* [onRequestExceptionInLimiter], this method will be called only AFTER
* [dev.inmo.tgbotapi.bot.settings.limiters.RequestLimiter] will pass result of call factory execution outside of
* its [dev.inmo.tgbotapi.bot.settings.limiters.RequestLimiter.limit] function
*
* @see dev.inmo.tgbotapi.bot.ktor.base.DefaultKtorRequestsExecutor
* @see dev.inmo.tgbotapi.bot.settings.limiters.ExceptionsOnlyLimiter
*/ */
suspend fun <T: Any> onRequestException( suspend fun <T: Any> onRequestException(
request: Request<T>, request: Request<T>,

View File

@@ -53,29 +53,33 @@ class DefaultKtorRequestsExecutor internal constructor(
logger.v { "Start request $request" } logger.v { "Start request $request" }
pipelineStepsHolder.onBeforeSearchCallFactory(request, callsFactories) pipelineStepsHolder.onBeforeSearchCallFactory(request, callsFactories)
requestsLimiter.limit(request) { requestsLimiter.limit(request) {
var result: T? = null runCatching {
lateinit var factoryHandledRequest: KtorCallFactory var result: T? = null
for (potentialFactory in callsFactories) { lateinit var factoryHandledRequest: KtorCallFactory
pipelineStepsHolder.onBeforeCallFactoryMakeCall(request, potentialFactory) for (potentialFactory in callsFactories) {
logger.v { "Trying factory $potentialFactory for $request" } pipelineStepsHolder.onBeforeCallFactoryMakeCall(request, potentialFactory)
val resultFromFactory = potentialFactory.makeCall( logger.v { "Trying factory $potentialFactory for $request" }
client, val resultFromFactory = potentialFactory.makeCall(
telegramAPIUrlsKeeper, client,
request, telegramAPIUrlsKeeper,
jsonFormatter request,
) jsonFormatter
logger.v { "Result of factory $potentialFactory handling $request: $resultFromFactory" } )
result = pipelineStepsHolder.onAfterCallFactoryMakeCall(resultFromFactory, request, potentialFactory) logger.v { "Result of factory $potentialFactory handling $request: $resultFromFactory" }
logger.v { "Result of pipeline $pipelineStepsHolder handling $resultFromFactory: $result" } result = pipelineStepsHolder.onAfterCallFactoryMakeCall(resultFromFactory, request, potentialFactory)
if (result != null) { logger.v { "Result of pipeline $pipelineStepsHolder handling $resultFromFactory: $result" }
factoryHandledRequest = potentialFactory if (result != null) {
break factoryHandledRequest = potentialFactory
break
}
} }
}
result ?.let { result ?.let {
pipelineStepsHolder.onRequestResultPresented(it, request, factoryHandledRequest, callsFactories) pipelineStepsHolder.onRequestResultPresented(it, request, factoryHandledRequest, callsFactories)
} ?: pipelineStepsHolder.onRequestResultAbsent(request, callsFactories) ?: error("Can't execute request: $request") } ?: pipelineStepsHolder.onRequestResultAbsent(request, callsFactories) ?: error("Can't execute request: $request")
}.onFailure { e ->
pipelineStepsHolder.onRequestExceptionInLimiter(request, e) ?.let { return@let it } ?: throw e
}.getOrThrow()
} }
}.let { }.let {
val result = it.exceptionOrNull() ?.let { e -> val result = it.exceptionOrNull() ?.let { e ->

View File

@@ -31,9 +31,16 @@ open class TelegramBotMiddleware(
internal val onRequestResultPresented: (suspend (result: Any, request: Request<*>, resultCallFactory: KtorCallFactory, callsFactories: List<KtorCallFactory>) -> Any?)? = null, internal val onRequestResultPresented: (suspend (result: Any, request: Request<*>, resultCallFactory: KtorCallFactory, callsFactories: List<KtorCallFactory>) -> Any?)? = null,
internal val onRequestResultAbsent: (suspend (request: Request<*>, callsFactories: List<KtorCallFactory>) -> Any?)? = null, internal val onRequestResultAbsent: (suspend (request: Request<*>, callsFactories: List<KtorCallFactory>) -> Any?)? = null,
internal val onRequestReturnResult: (suspend (result: Result<*>, request: Request<*>, callsFactories: List<KtorCallFactory>) -> Result<Any?>?)? = null, internal val onRequestReturnResult: (suspend (result: Result<*>, request: Request<*>, callsFactories: List<KtorCallFactory>) -> Result<Any?>?)? = null,
internal val onRequestExceptionInLimiter: (suspend (request: Request<*>, t: Throwable?) -> Any?)? = null,
val id: String = uuid4().toString() val id: String = uuid4().toString()
) : TelegramBotPipelinesHandler { ) : TelegramBotPipelinesHandler {
object ResultAbsence : Throwable() object ResultAbsence : Throwable()
override suspend fun <T : Any> onRequestExceptionInLimiter(request: Request<T>, t: Throwable): T? {
@Suppress("UNCHECKED_CAST")
return onRequestExceptionInLimiter ?.invoke(request, t) as? T
}
override suspend fun <T : Any> onRequestException(request: Request<T>, t: Throwable): T? { override suspend fun <T : Any> onRequestException(request: Request<T>, t: Throwable): T? {
@Suppress("UNCHECKED_CAST") @Suppress("UNCHECKED_CAST")
return onRequestException ?.invoke(request, t) as? T return onRequestException ?.invoke(request, t) as? T

View File

@@ -8,6 +8,7 @@ import dev.inmo.tgbotapi.requests.abstracts.Request
@Warning("This API is experimental and subject of changes") @Warning("This API is experimental and subject of changes")
class TelegramBotMiddlewareBuilder { class TelegramBotMiddlewareBuilder {
var onRequestExceptionInLimiter: (suspend (request: Request<*>, t: Throwable?) -> Any?)? = null
var onRequestException: (suspend (request: Request<*>, t: Throwable?) -> Any?)? = null var onRequestException: (suspend (request: Request<*>, t: Throwable?) -> Any?)? = null
var onBeforeSearchCallFactory: (suspend (request: Request<*>, callsFactories: List<KtorCallFactory>) -> Unit)? = null var onBeforeSearchCallFactory: (suspend (request: Request<*>, callsFactories: List<KtorCallFactory>) -> Unit)? = null
var onBeforeCallFactoryMakeCall: (suspend (request: Request<*>, potentialFactory: KtorCallFactory) -> Unit)? = null var onBeforeCallFactoryMakeCall: (suspend (request: Request<*>, potentialFactory: KtorCallFactory) -> Unit)? = null
@@ -17,6 +18,12 @@ class TelegramBotMiddlewareBuilder {
var onRequestReturnResult: (suspend (result: Result<*>, request: Request<*>, callsFactories: List<KtorCallFactory>) -> Result<Any?>?)? = null var onRequestReturnResult: (suspend (result: Result<*>, request: Request<*>, callsFactories: List<KtorCallFactory>) -> Result<Any?>?)? = null
var id: String = uuid4().toString() var id: String = uuid4().toString()
/**
* Useful way to set [onRequestException]
*/
fun doOnRequestExceptionInLimiter(block: suspend (request: Request<*>, t: Throwable?) -> Any?) {
onRequestExceptionInLimiter = block
}
/** /**
* Useful way to set [onRequestException] * Useful way to set [onRequestException]
*/ */
@@ -63,6 +70,7 @@ class TelegramBotMiddlewareBuilder {
@Warning("This API is experimental and subject of changes") @Warning("This API is experimental and subject of changes")
fun build(): TelegramBotMiddleware { fun build(): TelegramBotMiddleware {
return TelegramBotMiddleware( return TelegramBotMiddleware(
onRequestExceptionInLimiter = onRequestExceptionInLimiter,
onRequestException = onRequestException, onRequestException = onRequestException,
onBeforeSearchCallFactory = onBeforeSearchCallFactory, onBeforeSearchCallFactory = onBeforeSearchCallFactory,
onBeforeCallFactoryMakeCall = onBeforeCallFactoryMakeCall, onBeforeCallFactoryMakeCall = onBeforeCallFactoryMakeCall,
@@ -78,6 +86,7 @@ class TelegramBotMiddlewareBuilder {
@Warning("This API is experimental and subject of changes") @Warning("This API is experimental and subject of changes")
fun from(middleware: TelegramBotMiddleware, additionalSetup: TelegramBotMiddlewareBuilder.() -> Unit): TelegramBotMiddleware { fun from(middleware: TelegramBotMiddleware, additionalSetup: TelegramBotMiddlewareBuilder.() -> Unit): TelegramBotMiddleware {
return TelegramBotMiddlewareBuilder().apply { return TelegramBotMiddlewareBuilder().apply {
onRequestExceptionInLimiter = middleware.onRequestExceptionInLimiter
onRequestException = middleware.onRequestException onRequestException = middleware.onRequestException
onBeforeSearchCallFactory = middleware.onBeforeSearchCallFactory onBeforeSearchCallFactory = middleware.onBeforeSearchCallFactory
onBeforeCallFactoryMakeCall = middleware.onBeforeCallFactoryMakeCall onBeforeCallFactoryMakeCall = middleware.onBeforeCallFactoryMakeCall

View File

@@ -10,6 +10,12 @@ import dev.inmo.tgbotapi.requests.abstracts.Request
class TelegramBotMiddlewaresPipelinesHandler( class TelegramBotMiddlewaresPipelinesHandler(
private val middlewares: List<TelegramBotMiddleware> = emptyList() private val middlewares: List<TelegramBotMiddleware> = emptyList()
) : TelegramBotPipelinesHandler { ) : TelegramBotPipelinesHandler {
override suspend fun <T : Any> onRequestExceptionInLimiter(request: Request<T>, t: Throwable): T? {
return middlewares.firstNotNullOfOrNull {
it.onRequestExceptionInLimiter(request, t)
} ?: super.onRequestExceptionInLimiter(request, t)
}
override suspend fun <T : Any> onRequestException(request: Request<T>, t: Throwable): T? { override suspend fun <T : Any> onRequestException(request: Request<T>, t: Throwable): T? {
return middlewares.firstNotNullOfOrNull { return middlewares.firstNotNullOfOrNull {
it.onRequestException(request, t) it.onRequestException(request, t)

View File

@@ -1,6 +1,8 @@
package dev.inmo.tgbotapi.bot.settings.limiters package dev.inmo.tgbotapi.bot.settings.limiters
import dev.inmo.tgbotapi.bot.exceptions.TooMuchRequestsException import dev.inmo.tgbotapi.bot.exceptions.TooMuchRequestsException
import dev.inmo.tgbotapi.utils.isCausedUnresolvedAddressException
import io.ktor.util.network.UnresolvedAddressException
import kotlinx.coroutines.delay import kotlinx.coroutines.delay
/** /**
@@ -13,10 +15,10 @@ object ExceptionsOnlyLimiter : RequestLimiter {
result = runCatching { result = runCatching {
block() block()
}.onFailure { }.onFailure {
if (it is TooMuchRequestsException) { when {
delay(it.retryAfter.leftToRetry) it.isCausedUnresolvedAddressException() -> delay(1000L)
} else { it is TooMuchRequestsException -> delay(it.retryAfter.leftToRetry)
throw it else -> throw it
} }
} }
} }

View File

@@ -2,10 +2,14 @@ package dev.inmo.tgbotapi.requests
import dev.inmo.tgbotapi.abstracts.WithCustomStartMediaData import dev.inmo.tgbotapi.abstracts.WithCustomStartMediaData
import dev.inmo.tgbotapi.abstracts.types.MessageAction import dev.inmo.tgbotapi.abstracts.types.MessageAction
import dev.inmo.tgbotapi.abstracts.types.OptionallyWithEffectId
import dev.inmo.tgbotapi.abstracts.types.ProtectContent import dev.inmo.tgbotapi.abstracts.types.ProtectContent
import dev.inmo.tgbotapi.requests.abstracts.SimpleRequest import dev.inmo.tgbotapi.requests.abstracts.SimpleRequest
import dev.inmo.tgbotapi.requests.send.abstracts.OptionallyDirectMessageThreadRequest
import dev.inmo.tgbotapi.requests.send.abstracts.OptionallyMessageThreadRequest import dev.inmo.tgbotapi.requests.send.abstracts.OptionallyMessageThreadRequest
import dev.inmo.tgbotapi.requests.send.abstracts.OptionallySuggestedPostRequest
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.message.SuggestedPostParameters
import dev.inmo.tgbotapi.types.message.abstracts.PossiblyForwardedMessage import dev.inmo.tgbotapi.types.message.abstracts.PossiblyForwardedMessage
import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass
import kotlinx.serialization.* import kotlinx.serialization.*
@@ -24,13 +28,28 @@ data class ForwardMessage(
@SerialName(messageThreadIdField) @SerialName(messageThreadIdField)
@EncodeDefault @EncodeDefault
override val threadId: MessageThreadId? = toChatId.threadId, override val threadId: MessageThreadId? = toChatId.threadId,
@OptIn(ExperimentalSerializationApi::class)
@EncodeDefault
@SerialName(directMessagesTopicIdField)
override val directMessageThreadId: DirectMessageThreadId? = toChatId.directMessageThreadId,
@SerialName(videoStartTimestampField) @SerialName(videoStartTimestampField)
override val startTimestamp: Seconds? = null, override val startTimestamp: Seconds? = null,
@SerialName(disableNotificationField) @SerialName(disableNotificationField)
val disableNotification: Boolean = false, val disableNotification: Boolean = false,
@SerialName(protectContentField) @SerialName(protectContentField)
override val protectContent: Boolean = false override val protectContent: Boolean = false,
): SimpleRequest<PossiblyForwardedMessage>, MessageAction, ProtectContent, OptionallyMessageThreadRequest, WithCustomStartMediaData { @SerialName(messageEffectIdField)
override val effectId: EffectId? = null,
@SerialName(suggestedPostParametersField)
override val suggestedPostParameters: SuggestedPostParameters? = null
): SimpleRequest<PossiblyForwardedMessage>,
MessageAction,
ProtectContent,
OptionallyMessageThreadRequest,
OptionallyDirectMessageThreadRequest,
OptionallySuggestedPostRequest,
WithCustomStartMediaData,
OptionallyWithEffectId {
override val chatId: ChatIdentifier override val chatId: ChatIdentifier
get() = fromChatId get() = fromChatId

View File

@@ -4,6 +4,7 @@ import dev.inmo.tgbotapi.abstracts.types.DisableNotification
import dev.inmo.tgbotapi.abstracts.types.MessagesAction import dev.inmo.tgbotapi.abstracts.types.MessagesAction
import dev.inmo.tgbotapi.abstracts.types.ProtectContent import dev.inmo.tgbotapi.abstracts.types.ProtectContent
import dev.inmo.tgbotapi.requests.abstracts.SimpleRequest import dev.inmo.tgbotapi.requests.abstracts.SimpleRequest
import dev.inmo.tgbotapi.requests.send.abstracts.OptionallyDirectMessageThreadRequest
import dev.inmo.tgbotapi.requests.send.abstracts.OptionallyMessageThreadRequest import dev.inmo.tgbotapi.requests.send.abstracts.OptionallyMessageThreadRequest
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
import kotlinx.serialization.* import kotlinx.serialization.*
@@ -14,6 +15,7 @@ fun ForwardMessages(
fromChatId: ChatIdentifier, fromChatId: ChatIdentifier,
messageIds: Array<MessageId>, messageIds: Array<MessageId>,
threadId: MessageThreadId? = toChatId.threadId, threadId: MessageThreadId? = toChatId.threadId,
directMessageThreadId: DirectMessageThreadId? = toChatId.directMessageThreadId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
removeCaption: Boolean = false removeCaption: Boolean = false
@@ -22,6 +24,7 @@ fun ForwardMessages(
fromChatId = fromChatId, fromChatId = fromChatId,
messageIds = messageIds.toList(), messageIds = messageIds.toList(),
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
removeCaption = removeCaption removeCaption = removeCaption
@@ -39,6 +42,10 @@ data class ForwardMessages (
@SerialName(messageThreadIdField) @SerialName(messageThreadIdField)
@EncodeDefault @EncodeDefault
override val threadId: MessageThreadId? = toChatId.threadId, override val threadId: MessageThreadId? = toChatId.threadId,
@OptIn(ExperimentalSerializationApi::class)
@EncodeDefault
@SerialName(directMessagesTopicIdField)
override val directMessageThreadId: DirectMessageThreadId? = toChatId.directMessageThreadId,
@SerialName(disableNotificationField) @SerialName(disableNotificationField)
override val disableNotification: Boolean = false, override val disableNotification: Boolean = false,
@SerialName(protectContentField) @SerialName(protectContentField)
@@ -49,6 +56,7 @@ data class ForwardMessages (
MessagesAction, MessagesAction,
ProtectContent, ProtectContent,
OptionallyMessageThreadRequest, OptionallyMessageThreadRequest,
OptionallyDirectMessageThreadRequest,
DisableNotification { DisableNotification {
override val chatId: ChatIdentifier override val chatId: ChatIdentifier
get() = fromChatId get() = fromChatId

View File

@@ -0,0 +1,16 @@
package dev.inmo.tgbotapi.requests.bot
import dev.inmo.tgbotapi.requests.abstracts.SimpleRequest
import kotlinx.serialization.DeserializationStrategy
import kotlinx.serialization.Serializable
import kotlinx.serialization.SerializationStrategy
import kotlinx.serialization.builtins.serializer
@Serializable
object RemoveMyProfilePhoto : SimpleRequest<Boolean> {
override fun method(): String = "removeMyProfilePhoto"
override val resultDeserializer: DeserializationStrategy<Boolean>
get() = Boolean.serializer()
override val requestSerializer: SerializationStrategy<*>
get() = serializer()
}

View File

@@ -0,0 +1,29 @@
package dev.inmo.tgbotapi.requests.bot
import dev.inmo.tgbotapi.requests.abstracts.*
import dev.inmo.tgbotapi.requests.business_connection.InputProfilePhoto
import dev.inmo.tgbotapi.types.photoField
import kotlinx.serialization.*
import kotlinx.serialization.builtins.serializer
import kotlinx.serialization.json.JsonObject
@Serializable
data class SetMyProfilePhoto(
@SerialName(photoField)
val photo: InputProfilePhoto
) : MultipartRequest.Common<Boolean> {
override fun method(): String = "setMyProfilePhoto"
override val resultDeserializer: DeserializationStrategy<Boolean>
get() = Boolean.serializer()
override val requestSerializer: SerializationStrategy<*>
get() = serializer()
override val data: SimpleRequest<Boolean>
get() = this
@Suppress("SERIALIZER_TYPE_INCOMPATIBLE")
override val mediaMap: Map<String, MultipartFile> = mapOf(
photo.mediaPair
)
}

View File

@@ -8,16 +8,20 @@ import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.excludeUnsavedField import dev.inmo.tgbotapi.types.excludeUnsavedField
import dev.inmo.tgbotapi.types.excludeSavedField import dev.inmo.tgbotapi.types.excludeSavedField
import dev.inmo.tgbotapi.types.excludeUnlimitedField import dev.inmo.tgbotapi.types.excludeUnlimitedField
import dev.inmo.tgbotapi.types.excludeLimitedField import dev.inmo.tgbotapi.types.excludeLimitedUpgradableField
import dev.inmo.tgbotapi.types.excludeLimitedNonUpgradableField
import dev.inmo.tgbotapi.types.excludeUniqueField import dev.inmo.tgbotapi.types.excludeUniqueField
import dev.inmo.tgbotapi.types.excludeFromBlockchainField
import dev.inmo.tgbotapi.types.sortByPriceField import dev.inmo.tgbotapi.types.sortByPriceField
import dev.inmo.tgbotapi.types.offsetField import dev.inmo.tgbotapi.types.offsetField
import dev.inmo.tgbotapi.types.limitField import dev.inmo.tgbotapi.types.limitField
import dev.inmo.tgbotapi.types.gifts.GiftSentOrReceived import dev.inmo.tgbotapi.types.gifts.GiftSentOrReceivedEvent
import dev.inmo.tgbotapi.types.gifts.OwnedGift
import kotlinx.serialization.DeserializationStrategy import kotlinx.serialization.DeserializationStrategy
import kotlinx.serialization.SerialName import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
import kotlinx.serialization.SerializationStrategy import kotlinx.serialization.SerializationStrategy
import kotlinx.serialization.builtins.serializer
@Serializable @Serializable
data class GetBusinessAccountGifts( data class GetBusinessAccountGifts(
@@ -29,26 +33,30 @@ data class GetBusinessAccountGifts(
val excludeSaved: Boolean = false, val excludeSaved: Boolean = false,
@SerialName(excludeUnlimitedField) @SerialName(excludeUnlimitedField)
val excludeUnlimited: Boolean = false, val excludeUnlimited: Boolean = false,
@SerialName(excludeLimitedField) @SerialName(excludeLimitedUpgradableField)
val excludeLimited: Boolean = false, val excludeLimitedUpgradable: Boolean = false,
@SerialName(excludeLimitedNonUpgradableField)
val excludeLimitedNonUpgradable: Boolean = false,
@SerialName(excludeUniqueField) @SerialName(excludeUniqueField)
val excludeUnique: Boolean = false, val excludeUnique: Boolean = false,
@SerialName(excludeFromBlockchainField)
val excludeFromBlockchain: Boolean = false,
@SerialName(sortByPriceField) @SerialName(sortByPriceField)
val sortByPrice: Boolean = false, val sortByPrice: Boolean = false,
@SerialName(offsetField) @SerialName(offsetField)
val offset: String? = null, val offset: String? = null,
@SerialName(limitField) @SerialName(limitField)
val limit: Int? = null, val limit: Int? = null,
) : BusinessRequest.Simple<OwnedGifts<GiftSentOrReceived.ReceivedInBusinessAccount>> { ) : BusinessRequest.Simple<OwnedGifts<OwnedGift.OwnedByBusinessAccount>> {
override fun method(): String = "getBusinessAccountGifts" override fun method(): String = "getBusinessAccountGifts"
override val resultDeserializer: DeserializationStrategy<OwnedGifts<GiftSentOrReceived.ReceivedInBusinessAccount>> override val resultDeserializer: DeserializationStrategy<OwnedGifts<OwnedGift.OwnedByBusinessAccount>>
get() = Companion.resultSerializer get() = Companion.resultSerializer
override val requestSerializer: SerializationStrategy<*> override val requestSerializer: SerializationStrategy<*>
get() = serializer() get() = serializer()
companion object { companion object {
@Warning("This API can be changed without any warranties of backward compatibility") @Warning("This API can be changed without any warranties of backward compatibility")
val resultSerializer = OwnedGifts.serializer(GiftSentOrReceived.ReceivedInBusinessAccount.serializer()) val resultSerializer = OwnedGifts.serializer(OwnedGift.OwnedByBusinessAccount.serializer())
} }
} }

View File

@@ -46,7 +46,9 @@ data class PromoteChatMember(
@SerialName(canEditStoriesField) @SerialName(canEditStoriesField)
private val canEditStories: Boolean? = null, private val canEditStories: Boolean? = null,
@SerialName(canDeleteStoriesField) @SerialName(canDeleteStoriesField)
private val canDeleteStories: Boolean? = null private val canDeleteStories: Boolean? = null,
@SerialName(canManageDirectMessagesField)
private val canManageDirectMessages: Boolean? = null,
) : ChatMemberRequest<Boolean>, UntilDate { ) : ChatMemberRequest<Boolean>, UntilDate {
override fun method(): String = "promoteChatMember" override fun method(): String = "promoteChatMember"
override val resultDeserializer: DeserializationStrategy<Boolean> override val resultDeserializer: DeserializationStrategy<Boolean>
@@ -104,7 +106,8 @@ fun PromoteChannelAdministrator(
canManageChat: Boolean? = null, canManageChat: Boolean? = null,
canPostStories: Boolean? = null, canPostStories: Boolean? = null,
canEditStories: Boolean? = null, canEditStories: Boolean? = null,
canDeleteStories: Boolean? = null canDeleteStories: Boolean? = null,
canManageDirectMessages: Boolean? = null,
) = PromoteChatMember( ) = PromoteChatMember(
chatId = chatId, chatId = chatId,
userId = userId, userId = userId,
@@ -123,7 +126,8 @@ fun PromoteChannelAdministrator(
canManageTopics = null, canManageTopics = null,
canPostStories = canPostStories, canPostStories = canPostStories,
canEditStories = canEditStories, canEditStories = canEditStories,
canDeleteStories = canDeleteStories canDeleteStories = canDeleteStories,
canManageDirectMessages = canManageDirectMessages
) )
fun PromoteSupergroupAdministrator( fun PromoteSupergroupAdministrator(

View File

@@ -0,0 +1,32 @@
package dev.inmo.tgbotapi.requests.get
import dev.inmo.tgbotapi.requests.abstracts.SimpleRequest
import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.UserProfileAudios
import kotlinx.serialization.*
@Serializable
data class GetUserProfileAudios(
@Suppress("SERIALIZER_TYPE_INCOMPATIBLE")
@SerialName(userIdField)
val userId: UserId,
@SerialName(offsetField)
val offset: Int? = null,
@SerialName(limitField)
val limit: Int? = null
): SimpleRequest<UserProfileAudios> {
init {
if (offset != null && offset < 0) {
throw IllegalArgumentException("Offset for getting user profile audios must be positive")
}
if (limit != null && limit !in userProfileAudiosRequestLimit) {
throw IllegalArgumentException("Limit for getting user profile audios must be in 0 .. 100 range")
}
}
override fun method(): String = "getUserProfileAudios"
override val resultDeserializer: DeserializationStrategy<UserProfileAudios>
get() = UserProfileAudios.serializer()
override val requestSerializer: SerializationStrategy<*>
get() = serializer()
}

View File

@@ -0,0 +1,62 @@
package dev.inmo.tgbotapi.requests.gifts
import dev.inmo.micro_utils.common.Warning
import dev.inmo.tgbotapi.abstracts.types.ChatRequest
import dev.inmo.tgbotapi.requests.abstracts.SimpleRequest
import dev.inmo.tgbotapi.types.ChatIdentifier
import dev.inmo.tgbotapi.types.OwnedGifts
import dev.inmo.tgbotapi.types.chatIdField
import dev.inmo.tgbotapi.types.excludeUnsavedField
import dev.inmo.tgbotapi.types.excludeSavedField
import dev.inmo.tgbotapi.types.excludeUnlimitedField
import dev.inmo.tgbotapi.types.excludeLimitedUpgradableField
import dev.inmo.tgbotapi.types.excludeLimitedNonUpgradableField
import dev.inmo.tgbotapi.types.excludeFromBlockchainField
import dev.inmo.tgbotapi.types.excludeUniqueField
import dev.inmo.tgbotapi.types.sortByPriceField
import dev.inmo.tgbotapi.types.gifts.GiftSentOrReceivedEvent
import dev.inmo.tgbotapi.types.gifts.OwnedGift
import dev.inmo.tgbotapi.types.limitField
import dev.inmo.tgbotapi.types.offsetField
import kotlinx.serialization.DeserializationStrategy
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
import kotlinx.serialization.SerializationStrategy
@Serializable
data class GetChatGifts(
@SerialName(chatIdField)
override val chatId: ChatIdentifier,
@SerialName(excludeUnsavedField)
val excludeUnsaved: Boolean = false,
@SerialName(excludeSavedField)
val excludeSaved: Boolean = false,
@SerialName(excludeUnlimitedField)
val excludeUnlimited: Boolean = false,
@SerialName(excludeLimitedUpgradableField)
val excludeLimitedUpgradable: Boolean = false,
@SerialName(excludeLimitedNonUpgradableField)
val excludeLimitedNonUpgradable: Boolean = false,
@SerialName(excludeFromBlockchainField)
val excludeFromBlockchain: Boolean = false,
@SerialName(excludeUniqueField)
val excludeUnique: Boolean = false,
@SerialName(sortByPriceField)
val sortByPrice: Boolean = false,
@SerialName(offsetField)
val offset: String? = null,
@SerialName(limitField)
val limit: Int? = null,
) : SimpleRequest<OwnedGifts<OwnedGift.Common>>, ChatRequest {
override fun method(): String = "getChatGifts"
override val resultDeserializer: DeserializationStrategy<OwnedGifts<OwnedGift.Common>>
get() = Companion.resultSerializer
override val requestSerializer: SerializationStrategy<*>
get() = serializer()
companion object {
@Warning("This API can be changed without any warranties of backward compatibility")
val resultSerializer = OwnedGifts.serializer(OwnedGift.Common.serializer())
}
}

View File

@@ -0,0 +1,56 @@
package dev.inmo.tgbotapi.requests.gifts
import dev.inmo.micro_utils.common.Warning
import dev.inmo.tgbotapi.requests.abstracts.SimpleRequest
import dev.inmo.tgbotapi.types.OwnedGifts
import dev.inmo.tgbotapi.types.UserId
import dev.inmo.tgbotapi.types.excludeUnlimitedField
import dev.inmo.tgbotapi.types.excludeLimitedUpgradableField
import dev.inmo.tgbotapi.types.excludeLimitedNonUpgradableField
import dev.inmo.tgbotapi.types.excludeFromBlockchainField
import dev.inmo.tgbotapi.types.excludeUniqueField
import dev.inmo.tgbotapi.types.sortByPriceField
import dev.inmo.tgbotapi.types.gifts.GiftSentOrReceivedEvent
import dev.inmo.tgbotapi.types.gifts.OwnedGift
import dev.inmo.tgbotapi.types.limitField
import dev.inmo.tgbotapi.types.offsetField
import dev.inmo.tgbotapi.types.userIdField
import kotlinx.serialization.DeserializationStrategy
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
import kotlinx.serialization.SerializationStrategy
@Serializable
data class GetUserGifts(
@Suppress("SERIALIZER_TYPE_INCOMPATIBLE")
@SerialName(userIdField)
val userId: UserId,
@SerialName(excludeUnlimitedField)
val excludeUnlimited: Boolean = false,
@SerialName(excludeLimitedUpgradableField)
val excludeLimitedUpgradable: Boolean = false,
@SerialName(excludeLimitedNonUpgradableField)
val excludeLimitedNonUpgradable: Boolean = false,
@SerialName(excludeFromBlockchainField)
val excludeFromBlockchain: Boolean = false,
@SerialName(excludeUniqueField)
val excludeUnique: Boolean = false,
@SerialName(sortByPriceField)
val sortByPrice: Boolean = false,
@SerialName(offsetField)
val offset: String? = null,
@SerialName(limitField)
val limit: Int? = null,
) : SimpleRequest<OwnedGifts<OwnedGift.Common>> {
override fun method(): String = "getUserGifts"
override val resultDeserializer: DeserializationStrategy<OwnedGifts<OwnedGift.Common>>
get() = Companion.resultSerializer
override val requestSerializer: SerializationStrategy<*>
get() = serializer()
companion object {
@Warning("This API can be changed without any warranties of backward compatibility")
val resultSerializer = OwnedGifts.serializer(OwnedGift.Common.serializer())
}
}

View File

@@ -5,6 +5,7 @@ package dev.inmo.tgbotapi.requests.send
import dev.inmo.tgbotapi.abstracts.TextedOutput import dev.inmo.tgbotapi.abstracts.TextedOutput
import dev.inmo.tgbotapi.abstracts.WithCustomStartMediaData import dev.inmo.tgbotapi.abstracts.WithCustomStartMediaData
import dev.inmo.tgbotapi.abstracts.types.MessageAction import dev.inmo.tgbotapi.abstracts.types.MessageAction
import dev.inmo.tgbotapi.abstracts.types.OptionallyWithEffectId
import dev.inmo.tgbotapi.abstracts.types.ProtectContent import dev.inmo.tgbotapi.abstracts.types.ProtectContent
import dev.inmo.tgbotapi.requests.abstracts.SimpleRequest import dev.inmo.tgbotapi.requests.abstracts.SimpleRequest
import dev.inmo.tgbotapi.requests.send.abstracts.OptionallyMessageThreadRequest import dev.inmo.tgbotapi.requests.send.abstracts.OptionallyMessageThreadRequest
@@ -90,10 +91,13 @@ fun CopyMessage(
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
showCaptionAboveMedia: Boolean = false, showCaptionAboveMedia: Boolean = false,
threadId: MessageThreadId? = toChatId.threadId, threadId: MessageThreadId? = toChatId.threadId,
directMessageThreadId: DirectMessageThreadId? = toChatId.directMessageThreadId,
startTimestamp: Seconds? = null, startTimestamp: Seconds? = null,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = CopyMessage( ) = CopyMessage(
@@ -105,10 +109,13 @@ fun CopyMessage(
rawEntities = null, rawEntities = null,
showCaptionAboveMedia = showCaptionAboveMedia, showCaptionAboveMedia = showCaptionAboveMedia,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
startTimestamp = startTimestamp, startTimestamp = startTimestamp,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -120,10 +127,13 @@ fun CopyMessage(
entities: List<TextSource>, entities: List<TextSource>,
showCaptionAboveMedia: Boolean = false, showCaptionAboveMedia: Boolean = false,
threadId: MessageThreadId? = toChatId.threadId, threadId: MessageThreadId? = toChatId.threadId,
directMessageThreadId: DirectMessageThreadId? = toChatId.directMessageThreadId,
startTimestamp: Seconds? = null, startTimestamp: Seconds? = null,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = CopyMessage( ) = CopyMessage(
@@ -135,10 +145,13 @@ fun CopyMessage(
rawEntities = entities.toRawMessageEntities(), rawEntities = entities.toRawMessageEntities(),
showCaptionAboveMedia = showCaptionAboveMedia, showCaptionAboveMedia = showCaptionAboveMedia,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
startTimestamp = startTimestamp, startTimestamp = startTimestamp,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -164,6 +177,10 @@ data class CopyMessage internal constructor(
@SerialName(messageThreadIdField) @SerialName(messageThreadIdField)
@EncodeDefault @EncodeDefault
override val threadId: MessageThreadId? = toChatId.threadId, override val threadId: MessageThreadId? = toChatId.threadId,
@OptIn(ExperimentalSerializationApi::class)
@EncodeDefault
@SerialName(directMessagesTopicIdField)
override val directMessageThreadId: DirectMessageThreadId? = toChatId.directMessageThreadId,
@SerialName(videoStartTimestampField) @SerialName(videoStartTimestampField)
override val startTimestamp: Seconds? = null, override val startTimestamp: Seconds? = null,
@SerialName(disableNotificationField) @SerialName(disableNotificationField)
@@ -172,6 +189,10 @@ data class CopyMessage internal constructor(
override val protectContent: Boolean = false, override val protectContent: Boolean = false,
@SerialName(allowPaidBroadcastField) @SerialName(allowPaidBroadcastField)
override val allowPaidBroadcast: Boolean = false, override val allowPaidBroadcast: Boolean = false,
@SerialName(messageEffectIdField)
override val effectId: EffectId? = null,
@SerialName(suggestedPostParametersField)
override val suggestedPostParameters: SuggestedPostParameters? = null,
@SerialName(replyParametersField) @SerialName(replyParametersField)
override val replyParameters: ReplyParameters? = null, override val replyParameters: ReplyParameters? = null,
@SerialName(replyMarkupField) @SerialName(replyMarkupField)
@@ -183,7 +204,8 @@ data class CopyMessage internal constructor(
TextedOutput, TextedOutput,
ProtectContent, ProtectContent,
OptionallyMessageThreadRequest, OptionallyMessageThreadRequest,
WithCustomStartMediaData { WithCustomStartMediaData,
OptionallyWithEffectId {
override val chatId: ChatIdentifier override val chatId: ChatIdentifier
get() = fromChatId get() = fromChatId
override val textSources: List<TextSource>? by lazy { override val textSources: List<TextSource>? by lazy {

View File

@@ -2,6 +2,7 @@ package dev.inmo.tgbotapi.requests.send
import dev.inmo.tgbotapi.abstracts.types.* import dev.inmo.tgbotapi.abstracts.types.*
import dev.inmo.tgbotapi.requests.abstracts.SimpleRequest import dev.inmo.tgbotapi.requests.abstracts.SimpleRequest
import dev.inmo.tgbotapi.requests.send.abstracts.OptionallyDirectMessageThreadRequest
import dev.inmo.tgbotapi.requests.send.abstracts.OptionallyMessageThreadRequest import dev.inmo.tgbotapi.requests.send.abstracts.OptionallyMessageThreadRequest
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
@@ -19,6 +20,7 @@ fun CopyMessages(
fromChatId: ChatIdentifier, fromChatId: ChatIdentifier,
messageIds: Array<MessageId>, messageIds: Array<MessageId>,
threadId: MessageThreadId? = toChatId.threadId, threadId: MessageThreadId? = toChatId.threadId,
directMessageThreadId: DirectMessageThreadId? = toChatId.directMessageThreadId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
removeCaption: Boolean = false removeCaption: Boolean = false
@@ -27,6 +29,7 @@ fun CopyMessages(
fromChatId = fromChatId, fromChatId = fromChatId,
messageIds = messageIds.toList(), messageIds = messageIds.toList(),
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
removeCaption = removeCaption removeCaption = removeCaption
@@ -44,6 +47,10 @@ data class CopyMessages (
@SerialName(messageThreadIdField) @SerialName(messageThreadIdField)
@EncodeDefault @EncodeDefault
override val threadId: MessageThreadId? = toChatId.threadId, override val threadId: MessageThreadId? = toChatId.threadId,
@OptIn(ExperimentalSerializationApi::class)
@EncodeDefault
@SerialName(directMessagesTopicIdField)
override val directMessageThreadId: DirectMessageThreadId? = toChatId.directMessageThreadId,
@SerialName(disableNotificationField) @SerialName(disableNotificationField)
override val disableNotification: Boolean = false, override val disableNotification: Boolean = false,
@SerialName(protectContentField) @SerialName(protectContentField)
@@ -54,6 +61,7 @@ data class CopyMessages (
MessagesAction, MessagesAction,
ProtectContent, ProtectContent,
OptionallyMessageThreadRequest, OptionallyMessageThreadRequest,
OptionallyDirectMessageThreadRequest,
DisableNotification { DisableNotification {
override val chatId: ChatIdentifier override val chatId: ChatIdentifier
get() = fromChatId get() = fromChatId

View File

@@ -6,6 +6,7 @@ import dev.inmo.tgbotapi.requests.send.abstracts.SendMessageRequest
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
import dev.inmo.tgbotapi.types.message.SuggestedPostParameters
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass
import dev.inmo.tgbotapi.types.message.content.ContactContent import dev.inmo.tgbotapi.types.message.content.ContactContent
@@ -28,6 +29,10 @@ data class SendContact(
@SerialName(messageThreadIdField) @SerialName(messageThreadIdField)
@EncodeDefault @EncodeDefault
override val threadId: MessageThreadId? = chatId.threadId, override val threadId: MessageThreadId? = chatId.threadId,
@OptIn(ExperimentalSerializationApi::class)
@EncodeDefault
@SerialName(directMessagesTopicIdField)
override val directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
@SerialName(businessConnectionIdField) @SerialName(businessConnectionIdField)
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
@SerialName(disableNotificationField) @SerialName(disableNotificationField)
@@ -38,6 +43,8 @@ data class SendContact(
override val allowPaidBroadcast: Boolean = false, override val allowPaidBroadcast: Boolean = false,
@SerialName(messageEffectIdField) @SerialName(messageEffectIdField)
override val effectId: EffectId? = null, override val effectId: EffectId? = null,
@SerialName(suggestedPostParametersField)
override val suggestedPostParameters: SuggestedPostParameters? = null,
@SerialName(replyParametersField) @SerialName(replyParametersField)
override val replyParameters: ReplyParameters? = null, override val replyParameters: ReplyParameters? = null,
@SerialName(replyMarkupField) @SerialName(replyMarkupField)
@@ -49,11 +56,13 @@ data class SendContact(
chatId: ChatIdentifier, chatId: ChatIdentifier,
contact: Contact, contact: Contact,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): this( ): this(
@@ -62,11 +71,13 @@ data class SendContact(
contact.firstName, contact.firstName,
contact.lastName, contact.lastName,
threadId, threadId,
directMessageThreadId,
businessConnectionId, businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
allowPaidBroadcast, allowPaidBroadcast,
effectId, effectId,
suggestedPostParameters,
replyParameters, replyParameters,
replyMarkup replyMarkup
) )
@@ -81,22 +92,26 @@ data class SendContact(
fun Contact.toRequest( fun Contact.toRequest(
chatId: ChatIdentifier, chatId: ChatIdentifier,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): SendContact = SendContact( ): SendContact = SendContact(
chatId = chatId, chatId = chatId,
contact = this, contact = this,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )

View File

@@ -9,6 +9,7 @@ import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
import dev.inmo.tgbotapi.types.dice.DiceAnimationType import dev.inmo.tgbotapi.types.dice.DiceAnimationType
import dev.inmo.tgbotapi.types.message.SuggestedPostParameters
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass
import dev.inmo.tgbotapi.types.message.content.DiceContent import dev.inmo.tgbotapi.types.message.content.DiceContent
@@ -27,6 +28,10 @@ data class SendDice(
@SerialName(messageThreadIdField) @SerialName(messageThreadIdField)
@EncodeDefault @EncodeDefault
override val threadId: MessageThreadId? = chatId.threadId, override val threadId: MessageThreadId? = chatId.threadId,
@OptIn(ExperimentalSerializationApi::class)
@EncodeDefault
@SerialName(directMessagesTopicIdField)
override val directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
@SerialName(businessConnectionIdField) @SerialName(businessConnectionIdField)
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
@SerialName(disableNotificationField) @SerialName(disableNotificationField)
@@ -37,6 +42,8 @@ data class SendDice(
override val allowPaidBroadcast: Boolean = false, override val allowPaidBroadcast: Boolean = false,
@SerialName(messageEffectIdField) @SerialName(messageEffectIdField)
override val effectId: EffectId? = null, override val effectId: EffectId? = null,
@SerialName(suggestedPostParametersField)
override val suggestedPostParameters: SuggestedPostParameters? = null,
@SerialName(replyParametersField) @SerialName(replyParametersField)
override val replyParameters: ReplyParameters? = null, override val replyParameters: ReplyParameters? = null,
@SerialName(replyMarkupField) @SerialName(replyMarkupField)

View File

@@ -6,6 +6,7 @@ import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
import dev.inmo.tgbotapi.types.location.LiveLocation import dev.inmo.tgbotapi.types.location.LiveLocation
import dev.inmo.tgbotapi.types.message.SuggestedPostParameters
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass
import dev.inmo.tgbotapi.types.message.content.* import dev.inmo.tgbotapi.types.message.content.*
@@ -30,11 +31,13 @@ fun SendLocation(
latitude: Double, latitude: Double,
longitude: Double, longitude: Double,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = SendLocation.Static( ) = SendLocation.Static(
@@ -42,11 +45,13 @@ fun SendLocation(
latitude = latitude, latitude = latitude,
longitude = longitude, longitude = longitude,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -56,11 +61,13 @@ fun SendStaticLocation(
latitude: Double, latitude: Double,
longitude: Double, longitude: Double,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = SendLocation.Static( ) = SendLocation.Static(
@@ -68,11 +75,13 @@ fun SendStaticLocation(
latitude = latitude, latitude = latitude,
longitude = longitude, longitude = longitude,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -86,11 +95,13 @@ fun SendLiveLocation(
heading: Degrees? = null, heading: Degrees? = null,
proximityAlertRadius: Meters? = null, proximityAlertRadius: Meters? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = SendLocation.Live( ) = SendLocation.Live(
@@ -102,11 +113,13 @@ fun SendLiveLocation(
heading = heading, heading = heading,
proximityAlertRadius = proximityAlertRadius, proximityAlertRadius = proximityAlertRadius,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -143,6 +156,10 @@ sealed interface SendLocation<T : LocationContent> : SendContentMessageRequest<C
@SerialName(messageThreadIdField) @SerialName(messageThreadIdField)
@EncodeDefault @EncodeDefault
override val threadId: MessageThreadId? = chatId.threadId, override val threadId: MessageThreadId? = chatId.threadId,
@OptIn(ExperimentalSerializationApi::class)
@EncodeDefault
@SerialName(directMessagesTopicIdField)
override val directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
@SerialName(businessConnectionIdField) @SerialName(businessConnectionIdField)
@OptIn(ExperimentalSerializationApi::class) @OptIn(ExperimentalSerializationApi::class)
@EncodeDefault @EncodeDefault
@@ -155,6 +172,8 @@ sealed interface SendLocation<T : LocationContent> : SendContentMessageRequest<C
override val allowPaidBroadcast: Boolean = false, override val allowPaidBroadcast: Boolean = false,
@SerialName(messageEffectIdField) @SerialName(messageEffectIdField)
override val effectId: EffectId? = null, override val effectId: EffectId? = null,
@SerialName(suggestedPostParametersField)
override val suggestedPostParameters: SuggestedPostParameters? = null,
@SerialName(replyParametersField) @SerialName(replyParametersField)
override val replyParameters: ReplyParameters? = null, override val replyParameters: ReplyParameters? = null,
@SerialName(replyMarkupField) @SerialName(replyMarkupField)
@@ -187,6 +206,10 @@ sealed interface SendLocation<T : LocationContent> : SendContentMessageRequest<C
@OptIn(ExperimentalSerializationApi::class) @OptIn(ExperimentalSerializationApi::class)
@EncodeDefault @EncodeDefault
override val threadId: MessageThreadId? = chatId.threadId, override val threadId: MessageThreadId? = chatId.threadId,
@OptIn(ExperimentalSerializationApi::class)
@EncodeDefault
@SerialName(directMessagesTopicIdField)
override val directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
@SerialName(businessConnectionIdField) @SerialName(businessConnectionIdField)
@OptIn(ExperimentalSerializationApi::class) @OptIn(ExperimentalSerializationApi::class)
@EncodeDefault @EncodeDefault
@@ -199,6 +222,8 @@ sealed interface SendLocation<T : LocationContent> : SendContentMessageRequest<C
override val allowPaidBroadcast: Boolean = false, override val allowPaidBroadcast: Boolean = false,
@SerialName(messageEffectIdField) @SerialName(messageEffectIdField)
override val effectId: EffectId? = null, override val effectId: EffectId? = null,
@SerialName(suggestedPostParametersField)
override val suggestedPostParameters: SuggestedPostParameters? = null,
@SerialName(replyParametersField) @SerialName(replyParametersField)
override val replyParameters: ReplyParameters? = null, override val replyParameters: ReplyParameters? = null,
@SerialName(replyMarkupField) @SerialName(replyMarkupField)
@@ -237,6 +262,8 @@ sealed interface SendLocation<T : LocationContent> : SendContentMessageRequest<C
val proximityAlertRadius: Meters? = null, val proximityAlertRadius: Meters? = null,
@SerialName(messageThreadIdField) @SerialName(messageThreadIdField)
val threadId: MessageThreadId? = chatId.threadId, val threadId: MessageThreadId? = chatId.threadId,
@SerialName(directMessagesTopicIdField)
val directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
@SerialName(businessConnectionIdField) @SerialName(businessConnectionIdField)
val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
@SerialName(disableNotificationField) @SerialName(disableNotificationField)
@@ -247,6 +274,8 @@ sealed interface SendLocation<T : LocationContent> : SendContentMessageRequest<C
val allowPaidBroadcast: Boolean = false, val allowPaidBroadcast: Boolean = false,
@SerialName(messageEffectIdField) @SerialName(messageEffectIdField)
val effectId: EffectId? = null, val effectId: EffectId? = null,
@SerialName(suggestedPostParametersField)
val suggestedPostParameters: SuggestedPostParameters? = null,
@SerialName(replyParametersField) @SerialName(replyParametersField)
val replyParameters: ReplyParameters? = null, val replyParameters: ReplyParameters? = null,
@SerialName(replyMarkupField) @SerialName(replyMarkupField)
@@ -265,11 +294,13 @@ sealed interface SendLocation<T : LocationContent> : SendContentMessageRequest<C
latitude = surrogate.latitude, latitude = surrogate.latitude,
longitude = surrogate.longitude, longitude = surrogate.longitude,
threadId = surrogate.threadId, threadId = surrogate.threadId,
directMessageThreadId = surrogate.directMessageThreadId,
businessConnectionId = surrogate.businessConnectionId, businessConnectionId = surrogate.businessConnectionId,
disableNotification = surrogate.disableNotification, disableNotification = surrogate.disableNotification,
protectContent = surrogate.protectContent, protectContent = surrogate.protectContent,
allowPaidBroadcast = surrogate.allowPaidBroadcast, allowPaidBroadcast = surrogate.allowPaidBroadcast,
effectId = surrogate.effectId, effectId = surrogate.effectId,
suggestedPostParameters = surrogate.suggestedPostParameters,
replyParameters = surrogate.replyParameters, replyParameters = surrogate.replyParameters,
replyMarkup = surrogate.replyMarkup replyMarkup = surrogate.replyMarkup
) )
@@ -282,11 +313,13 @@ sealed interface SendLocation<T : LocationContent> : SendContentMessageRequest<C
heading = surrogate.heading, heading = surrogate.heading,
proximityAlertRadius = surrogate.proximityAlertRadius, proximityAlertRadius = surrogate.proximityAlertRadius,
threadId = surrogate.threadId, threadId = surrogate.threadId,
directMessageThreadId = surrogate.directMessageThreadId,
businessConnectionId = surrogate.businessConnectionId, businessConnectionId = surrogate.businessConnectionId,
disableNotification = surrogate.disableNotification, disableNotification = surrogate.disableNotification,
protectContent = surrogate.protectContent, protectContent = surrogate.protectContent,
allowPaidBroadcast = surrogate.allowPaidBroadcast, allowPaidBroadcast = surrogate.allowPaidBroadcast,
effectId = surrogate.effectId, effectId = surrogate.effectId,
suggestedPostParameters = surrogate.suggestedPostParameters,
replyParameters = surrogate.replyParameters, replyParameters = surrogate.replyParameters,
replyMarkup = surrogate.replyMarkup replyMarkup = surrogate.replyMarkup
) )
@@ -304,11 +337,13 @@ sealed interface SendLocation<T : LocationContent> : SendContentMessageRequest<C
heading = heading, heading = heading,
proximityAlertRadius = proximityAlertRadius, proximityAlertRadius = proximityAlertRadius,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )

View File

@@ -27,11 +27,13 @@ fun SendTextMessage(
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
linkPreviewOptions: LinkPreviewOptions? = null, linkPreviewOptions: LinkPreviewOptions? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = SendTextMessage( ) = SendTextMessage(
@@ -40,12 +42,14 @@ fun SendTextMessage(
parseMode = parseMode, parseMode = parseMode,
rawEntities = null, rawEntities = null,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
linkPreviewOptions = linkPreviewOptions, linkPreviewOptions = linkPreviewOptions,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -55,11 +59,13 @@ fun SendTextMessage(
entities: TextSourcesList, entities: TextSourcesList,
linkPreviewOptions: LinkPreviewOptions? = null, linkPreviewOptions: LinkPreviewOptions? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = SendTextMessage( ) = SendTextMessage(
@@ -68,12 +74,14 @@ fun SendTextMessage(
parseMode = null, parseMode = null,
rawEntities = entities.toRawMessageEntities(), rawEntities = entities.toRawMessageEntities(),
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
linkPreviewOptions = linkPreviewOptions, linkPreviewOptions = linkPreviewOptions,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -93,6 +101,10 @@ data class SendTextMessage internal constructor(
@SerialName(messageThreadIdField) @SerialName(messageThreadIdField)
@EncodeDefault @EncodeDefault
override val threadId: MessageThreadId? = chatId.threadId, override val threadId: MessageThreadId? = chatId.threadId,
@OptIn(ExperimentalSerializationApi::class)
@EncodeDefault
@SerialName(directMessagesTopicIdField)
override val directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
@SerialName(businessConnectionIdField) @SerialName(businessConnectionIdField)
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
@SerialName(linkPreviewOptionsField) @SerialName(linkPreviewOptionsField)
@@ -105,6 +117,8 @@ data class SendTextMessage internal constructor(
override val allowPaidBroadcast: Boolean = false, override val allowPaidBroadcast: Boolean = false,
@SerialName(messageEffectIdField) @SerialName(messageEffectIdField)
override val effectId: EffectId? = null, override val effectId: EffectId? = null,
@SerialName(suggestedPostParametersField)
override val suggestedPostParameters: SuggestedPostParameters? = null,
@SerialName(replyParametersField) @SerialName(replyParametersField)
override val replyParameters: ReplyParameters? = null, override val replyParameters: ReplyParameters? = null,
@SerialName(replyMarkupField) @SerialName(replyMarkupField)

View File

@@ -0,0 +1,85 @@
package dev.inmo.tgbotapi.requests.send
import dev.inmo.tgbotapi.abstracts.TextedOutput
import dev.inmo.tgbotapi.requests.send.abstracts.*
import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
import dev.inmo.tgbotapi.types.message.ParseMode
import dev.inmo.tgbotapi.types.message.parseModeField
import dev.inmo.tgbotapi.types.message.*
import dev.inmo.tgbotapi.types.message.RawMessageEntity
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass
import dev.inmo.tgbotapi.types.message.content.TextContent
import dev.inmo.tgbotapi.types.message.toRawMessageEntities
import dev.inmo.tgbotapi.utils.extensions.makeString
import dev.inmo.tgbotapi.utils.throwRangeError
import kotlinx.serialization.*
import kotlinx.serialization.builtins.serializer
fun SendMessageDraft(
chatId: IdChatIdentifier,
draftId: DraftId,
text: String,
parseMode: ParseMode? = null,
threadId: MessageThreadId? = chatId.threadId
) = SendMessageDraft(
chatId = chatId,
draftId = draftId,
text = text,
parseMode = parseMode,
rawEntities = null,
threadId = threadId
)
fun SendMessageDraft(
chatId: IdChatIdentifier,
draftId: DraftId,
entities: TextSourcesList,
threadId: MessageThreadId? = chatId.threadId
) = SendMessageDraft(
chatId = chatId,
draftId = draftId,
text = entities.makeString(),
parseMode = null,
rawEntities = entities.toRawMessageEntities(),
threadId = threadId
)
@ConsistentCopyVisibility
@Serializable
data class SendMessageDraft internal constructor(
@SerialName(chatIdField)
override val chatId: IdChatIdentifier,
@SerialName(draftIdField)
val draftId: DraftId,
@SerialName(textField)
override val text: String,
@SerialName(parseModeField)
override val parseMode: ParseMode? = null,
@SerialName(entitiesField)
private val rawEntities: List<RawMessageEntity>? = null,
@OptIn(ExperimentalSerializationApi::class)
@SerialName(messageThreadIdField)
@EncodeDefault
override val threadId: MessageThreadId? = chatId.threadId
) : SendChatMessageRequest<Boolean>,
TextedOutput,
OptionallyMessageThreadRequest
{
override val textSources: TextSourcesList? by lazy {
rawEntities ?.asTextSources(text)
}
init {
if (text.length !in textLength) {
throwRangeError("Text length", textLength, text.length)
}
}
override fun method(): String = "sendMessageDraft"
override val resultDeserializer: DeserializationStrategy<Boolean>
get() = Boolean.serializer()
override val requestSerializer: SerializationStrategy<*>
get() = serializer()
}

View File

@@ -4,6 +4,7 @@ import dev.inmo.tgbotapi.requests.send.abstracts.*
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
import dev.inmo.tgbotapi.types.message.SuggestedPostParameters
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass
import dev.inmo.tgbotapi.types.message.content.VenueContent import dev.inmo.tgbotapi.types.message.content.VenueContent
@@ -37,6 +38,10 @@ data class SendVenue(
@SerialName(messageThreadIdField) @SerialName(messageThreadIdField)
@EncodeDefault @EncodeDefault
override val threadId: MessageThreadId? = chatId.threadId, override val threadId: MessageThreadId? = chatId.threadId,
@OptIn(ExperimentalSerializationApi::class)
@EncodeDefault
@SerialName(directMessagesTopicIdField)
override val directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
@SerialName(businessConnectionIdField) @SerialName(businessConnectionIdField)
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
@SerialName(disableNotificationField) @SerialName(disableNotificationField)
@@ -47,6 +52,8 @@ data class SendVenue(
override val allowPaidBroadcast: Boolean = false, override val allowPaidBroadcast: Boolean = false,
@SerialName(messageEffectIdField) @SerialName(messageEffectIdField)
override val effectId: EffectId? = null, override val effectId: EffectId? = null,
@SerialName(suggestedPostParametersField)
override val suggestedPostParameters: SuggestedPostParameters? = null,
@SerialName(replyParametersField) @SerialName(replyParametersField)
override val replyParameters: ReplyParameters? = null, override val replyParameters: ReplyParameters? = null,
@SerialName(replyMarkupField) @SerialName(replyMarkupField)
@@ -60,11 +67,13 @@ data class SendVenue(
chatId: ChatIdentifier, chatId: ChatIdentifier,
venue: Venue, venue: Venue,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): this( ): this(
@@ -78,11 +87,13 @@ data class SendVenue(
googlePlaceId = venue.googlePlaceId, googlePlaceId = venue.googlePlaceId,
googlePlaceType = venue.googlePlaceType, googlePlaceType = venue.googlePlaceType,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -97,22 +108,26 @@ data class SendVenue(
fun Venue.toRequest( fun Venue.toRequest(
chatId: ChatIdentifier, chatId: ChatIdentifier,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): SendVenue = SendVenue( ): SendVenue = SendVenue(
chatId = chatId, chatId = chatId,
venue = this, venue = this,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )

View File

@@ -0,0 +1,7 @@
package dev.inmo.tgbotapi.requests.send.abstracts
import dev.inmo.tgbotapi.types.DirectMessageThreadId
interface OptionallyDirectMessageThreadRequest {
val directMessageThreadId: DirectMessageThreadId?
}

View File

@@ -0,0 +1,7 @@
package dev.inmo.tgbotapi.requests.send.abstracts
import dev.inmo.tgbotapi.types.message.SuggestedPostParameters
interface OptionallySuggestedPostRequest {
val suggestedPostParameters: SuggestedPostParameters?
}

View File

@@ -7,4 +7,6 @@ interface SendMessageRequest<T: Any> : SendChatMessageRequest<T>,
DisableNotification, DisableNotification,
ProtectContent, ProtectContent,
AllowPaidBroadcast, AllowPaidBroadcast,
OptionallyMessageThreadRequest OptionallyMessageThreadRequest,
OptionallyDirectMessageThreadRequest,
OptionallySuggestedPostRequest

View File

@@ -6,6 +6,7 @@ import dev.inmo.tgbotapi.requests.send.abstracts.SendMessageRequest
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
import dev.inmo.tgbotapi.types.message.SuggestedPostParameters
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass
import dev.inmo.tgbotapi.types.message.content.GameContent import dev.inmo.tgbotapi.types.message.content.GameContent
@@ -24,6 +25,10 @@ data class SendGame (
@SerialName(messageThreadIdField) @SerialName(messageThreadIdField)
@EncodeDefault @EncodeDefault
override val threadId: MessageThreadId? = chatId.threadId, override val threadId: MessageThreadId? = chatId.threadId,
@OptIn(ExperimentalSerializationApi::class)
@EncodeDefault
@SerialName(directMessagesTopicIdField)
override val directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
@SerialName(businessConnectionIdField) @SerialName(businessConnectionIdField)
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
@SerialName(disableNotificationField) @SerialName(disableNotificationField)
@@ -34,6 +39,8 @@ data class SendGame (
override val allowPaidBroadcast: Boolean = false, override val allowPaidBroadcast: Boolean = false,
@SerialName(messageEffectIdField) @SerialName(messageEffectIdField)
override val effectId: EffectId? = null, override val effectId: EffectId? = null,
@SerialName(suggestedPostParametersField)
override val suggestedPostParameters: SuggestedPostParameters? = null,
@SerialName(replyParametersField) @SerialName(replyParametersField)
override val replyParameters: ReplyParameters? = null, override val replyParameters: ReplyParameters? = null,
@SerialName(replyMarkupField) @SerialName(replyMarkupField)

View File

@@ -35,11 +35,13 @@ fun SendAnimation(
width: Int? = null, width: Int? = null,
height: Int? = null, height: Int? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): Request<ContentMessage<AnimationContent>> { ): Request<ContentMessage<AnimationContent>> {
@@ -59,11 +61,13 @@ fun SendAnimation(
width = width, width = width,
height = height, height = height,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -89,11 +93,13 @@ fun SendAnimation(
width: Int? = null, width: Int? = null,
height: Int? = null, height: Int? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): Request<ContentMessage<AnimationContent>> { ): Request<ContentMessage<AnimationContent>> {
@@ -113,11 +119,13 @@ fun SendAnimation(
width = width, width = width,
height = height, height = height,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -164,6 +172,10 @@ data class SendAnimationData internal constructor(
@SerialName(messageThreadIdField) @SerialName(messageThreadIdField)
@EncodeDefault @EncodeDefault
override val threadId: MessageThreadId? = chatId.threadId, override val threadId: MessageThreadId? = chatId.threadId,
@OptIn(ExperimentalSerializationApi::class)
@EncodeDefault
@SerialName(directMessagesTopicIdField)
override val directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
@SerialName(businessConnectionIdField) @SerialName(businessConnectionIdField)
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
@SerialName(disableNotificationField) @SerialName(disableNotificationField)
@@ -174,6 +186,8 @@ data class SendAnimationData internal constructor(
override val allowPaidBroadcast: Boolean = false, override val allowPaidBroadcast: Boolean = false,
@SerialName(messageEffectIdField) @SerialName(messageEffectIdField)
override val effectId: EffectId? = null, override val effectId: EffectId? = null,
@SerialName(suggestedPostParametersField)
override val suggestedPostParameters: SuggestedPostParameters? = null,
@SerialName(replyParametersField) @SerialName(replyParametersField)
override val replyParameters: ReplyParameters? = null, override val replyParameters: ReplyParameters? = null,
@SerialName(replyMarkupField) @SerialName(replyMarkupField)

View File

@@ -34,11 +34,13 @@ fun SendAudio(
performer: String? = null, performer: String? = null,
title: String? = null, title: String? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): Request<ContentMessage<AudioContent>> { ): Request<ContentMessage<AudioContent>> {
@@ -56,11 +58,13 @@ fun SendAudio(
performer = performer, performer = performer,
title = title, title = title,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -84,11 +88,13 @@ fun SendAudio(
performer: String? = null, performer: String? = null,
title: String? = null, title: String? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): Request<ContentMessage<AudioContent>> { ): Request<ContentMessage<AudioContent>> {
@@ -106,11 +112,13 @@ fun SendAudio(
performer = performer, performer = performer,
title = title, title = title,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -153,6 +161,10 @@ data class SendAudioData internal constructor(
@SerialName(messageThreadIdField) @SerialName(messageThreadIdField)
@EncodeDefault @EncodeDefault
override val threadId: MessageThreadId? = chatId.threadId, override val threadId: MessageThreadId? = chatId.threadId,
@OptIn(ExperimentalSerializationApi::class)
@EncodeDefault
@SerialName(directMessagesTopicIdField)
override val directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
@SerialName(businessConnectionIdField) @SerialName(businessConnectionIdField)
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
@SerialName(disableNotificationField) @SerialName(disableNotificationField)
@@ -163,6 +175,8 @@ data class SendAudioData internal constructor(
override val allowPaidBroadcast: Boolean = false, override val allowPaidBroadcast: Boolean = false,
@SerialName(messageEffectIdField) @SerialName(messageEffectIdField)
override val effectId: EffectId? = null, override val effectId: EffectId? = null,
@SerialName(suggestedPostParametersField)
override val suggestedPostParameters: SuggestedPostParameters? = null,
@SerialName(replyParametersField) @SerialName(replyParametersField)
override val replyParameters: ReplyParameters? = null, override val replyParameters: ReplyParameters? = null,
@SerialName(replyMarkupField) @SerialName(replyMarkupField)

View File

@@ -39,11 +39,13 @@ fun SendDocument(
text: String? = null, text: String? = null,
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null, replyMarkup: KeyboardMarkup? = null,
disableContentTypeDetection: Boolean? = null disableContentTypeDetection: Boolean? = null
@@ -59,11 +61,13 @@ fun SendDocument(
parseMode = parseMode, parseMode = parseMode,
rawEntities = null, rawEntities = null,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup, replyMarkup = replyMarkup,
disableContentTypeDetection = disableContentTypeDetection disableContentTypeDetection = disableContentTypeDetection
@@ -94,11 +98,13 @@ fun SendDocument(
thumbnail: InputFile? = null, thumbnail: InputFile? = null,
entities: TextSourcesList, entities: TextSourcesList,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null, replyMarkup: KeyboardMarkup? = null,
disableContentTypeDetection: Boolean? = null disableContentTypeDetection: Boolean? = null
@@ -114,11 +120,13 @@ fun SendDocument(
parseMode = null, parseMode = null,
rawEntities = entities.toRawMessageEntities(), rawEntities = entities.toRawMessageEntities(),
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup, replyMarkup = replyMarkup,
disableContentTypeDetection = disableContentTypeDetection disableContentTypeDetection = disableContentTypeDetection
@@ -165,6 +173,10 @@ data class SendDocumentData internal constructor(
@SerialName(messageThreadIdField) @SerialName(messageThreadIdField)
@EncodeDefault @EncodeDefault
override val threadId: MessageThreadId? = chatId.threadId, override val threadId: MessageThreadId? = chatId.threadId,
@OptIn(ExperimentalSerializationApi::class)
@EncodeDefault
@SerialName(directMessagesTopicIdField)
override val directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
@SerialName(businessConnectionIdField) @SerialName(businessConnectionIdField)
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
@SerialName(disableNotificationField) @SerialName(disableNotificationField)
@@ -175,6 +187,8 @@ data class SendDocumentData internal constructor(
override val allowPaidBroadcast: Boolean = false, override val allowPaidBroadcast: Boolean = false,
@SerialName(messageEffectIdField) @SerialName(messageEffectIdField)
override val effectId: EffectId? = null, override val effectId: EffectId? = null,
@SerialName(suggestedPostParametersField)
override val suggestedPostParameters: SuggestedPostParameters? = null,
@SerialName(replyParametersField) @SerialName(replyParametersField)
override val replyParameters: ReplyParameters? = null, override val replyParameters: ReplyParameters? = null,
@SerialName(replyMarkupField) @SerialName(replyMarkupField)

View File

@@ -10,6 +10,7 @@ import dev.inmo.tgbotapi.requests.send.media.base.*
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.media.* import dev.inmo.tgbotapi.types.media.*
import dev.inmo.tgbotapi.types.message.SuggestedPostParameters
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
import dev.inmo.tgbotapi.types.message.abstracts.PossiblySentViaBotCommonMessage import dev.inmo.tgbotapi.types.message.abstracts.PossiblySentViaBotCommonMessage
import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializeOnlySerializerClass import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializeOnlySerializerClass
@@ -35,11 +36,13 @@ fun <T : MediaGroupPartContent> SendMediaGroup(
chatId: ChatIdentifier, chatId: ChatIdentifier,
media: List<MediaGroupMemberTelegramMedia>, media: List<MediaGroupMemberTelegramMedia>,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null replyParameters: ReplyParameters? = null
): Request<ContentMessage<MediaGroupContent<T>>> { ): Request<ContentMessage<MediaGroupContent<T>>> {
if (media.size !in mediaCountInMediaGroup) { if (media.size !in mediaCountInMediaGroup) {
@@ -66,11 +69,13 @@ fun <T : MediaGroupPartContent> SendMediaGroup(
chatId = chatId, chatId = chatId,
media = media, media = media,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters replyParameters = replyParameters
) )
@@ -95,21 +100,25 @@ inline fun SendPlaylist(
chatId: ChatIdentifier, chatId: ChatIdentifier,
media: List<AudioMediaGroupMemberTelegramMedia>, media: List<AudioMediaGroupMemberTelegramMedia>,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null replyParameters: ReplyParameters? = null
) = SendMediaGroup<AudioContent>( ) = SendMediaGroup<AudioContent>(
chatId = chatId, chatId = chatId,
media = media, media = media,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters replyParameters = replyParameters
) )
@@ -123,21 +132,25 @@ inline fun SendDocumentsGroup(
chatId: ChatIdentifier, chatId: ChatIdentifier,
media: List<DocumentMediaGroupMemberTelegramMedia>, media: List<DocumentMediaGroupMemberTelegramMedia>,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null replyParameters: ReplyParameters? = null
) = SendMediaGroup<DocumentContent>( ) = SendMediaGroup<DocumentContent>(
chatId = chatId, chatId = chatId,
media = media, media = media,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters replyParameters = replyParameters
) )
@@ -152,21 +165,25 @@ inline fun SendVisualMediaGroup(
chatId: ChatIdentifier, chatId: ChatIdentifier,
media: List<VisualMediaGroupMemberTelegramMedia>, media: List<VisualMediaGroupMemberTelegramMedia>,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
) = SendMediaGroup<VisualMediaGroupPartContent>( ) = SendMediaGroup<VisualMediaGroupPartContent>(
chatId = chatId, chatId = chatId,
media = media, media = media,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters replyParameters = replyParameters
) )
@@ -195,6 +212,10 @@ data class SendMediaGroupData internal constructor(
@SerialName(messageThreadIdField) @SerialName(messageThreadIdField)
@EncodeDefault @EncodeDefault
override val threadId: MessageThreadId? = chatId.threadId, override val threadId: MessageThreadId? = chatId.threadId,
@OptIn(ExperimentalSerializationApi::class)
@EncodeDefault
@SerialName(directMessagesTopicIdField)
override val directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
@SerialName(businessConnectionIdField) @SerialName(businessConnectionIdField)
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
@SerialName(disableNotificationField) @SerialName(disableNotificationField)
@@ -205,6 +226,8 @@ data class SendMediaGroupData internal constructor(
override val allowPaidBroadcast: Boolean = false, override val allowPaidBroadcast: Boolean = false,
@SerialName(messageEffectIdField) @SerialName(messageEffectIdField)
override val effectId: EffectId? = null, override val effectId: EffectId? = null,
@SerialName(suggestedPostParametersField)
override val suggestedPostParameters: SuggestedPostParameters? = null,
@SerialName(replyParametersField) @SerialName(replyParametersField)
override val replyParameters: ReplyParameters? = null, override val replyParameters: ReplyParameters? = null,
) : DataRequest<PossiblySentViaBotCommonMessage<MediaGroupContent<MediaGroupPartContent>>>, ) : DataRequest<PossiblySentViaBotCommonMessage<MediaGroupContent<MediaGroupPartContent>>>,

View File

@@ -34,10 +34,12 @@ fun SendPaidMedia(
payload: PaidMediaPayload? = null, payload: PaidMediaPayload? = null,
showCaptionAboveMedia: Boolean = false, showCaptionAboveMedia: Boolean = false,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): Request<ContentMessage<PaidMediaInfoContent>> { ): Request<ContentMessage<PaidMediaInfoContent>> {
@@ -51,10 +53,12 @@ fun SendPaidMedia(
rawEntities = null, rawEntities = null,
showCaptionAboveMedia = showCaptionAboveMedia, showCaptionAboveMedia = showCaptionAboveMedia,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -93,10 +97,12 @@ fun SendPaidMedia(
payload: PaidMediaPayload? = null, payload: PaidMediaPayload? = null,
showCaptionAboveMedia: Boolean = false, showCaptionAboveMedia: Boolean = false,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): Request<ContentMessage<PaidMediaInfoContent>> { ): Request<ContentMessage<PaidMediaInfoContent>> {
@@ -110,10 +116,12 @@ fun SendPaidMedia(
rawEntities = entities.toRawMessageEntities(), rawEntities = entities.toRawMessageEntities(),
showCaptionAboveMedia = showCaptionAboveMedia, showCaptionAboveMedia = showCaptionAboveMedia,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -171,6 +179,10 @@ data class SendPaidMediaData internal constructor(
@SerialName(messageThreadIdField) @SerialName(messageThreadIdField)
@EncodeDefault @EncodeDefault
override val threadId: MessageThreadId? = chatId.threadId, override val threadId: MessageThreadId? = chatId.threadId,
@OptIn(ExperimentalSerializationApi::class)
@EncodeDefault
@SerialName(directMessagesTopicIdField)
override val directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
@SerialName(businessConnectionIdField) @SerialName(businessConnectionIdField)
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
@SerialName(disableNotificationField) @SerialName(disableNotificationField)
@@ -179,6 +191,8 @@ data class SendPaidMediaData internal constructor(
override val protectContent: Boolean = false, override val protectContent: Boolean = false,
@SerialName(allowPaidBroadcastField) @SerialName(allowPaidBroadcastField)
override val allowPaidBroadcast: Boolean = false, override val allowPaidBroadcast: Boolean = false,
@SerialName(suggestedPostParametersField)
override val suggestedPostParameters: SuggestedPostParameters? = null,
@SerialName(replyParametersField) @SerialName(replyParametersField)
override val replyParameters: ReplyParameters? = null, override val replyParameters: ReplyParameters? = null,
@SerialName(replyMarkupField) @SerialName(replyMarkupField)

View File

@@ -30,11 +30,13 @@ fun SendPhoto(
showCaptionAboveMedia: Boolean = false, showCaptionAboveMedia: Boolean = false,
spoilered: Boolean = false, spoilered: Boolean = false,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): Request<ContentMessage<PhotoContent>> { ): Request<ContentMessage<PhotoContent>> {
@@ -47,11 +49,13 @@ fun SendPhoto(
showCaptionAboveMedia = showCaptionAboveMedia, showCaptionAboveMedia = showCaptionAboveMedia,
spoilered = spoilered, spoilered = spoilered,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -72,11 +76,13 @@ fun SendPhoto(
showCaptionAboveMedia: Boolean = false, showCaptionAboveMedia: Boolean = false,
spoilered: Boolean = false, spoilered: Boolean = false,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): Request<ContentMessage<PhotoContent>> { ): Request<ContentMessage<PhotoContent>> {
@@ -89,11 +95,13 @@ fun SendPhoto(
showCaptionAboveMedia = showCaptionAboveMedia, showCaptionAboveMedia = showCaptionAboveMedia,
spoilered = spoilered, spoilered = spoilered,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -132,6 +140,10 @@ data class SendPhotoData internal constructor(
@SerialName(messageThreadIdField) @SerialName(messageThreadIdField)
@EncodeDefault @EncodeDefault
override val threadId: MessageThreadId? = chatId.threadId, override val threadId: MessageThreadId? = chatId.threadId,
@OptIn(ExperimentalSerializationApi::class)
@EncodeDefault
@SerialName(directMessagesTopicIdField)
override val directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
@SerialName(businessConnectionIdField) @SerialName(businessConnectionIdField)
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
@SerialName(disableNotificationField) @SerialName(disableNotificationField)
@@ -142,6 +154,8 @@ data class SendPhotoData internal constructor(
override val allowPaidBroadcast: Boolean = false, override val allowPaidBroadcast: Boolean = false,
@SerialName(messageEffectIdField) @SerialName(messageEffectIdField)
override val effectId: EffectId? = null, override val effectId: EffectId? = null,
@SerialName(suggestedPostParametersField)
override val suggestedPostParameters: SuggestedPostParameters? = null,
@SerialName(replyParametersField) @SerialName(replyParametersField)
override val replyParameters: ReplyParameters? = null, override val replyParameters: ReplyParameters? = null,
@SerialName(replyMarkupField) @SerialName(replyMarkupField)

View File

@@ -8,6 +8,7 @@ import dev.inmo.tgbotapi.requests.send.abstracts.SendMessageRequest
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
import dev.inmo.tgbotapi.types.message.SuggestedPostParameters
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass
import dev.inmo.tgbotapi.types.message.content.StickerContent import dev.inmo.tgbotapi.types.message.content.StickerContent
@@ -18,24 +19,28 @@ fun SendSticker(
chatId: ChatIdentifier, chatId: ChatIdentifier,
sticker: InputFile, sticker: InputFile,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
emoji: String? = null, emoji: String? = null,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): Request<ContentMessage<StickerContent>> = SendStickerByFileId( ): Request<ContentMessage<StickerContent>> = SendStickerByFileId(
chatId = chatId, chatId = chatId,
sticker = sticker, sticker = sticker,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
emoji = emoji, emoji = emoji,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
).let { ).let {
@@ -62,6 +67,10 @@ data class SendStickerByFileId internal constructor(
@SerialName(messageThreadIdField) @SerialName(messageThreadIdField)
@EncodeDefault @EncodeDefault
override val threadId: MessageThreadId? = chatId.threadId, override val threadId: MessageThreadId? = chatId.threadId,
@OptIn(ExperimentalSerializationApi::class)
@EncodeDefault
@SerialName(directMessagesTopicIdField)
override val directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
@SerialName(businessConnectionIdField) @SerialName(businessConnectionIdField)
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
@SerialName(emojiField) @SerialName(emojiField)
@@ -74,6 +83,8 @@ data class SendStickerByFileId internal constructor(
override val allowPaidBroadcast: Boolean = false, override val allowPaidBroadcast: Boolean = false,
@SerialName(messageEffectIdField) @SerialName(messageEffectIdField)
override val effectId: EffectId? = null, override val effectId: EffectId? = null,
@SerialName(suggestedPostParametersField)
override val suggestedPostParameters: SuggestedPostParameters? = null,
@SerialName(replyParametersField) @SerialName(replyParametersField)
override val replyParameters: ReplyParameters? = null, override val replyParameters: ReplyParameters? = null,
@SerialName(replyMarkupField) @SerialName(replyMarkupField)

View File

@@ -39,11 +39,13 @@ fun SendVideo(
height: Int? = null, height: Int? = null,
supportStreaming: Boolean? = null, supportStreaming: Boolean? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): Request<ContentMessage<VideoContent>> { ): Request<ContentMessage<VideoContent>> {
@@ -67,11 +69,13 @@ fun SendVideo(
height = height, height = height,
supportStreaming = supportStreaming, supportStreaming = supportStreaming,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -100,11 +104,13 @@ fun SendVideo(
height: Int? = null, height: Int? = null,
supportStreaming: Boolean? = null, supportStreaming: Boolean? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): Request<ContentMessage<VideoContent>> { ): Request<ContentMessage<VideoContent>> {
@@ -128,11 +134,13 @@ fun SendVideo(
height = height, height = height,
supportStreaming = supportStreaming, supportStreaming = supportStreaming,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -185,6 +193,10 @@ data class SendVideoData internal constructor(
@SerialName(messageThreadIdField) @SerialName(messageThreadIdField)
@EncodeDefault @EncodeDefault
override val threadId: MessageThreadId? = chatId.threadId, override val threadId: MessageThreadId? = chatId.threadId,
@OptIn(ExperimentalSerializationApi::class)
@EncodeDefault
@SerialName(directMessagesTopicIdField)
override val directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
@SerialName(businessConnectionIdField) @SerialName(businessConnectionIdField)
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
@SerialName(disableNotificationField) @SerialName(disableNotificationField)
@@ -195,6 +207,8 @@ data class SendVideoData internal constructor(
override val allowPaidBroadcast: Boolean = false, override val allowPaidBroadcast: Boolean = false,
@SerialName(messageEffectIdField) @SerialName(messageEffectIdField)
override val effectId: EffectId? = null, override val effectId: EffectId? = null,
@SerialName(suggestedPostParametersField)
override val suggestedPostParameters: SuggestedPostParameters? = null,
@SerialName(replyParametersField) @SerialName(replyParametersField)
override val replyParameters: ReplyParameters? = null, override val replyParameters: ReplyParameters? = null,
@SerialName(replyMarkupField) @SerialName(replyMarkupField)

View File

@@ -7,6 +7,7 @@ import dev.inmo.tgbotapi.requests.send.media.base.*
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
import dev.inmo.tgbotapi.types.message.SuggestedPostParameters
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass
import dev.inmo.tgbotapi.types.message.content.VideoNoteContent import dev.inmo.tgbotapi.types.message.content.VideoNoteContent
@@ -21,11 +22,13 @@ fun SendVideoNote(
duration: Long? = null, duration: Long? = null,
size: Int? = null, // in documentation - length (size of video side) size: Int? = null, // in documentation - length (size of video side)
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): Request<ContentMessage<VideoNoteContent>> { ): Request<ContentMessage<VideoNoteContent>> {
@@ -39,11 +42,13 @@ fun SendVideoNote(
duration = duration, duration = duration,
width = size, width = size,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -78,6 +83,10 @@ data class SendVideoNoteData internal constructor(
@SerialName(messageThreadIdField) @SerialName(messageThreadIdField)
@EncodeDefault @EncodeDefault
override val threadId: MessageThreadId? = chatId.threadId, override val threadId: MessageThreadId? = chatId.threadId,
@OptIn(ExperimentalSerializationApi::class)
@EncodeDefault
@SerialName(directMessagesTopicIdField)
override val directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
@SerialName(businessConnectionIdField) @SerialName(businessConnectionIdField)
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
@SerialName(disableNotificationField) @SerialName(disableNotificationField)
@@ -88,6 +97,8 @@ data class SendVideoNoteData internal constructor(
override val allowPaidBroadcast: Boolean = false, override val allowPaidBroadcast: Boolean = false,
@SerialName(messageEffectIdField) @SerialName(messageEffectIdField)
override val effectId: EffectId? = null, override val effectId: EffectId? = null,
@SerialName(suggestedPostParametersField)
override val suggestedPostParameters: SuggestedPostParameters? = null,
@SerialName(replyParametersField) @SerialName(replyParametersField)
override val replyParameters: ReplyParameters? = null, override val replyParameters: ReplyParameters? = null,
@SerialName(replyMarkupField) @SerialName(replyMarkupField)

View File

@@ -28,11 +28,13 @@ fun SendVoice(
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
duration: Long? = null, duration: Long? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): Request<ContentMessage<VoiceContent>> { ): Request<ContentMessage<VoiceContent>> {
@@ -46,11 +48,13 @@ fun SendVoice(
rawEntities = null, rawEntities = null,
duration = duration, duration = duration,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -70,12 +74,14 @@ fun SendVoice(
voice: InputFile, voice: InputFile,
entities: TextSourcesList, entities: TextSourcesList,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
duration: Long? = null, duration: Long? = null,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): Request<ContentMessage<VoiceContent>> { ): Request<ContentMessage<VoiceContent>> {
@@ -89,11 +95,13 @@ fun SendVoice(
rawEntities = entities.toRawMessageEntities(), rawEntities = entities.toRawMessageEntities(),
duration = duration, duration = duration,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -130,6 +138,10 @@ data class SendVoiceData internal constructor(
@SerialName(messageThreadIdField) @SerialName(messageThreadIdField)
@EncodeDefault @EncodeDefault
override val threadId: MessageThreadId? = chatId.threadId, override val threadId: MessageThreadId? = chatId.threadId,
@OptIn(ExperimentalSerializationApi::class)
@EncodeDefault
@SerialName(directMessagesTopicIdField)
override val directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
@SerialName(businessConnectionIdField) @SerialName(businessConnectionIdField)
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
@SerialName(disableNotificationField) @SerialName(disableNotificationField)
@@ -140,6 +152,8 @@ data class SendVoiceData internal constructor(
override val allowPaidBroadcast: Boolean = false, override val allowPaidBroadcast: Boolean = false,
@SerialName(messageEffectIdField) @SerialName(messageEffectIdField)
override val effectId: EffectId? = null, override val effectId: EffectId? = null,
@SerialName(suggestedPostParametersField)
override val suggestedPostParameters: SuggestedPostParameters? = null,
@SerialName(replyParametersField) @SerialName(replyParametersField)
override val replyParameters: ReplyParameters? = null, override val replyParameters: ReplyParameters? = null,
@SerialName(replyMarkupField) @SerialName(replyMarkupField)

View File

@@ -6,6 +6,7 @@ import dev.inmo.tgbotapi.requests.send.abstracts.OptionallyWithEffectRequest
import dev.inmo.tgbotapi.requests.send.abstracts.SendMessageRequest import dev.inmo.tgbotapi.requests.send.abstracts.SendMessageRequest
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
import dev.inmo.tgbotapi.types.message.SuggestedPostParameters
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass
import dev.inmo.tgbotapi.types.message.content.InvoiceContent import dev.inmo.tgbotapi.types.message.content.InvoiceContent
@@ -66,6 +67,10 @@ data class SendInvoice(
@SerialName(messageThreadIdField) @SerialName(messageThreadIdField)
@EncodeDefault @EncodeDefault
override val threadId: MessageThreadId? = chatId.threadId, override val threadId: MessageThreadId? = chatId.threadId,
@OptIn(ExperimentalSerializationApi::class)
@EncodeDefault
@SerialName(directMessagesTopicIdField)
override val directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
@SerialName(disableNotificationField) @SerialName(disableNotificationField)
override val disableNotification: Boolean = false, override val disableNotification: Boolean = false,
@SerialName(protectContentField) @SerialName(protectContentField)
@@ -74,6 +79,8 @@ data class SendInvoice(
override val allowPaidBroadcast: Boolean = false, override val allowPaidBroadcast: Boolean = false,
@SerialName(messageEffectIdField) @SerialName(messageEffectIdField)
override val effectId: EffectId? = null, override val effectId: EffectId? = null,
@SerialName(suggestedPostParametersField)
override val suggestedPostParameters: SuggestedPostParameters? = null,
@SerialName(replyParametersField) @SerialName(replyParametersField)
override val replyParameters: ReplyParameters? = null, override val replyParameters: ReplyParameters? = null,
@SerialName(replyMarkupField) @SerialName(replyMarkupField)
@@ -114,10 +121,12 @@ data class SendInvoice(
startParameter: StartParameter? = null, startParameter: StartParameter? = null,
providerData: String? = null, providerData: String? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: InlineKeyboardMarkup? = null replyMarkup: InlineKeyboardMarkup? = null
) : this( ) : this(
@@ -131,10 +140,12 @@ data class SendInvoice(
startParameter = startParameter, startParameter = startParameter,
providerData = providerData, providerData = providerData,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )

View File

@@ -7,6 +7,7 @@ import dev.inmo.tgbotapi.requests.send.abstracts.SendContentMessageRequest
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.message.ParseMode import dev.inmo.tgbotapi.types.message.ParseMode
import dev.inmo.tgbotapi.types.message.SuggestedPostParameters
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass
@@ -49,24 +50,30 @@ fun SendPoll(
isAnonymous: Boolean = true, isAnonymous: Boolean = true,
isClosed: Boolean = false, isClosed: Boolean = false,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = SendRegularPoll( ) = SendRegularPoll(
chatId, chatId,
question, question,
options, options,
null,
questionParseMode, questionParseMode,
isAnonymous, isAnonymous,
isClosed, isClosed,
false,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
disableNotification = disableNotification, disableNotification = disableNotification,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -78,23 +85,30 @@ fun SendPoll(
isAnonymous: Boolean = true, isAnonymous: Boolean = true,
isClosed: Boolean = false, isClosed: Boolean = false,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = SendRegularPoll( ) = SendRegularPoll(
chatId = chatId, chatId = chatId,
questionEntities = textSources, questionTextSources = textSources,
options = options, options = options,
closeInfo = null,
isAnonymous = isAnonymous, isAnonymous = isAnonymous,
isClosed = isClosed, isClosed = isClosed,
allowMultipleAnswers = false,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
disableNotification = disableNotification, effectId = null,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -106,11 +120,13 @@ fun SendPoll(
fun Poll.createRequest( fun Poll.createRequest(
chatId: ChatIdentifier, chatId: ChatIdentifier,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = when (this) { ) = when (this) {
@@ -123,11 +139,13 @@ fun Poll.createRequest(
isClosed = isClosed, isClosed = isClosed,
allowMultipleAnswers = allowMultipleAnswers, allowMultipleAnswers = allowMultipleAnswers,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -142,11 +160,13 @@ fun Poll.createRequest(
isAnonymous = isAnonymous, isAnonymous = isAnonymous,
isClosed = isClosed, isClosed = isClosed,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -159,11 +179,13 @@ fun Poll.createRequest(
isClosed = isClosed, isClosed = isClosed,
allowMultipleAnswers = false, allowMultipleAnswers = false,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -176,11 +198,13 @@ fun Poll.createRequest(
isClosed = isClosed, isClosed = isClosed,
allowMultipleAnswers = false, allowMultipleAnswers = false,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )

View File

@@ -5,6 +5,7 @@ import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
import dev.inmo.tgbotapi.types.message.ParseMode import dev.inmo.tgbotapi.types.message.ParseMode
import dev.inmo.tgbotapi.types.message.RawMessageEntity import dev.inmo.tgbotapi.types.message.RawMessageEntity
import dev.inmo.tgbotapi.types.message.SuggestedPostParameters
import dev.inmo.tgbotapi.types.message.asTextSources import dev.inmo.tgbotapi.types.message.asTextSources
import dev.inmo.tgbotapi.types.message.textsources.TextSource import dev.inmo.tgbotapi.types.message.textsources.TextSource
import dev.inmo.tgbotapi.types.message.toRawMessageEntities import dev.inmo.tgbotapi.types.message.toRawMessageEntities
@@ -52,6 +53,10 @@ class SendQuizPoll internal constructor(
@SerialName(messageThreadIdField) @SerialName(messageThreadIdField)
@EncodeDefault @EncodeDefault
override val threadId: MessageThreadId? = chatId.threadId, override val threadId: MessageThreadId? = chatId.threadId,
@OptIn(ExperimentalSerializationApi::class)
@EncodeDefault
@SerialName(directMessagesTopicIdField)
override val directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
@SerialName(businessConnectionIdField) @SerialName(businessConnectionIdField)
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
@SerialName(disableNotificationField) @SerialName(disableNotificationField)
@@ -62,6 +67,8 @@ class SendQuizPoll internal constructor(
override val allowPaidBroadcast: Boolean = false, override val allowPaidBroadcast: Boolean = false,
@SerialName(messageEffectIdField) @SerialName(messageEffectIdField)
override val effectId: EffectId? = null, override val effectId: EffectId? = null,
@SerialName(suggestedPostParametersField)
override val suggestedPostParameters: SuggestedPostParameters? = null,
@SerialName(replyParametersField) @SerialName(replyParametersField)
override val replyParameters: ReplyParameters? = null, override val replyParameters: ReplyParameters? = null,
@SerialName(replyMarkupField) @SerialName(replyMarkupField)
@@ -89,11 +96,13 @@ class SendQuizPoll internal constructor(
openPeriod: LongSeconds? = null, openPeriod: LongSeconds? = null,
closeDate: LongSeconds? = null, closeDate: LongSeconds? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) : this( ) : this(
@@ -111,11 +120,13 @@ class SendQuizPoll internal constructor(
openPeriod = openPeriod, openPeriod = openPeriod,
closeDate = closeDate, closeDate = closeDate,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -132,11 +143,13 @@ class SendQuizPoll internal constructor(
openPeriod: LongSeconds? = null, openPeriod: LongSeconds? = null,
closeDate: LongSeconds? = null, closeDate: LongSeconds? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) : this( ) : this(
@@ -154,11 +167,13 @@ class SendQuizPoll internal constructor(
openPeriod = openPeriod, openPeriod = openPeriod,
closeDate = closeDate, closeDate = closeDate,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -175,11 +190,13 @@ class SendQuizPoll internal constructor(
openPeriod: LongSeconds? = null, openPeriod: LongSeconds? = null,
closeDate: LongSeconds? = null, closeDate: LongSeconds? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) : this( ) : this(
@@ -197,11 +214,13 @@ class SendQuizPoll internal constructor(
openPeriod = openPeriod, openPeriod = openPeriod,
closeDate = closeDate, closeDate = closeDate,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -217,11 +236,13 @@ class SendQuizPoll internal constructor(
openPeriod: LongSeconds? = null, openPeriod: LongSeconds? = null,
closeDate: LongSeconds? = null, closeDate: LongSeconds? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) : this( ) : this(
@@ -239,11 +260,13 @@ class SendQuizPoll internal constructor(
openPeriod = openPeriod, openPeriod = openPeriod,
closeDate = closeDate, closeDate = closeDate,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -275,11 +298,13 @@ fun SendQuizPoll(
isAnonymous: Boolean = true, isAnonymous: Boolean = true,
isClosed: Boolean = false, isClosed: Boolean = false,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = SendQuizPoll( ) = SendQuizPoll(
@@ -295,11 +320,13 @@ fun SendQuizPoll(
openPeriod = (closeInfo as? ApproximateScheduledCloseInfo)?.openPeriod, openPeriod = (closeInfo as? ApproximateScheduledCloseInfo)?.openPeriod,
closeDate = (closeInfo as? ExactScheduledCloseInfo)?.closeDate, closeDate = (closeInfo as? ExactScheduledCloseInfo)?.closeDate,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -315,11 +342,13 @@ fun SendQuizPoll(
isAnonymous: Boolean = true, isAnonymous: Boolean = true,
isClosed: Boolean = false, isClosed: Boolean = false,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = SendQuizPoll( ) = SendQuizPoll(
@@ -334,11 +363,13 @@ fun SendQuizPoll(
openPeriod = (closeInfo as? ApproximateScheduledCloseInfo)?.openPeriod, openPeriod = (closeInfo as? ApproximateScheduledCloseInfo)?.openPeriod,
closeDate = (closeInfo as? ExactScheduledCloseInfo)?.closeDate, closeDate = (closeInfo as? ExactScheduledCloseInfo)?.closeDate,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -354,11 +385,13 @@ fun SendQuizPoll(
isAnonymous: Boolean = true, isAnonymous: Boolean = true,
isClosed: Boolean = false, isClosed: Boolean = false,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = SendQuizPoll( ) = SendQuizPoll(
@@ -373,11 +406,13 @@ fun SendQuizPoll(
openPeriod = (closeInfo as? ApproximateScheduledCloseInfo)?.openPeriod, openPeriod = (closeInfo as? ApproximateScheduledCloseInfo)?.openPeriod,
closeDate = (closeInfo as? ExactScheduledCloseInfo)?.closeDate, closeDate = (closeInfo as? ExactScheduledCloseInfo)?.closeDate,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -392,11 +427,13 @@ fun SendQuizPoll(
isAnonymous: Boolean = true, isAnonymous: Boolean = true,
isClosed: Boolean = false, isClosed: Boolean = false,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = SendQuizPoll( ) = SendQuizPoll(
@@ -410,11 +447,13 @@ fun SendQuizPoll(
openPeriod = (closeInfo as? ApproximateScheduledCloseInfo)?.openPeriod, openPeriod = (closeInfo as? ApproximateScheduledCloseInfo)?.openPeriod,
closeDate = (closeInfo as? ExactScheduledCloseInfo)?.closeDate, closeDate = (closeInfo as? ExactScheduledCloseInfo)?.closeDate,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )

View File

@@ -5,6 +5,7 @@ import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
import dev.inmo.tgbotapi.types.message.ParseMode import dev.inmo.tgbotapi.types.message.ParseMode
import dev.inmo.tgbotapi.types.message.RawMessageEntity import dev.inmo.tgbotapi.types.message.RawMessageEntity
import dev.inmo.tgbotapi.types.message.SuggestedPostParameters
import dev.inmo.tgbotapi.types.message.asTextSources import dev.inmo.tgbotapi.types.message.asTextSources
import dev.inmo.tgbotapi.types.message.textsources.TextSource import dev.inmo.tgbotapi.types.message.textsources.TextSource
import dev.inmo.tgbotapi.types.message.toRawMessageEntities import dev.inmo.tgbotapi.types.message.toRawMessageEntities
@@ -22,7 +23,7 @@ import kotlinx.serialization.Serializable
import kotlinx.serialization.SerializationStrategy import kotlinx.serialization.SerializationStrategy
@Serializable @Serializable
class SendRegularPoll private constructor( class SendRegularPoll constructor(
@SerialName(chatIdField) @SerialName(chatIdField)
override val chatId: ChatIdentifier, override val chatId: ChatIdentifier,
@SerialName(questionField) @SerialName(questionField)
@@ -47,6 +48,10 @@ class SendRegularPoll private constructor(
@SerialName(messageThreadIdField) @SerialName(messageThreadIdField)
@EncodeDefault @EncodeDefault
override val threadId: MessageThreadId? = chatId.threadId, override val threadId: MessageThreadId? = chatId.threadId,
@OptIn(ExperimentalSerializationApi::class)
@EncodeDefault
@SerialName(directMessagesTopicIdField)
override val directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
@SerialName(businessConnectionIdField) @SerialName(businessConnectionIdField)
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
@SerialName(disableNotificationField) @SerialName(disableNotificationField)
@@ -57,6 +62,8 @@ class SendRegularPoll private constructor(
override val allowPaidBroadcast: Boolean = false, override val allowPaidBroadcast: Boolean = false,
@SerialName(messageEffectIdField) @SerialName(messageEffectIdField)
override val effectId: EffectId? = null, override val effectId: EffectId? = null,
@SerialName(suggestedPostParametersField)
override val suggestedPostParameters: SuggestedPostParameters? = null,
@SerialName(replyParametersField) @SerialName(replyParametersField)
override val replyParameters: ReplyParameters? = null, override val replyParameters: ReplyParameters? = null,
@SerialName(replyMarkupField) @SerialName(replyMarkupField)
@@ -75,11 +82,13 @@ class SendRegularPoll private constructor(
openPeriod: LongSeconds?= null, openPeriod: LongSeconds?= null,
closeDate: LongSeconds? = null, closeDate: LongSeconds? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) : this( ) : this(
@@ -94,11 +103,13 @@ class SendRegularPoll private constructor(
openPeriod = openPeriod, openPeriod = openPeriod,
closeDate = closeDate, closeDate = closeDate,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -114,11 +125,13 @@ class SendRegularPoll private constructor(
openPeriod: LongSeconds?= null, openPeriod: LongSeconds?= null,
closeDate: LongSeconds? = null, closeDate: LongSeconds? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) : this( ) : this(
@@ -133,11 +146,13 @@ class SendRegularPoll private constructor(
openPeriod = openPeriod, openPeriod = openPeriod,
closeDate = closeDate, closeDate = closeDate,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -162,11 +177,13 @@ fun SendRegularPoll(
isClosed: Boolean = false, isClosed: Boolean = false,
allowMultipleAnswers: Boolean = false, allowMultipleAnswers: Boolean = false,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = SendRegularPoll( ) = SendRegularPoll(
@@ -180,11 +197,13 @@ fun SendRegularPoll(
openPeriod = (closeInfo as? ApproximateScheduledCloseInfo) ?.openPeriod, openPeriod = (closeInfo as? ApproximateScheduledCloseInfo) ?.openPeriod,
closeDate = (closeInfo as? ExactScheduledCloseInfo) ?.closeDate, closeDate = (closeInfo as? ExactScheduledCloseInfo) ?.closeDate,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -198,11 +217,13 @@ fun SendRegularPoll(
isClosed: Boolean = false, isClosed: Boolean = false,
allowMultipleAnswers: Boolean = false, allowMultipleAnswers: Boolean = false,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = SendRegularPoll( ) = SendRegularPoll(
@@ -215,11 +236,13 @@ fun SendRegularPoll(
openPeriod = (closeInfo as? ApproximateScheduledCloseInfo) ?.openPeriod, openPeriod = (closeInfo as? ApproximateScheduledCloseInfo) ?.openPeriod,
closeDate = (closeInfo as? ExactScheduledCloseInfo) ?.closeDate, closeDate = (closeInfo as? ExactScheduledCloseInfo) ?.closeDate,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -232,11 +255,13 @@ fun SendRegularPoll(
isClosed: Boolean = false, isClosed: Boolean = false,
allowMultipleAnswers: Boolean = false, allowMultipleAnswers: Boolean = false,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false, allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null, effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null, replyMarkup: KeyboardMarkup? = null,
builder: EntitiesBuilderBody builder: EntitiesBuilderBody
@@ -249,11 +274,13 @@ fun SendRegularPoll(
isClosed = isClosed, isClosed = isClosed,
allowMultipleAnswers = allowMultipleAnswers, allowMultipleAnswers = allowMultipleAnswers,
threadId = threadId, threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast, allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId, effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )

View File

@@ -0,0 +1,34 @@
package dev.inmo.tgbotapi.requests.stories
import dev.inmo.tgbotapi.abstracts.types.WithBusinessConnectionId
import dev.inmo.tgbotapi.requests.abstracts.SimpleRequest
import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.stories.Story
import kotlinx.serialization.DeserializationStrategy
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
import kotlinx.serialization.SerializationStrategy
@Serializable
data class RepostStory(
@SerialName(businessConnectionIdField)
override val businessConnectionId: BusinessConnectionId,
@SerialName(fromChatIdField)
val fromChatId: IdChatIdentifier,
@SerialName(fromStoryIdField)
val storyId: StoryId,
@SerialName(activePeriodField)
val activePeriod: Seconds,
@SerialName(postToChatPageField)
val postToChatPage: Boolean = false,
@SerialName(protectContentField)
val protectContent: Boolean = false,
) : SimpleRequest<Story>, WithBusinessConnectionId {
override fun method(): String = "repostStory"
override val requestSerializer: SerializationStrategy<*>
get() = serializer()
override val resultDeserializer: DeserializationStrategy<Story>
get() = Story.serializer()
}

View File

@@ -0,0 +1,36 @@
package dev.inmo.tgbotapi.requests.suggested
import dev.inmo.tgbotapi.abstracts.types.ChatRequest
import dev.inmo.tgbotapi.requests.abstracts.SimpleRequest
import dev.inmo.tgbotapi.types.ChatIdentifierSerializer
import dev.inmo.tgbotapi.types.IdChatIdentifier
import dev.inmo.tgbotapi.types.MessageId
import dev.inmo.tgbotapi.types.TelegramDate
import dev.inmo.tgbotapi.types.chatIdField
import dev.inmo.tgbotapi.types.messageIdField
import dev.inmo.tgbotapi.types.sendDateField
import kotlinx.serialization.DeserializationStrategy
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
import kotlinx.serialization.SerializationStrategy
import kotlinx.serialization.builtins.serializer
@Serializable
data class ApproveSuggestedPost(
@Suppress("SERIALIZER_TYPE_INCOMPATIBLE")
@SerialName(chatIdField)
@Serializable(ChatIdentifierSerializer::class)
override val chatId: IdChatIdentifier,
@SerialName(messageIdField)
val messageId: MessageId,
@SerialName(sendDateField)
val sendDate: TelegramDate? = null,
) : SimpleRequest<Boolean>, ChatRequest {
override val requestSerializer: SerializationStrategy<ApproveSuggestedPost>
get() = serializer()
override fun method(): String = "approveSuggestedPost"
override val resultDeserializer: DeserializationStrategy<Boolean>
get() = Boolean.serializer()
}

View File

@@ -0,0 +1,35 @@
package dev.inmo.tgbotapi.requests.suggested
import dev.inmo.tgbotapi.abstracts.types.ChatRequest
import dev.inmo.tgbotapi.requests.abstracts.SimpleRequest
import dev.inmo.tgbotapi.types.ChatIdentifierSerializer
import dev.inmo.tgbotapi.types.IdChatIdentifier
import dev.inmo.tgbotapi.types.MessageId
import dev.inmo.tgbotapi.types.chatIdField
import dev.inmo.tgbotapi.types.commentField
import dev.inmo.tgbotapi.types.messageIdField
import kotlinx.serialization.DeserializationStrategy
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
import kotlinx.serialization.SerializationStrategy
import kotlinx.serialization.builtins.serializer
@Serializable
data class DeclineSuggestedPost(
@Suppress("SERIALIZER_TYPE_INCOMPATIBLE")
@SerialName(chatIdField)
@Serializable(ChatIdentifierSerializer::class)
override val chatId: IdChatIdentifier,
@SerialName(messageIdField)
val messageId: MessageId,
@SerialName(commentField)
val comment: String? = null,
) : SimpleRequest<Boolean>, ChatRequest {
override val requestSerializer: SerializationStrategy<DeclineSuggestedPost>
get() = serializer()
override fun method(): String = "declineSuggestedPost"
override val resultDeserializer: DeserializationStrategy<Boolean>
get() = Boolean.serializer()
}

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