1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2025-11-17 12:30:20 +00:00

Compare commits

..

132 Commits

Author SHA1 Message Date
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
eb1fb16117 add support of custom publishing type 2025-09-23 18:13:04 +06:00
ee4cf7c626 add passing of default engines in HttpClient constructors 2025-09-23 17:53:21 +06:00
74d8b31437 start 28.0.3 2025-09-23 17:46:54 +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
f22d571484 Merge pull request #1003 from InsanusMokrassar/28.0.2
28.0.2
2025-09-10 15:59:20 +06:00
9be5ebb036 refactor changelog 2025-09-10 15:58:43 +06:00
da4cd527ec fix of #1002 2025-09-10 15:45:45 +06:00
4117288b21 fix of #1001 2025-09-10 15:33:07 +06:00
458bdd3ee4 start 28.0.2 2025-09-10 15:29:55 +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
d469a88791 Merge pull request #1000 from InsanusMokrassar/28.0.1
28.0.1
2025-09-04 16:38:10 +06:00
514bc699dd update dependencies 2025-09-04 16:37:57 +06:00
bec72b8cf8 fix of default thread id 2025-09-04 16:24:54 +06:00
fb0014dffa start 28.0.1 2025-09-04 16:10:16 +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
2bbd2e0679 Merge pull request #993 from InsanusMokrassar/28.0.0
28.0.0
2025-08-11 15:55:27 +06:00
bcf7e835e6 add breaking changes note 2025-08-11 15:55:01 +06:00
4dd9740fec fill changelog and add kdocs for firstOf 2025-08-11 15:50:06 +06:00
2182e44bc2 add overloads for containsCommand 2025-08-11 15:28:21 +06:00
08c885de2f add extension of containsCommand 2025-08-11 01:02:22 +06:00
facecf35fb add firstOf 2025-08-11 00:47:35 +06:00
b13f24153f add filtering of waiters with commands for other usernames 2025-08-10 23:28:30 +06:00
12ee862dad small fix in filter of commands 2025-08-10 23:03:17 +06:00
0726574852 improvements in copying of behaviour contexts 2025-08-10 22:50:21 +06:00
9a00193e59 improvements in data filling 2025-08-10 22:47:52 +06:00
0fd8c1e2f3 add filtering out of other bots commands by default 2025-08-10 18:24:34 +06:00
c09d089707 add lazy loadable bot info 2025-08-10 18:05:48 +06:00
ff39271afd start 28.0.0 2025-08-10 17:02:41 +06:00
35a4edd643 start 27.2.0 2025-08-10 16:51:23 +06:00
ba647ee5ab Update README.md 2025-08-06 17:46:43 +06:00
d2924ce1f2 Merge pull request #992 from InsanusMokrassar/27.1.2
27.1.2
2025-08-06 15:59:17 +06:00
72781487f0 add note about Something web wrong 2025-08-06 14:00:29 +06:00
de435e5dbc Merge pull request #986 from BlackBaroness/patch-1
fix: typo in default error messages
2025-08-06 13:57:59 +06:00
f975754058 try to fix cancelling on timeout for long polling 2025-08-06 13:14:22 +06:00
0f7536a21c start 27.1.2 2025-08-06 13:10:42 +06:00
d4c085c9b6 Merge pull request #991 from InsanusMokrassar/27.1.1
27.1.1
2025-08-04 01:59:53 +06:00
667c49f13d update dependencies 2025-08-04 01:36:56 +06:00
e1d9ebff90 jvmApiDump 2025-08-04 01:33:12 +06:00
fbc7088dad fix of #990 2025-08-04 01:25:16 +06:00
4ba9c8ee97 start 27.1.1 2025-08-04 01:24:02 +06:00
92611b5c26 Merge pull request #985 from InsanusMokrassar/27.1.0
27.1.0
2025-07-28 20:23:07 +06:00
2e1c0d41ec update service dependencies 2025-07-28 20:09:58 +06:00
3ce56745f4 add fileLinkUrlMapper to all callers of TelegramAPIUrlsKeeper constructors 2025-07-28 20:04:59 +06:00
1bc9ee4d5a add TelegramAPIUrlsKeeper#fileLinkUrlMapper and fill readme Bot API Server Notice 2025-07-27 15:06:47 +06:00
BlackBaroness
0650fc594f fix: typo in default error messages 2025-07-27 07:34:56 +03:00
2f4de37489 fix build 2025-07-25 21:53:08 +06:00
cec5a0af12 improve support of local bot api servers 2025-07-25 21:35:38 +06:00
5e5dc6b36b start 27.1.0 2025-07-25 21:00:44 +06:00
19265357a2 Merge pull request #981 from InsanusMokrassar/27.0.0
27.0.0
2025-07-22 20:32:37 +06:00
49c2836e62 fill changelog and update dependencies 2025-07-22 19:42:23 +06:00
f7476188eb so, now? 2025-07-21 22:55:36 +06:00
2ba447b126 fix of cancellation exception throwing? 2025-07-21 20:41:51 +06:00
3bd4fab3fe migrate onto 27.0.0 due to potentially breaking changes 2025-07-12 15:44:39 +06:00
9e4d7dd9f9 WAT A HUGE REFACTOR 2025-07-12 15:42:48 +06:00
586a61157d update dependencies 2025-07-12 13:20:02 +06:00
045265f0f8 update dependencies 2025-07-12 13:06:35 +06:00
c125eadaa4 Update README.md 2025-07-10 17:39:40 +06:00
3dd0a91c54 Merge pull request #979 from InsanusMokrassar/26.1.0
26.1.0
2025-07-10 16:44:46 +06:00
2ecd42c859 fill changelog (-.-) and remove redundant file 2025-07-10 16:13:19 +06:00
3857950141 fixes 2025-07-08 18:38:12 +06:00
6d5bedd315 add workarounds for checklists 2025-07-08 11:47:05 +06:00
69a9e8f820 several fixes 2025-07-08 11:43:13 +06:00
6d8693a003 add typed origin, nextTransferDate and last_resale_star_count in GiftSentOrReceived 2025-07-07 22:18:16 +06:00
c990d987f5 add support of general changes 2025-07-07 21:48:23 +06:00
b8530f14ca add checklist as field in ExternalReplyInfo and add support of EditMessageChecklist 2025-07-07 21:29:29 +06:00
db8bac9b52 add ChecklistTasksAdded and ChecklistTasksDone events 2025-07-07 21:19:17 +06:00
e53b3b8198 improve support of send checklist 2025-07-07 21:03:04 +06:00
71ccfc88cc start add SendChecklist 2025-07-07 16:25:21 +06:00
dd2923f92d complete base checklists? 2025-07-07 15:39:48 +06:00
ff78153591 small improvements 2025-07-07 15:18:22 +06:00
e2ce9cfebf preview version of inputs for tasks 2025-07-07 14:38:39 +06:00
0a01d2567e add checklist 2025-07-04 11:53:16 +06:00
e4fb45c09b start realize Bots API 9.1 2025-07-03 22:25:47 +06:00
db0df975c7 start 26.1.0 2025-07-03 22:07:16 +06:00
2003b314a3 update maven badge 2025-06-30 14:00:07 +06:00
55a78375be Merge pull request #977 from centralhardware/PR1
docs: make buildEntities usage more obvious to anyone not familiar with Telegram Bot API or ktgbotapi
2025-06-23 21:20:33 +06:00
alex
256607e336 docs: make buildEntities usage more obvious to anyone not familiar with Telegram Bot API or ktgbotapi 2025-06-23 18:58:08 +08:00
92f2a5afdb Merge pull request #974 from InsanusMokrassar/26.0.0
26.0.0
2025-06-15 19:46:05 +06:00
454 changed files with 14994 additions and 7182 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:

1
.gitignore vendored
View File

@@ -9,6 +9,7 @@ settings.xml
.gradle/ .gradle/
build/ build/
out/ out/
bin/
local.properties local.properties
kotlin-js-store/ kotlin-js-store/

View File

@@ -1,5 +1,112 @@
# TelegramBotAPI changelog # TelegramBotAPI changelog
## 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
* `Core`:
* Add passing of default engines in `HttpClient` constructors
## 28.0.2
* `Core`:
* [#1001](https://github.com/InsanusMokrassar/ktgbotapi/issues/1001) - `[Bug] Invalid detection of isCausedByCancellation()`
* [#1002](https://github.com/InsanusMokrassar/ktgbotapi/issues/1002) - `Unable to handle UnauthorizedException with buildBehaviourWithLongPolling`
## 28.0.1
* `Version`:
* `Kotlin`: `2.2.0` -> `2.2.10`
* `MicroUtils`: `0.26.2` -> `0.26.3`
* `Ktor`: `3.2.2` -> `3.2.3`
* `Core`:
* Let all `OptionallyMessageThreadRequest` inheritors to use `@EncodeDefault` annotation to fix default value passing
## 28.0.0
**THIS UPDATE CONTAINS BREAKING CHANGES**
* `Core`:
* Add `firstOf` extension
* `BehaviourBuilder`:
* All builders for behaviours got boolean `useDefaultSubcontextInitialAction`
* Add opportunity to pass `BehaviourContextData` in `DefaultBehaviourContext` constructor and `copy` method
* By default, commands to other bots will be ignored in triggers and waiters
## 27.1.2
* `Core`:
* Try to fix cancelling on timeout for long polling
* Since this update phrase `Something web wrong` will not happen from this library 😭
## 27.1.1
* `Version`:
* `MicroUtils`: `0.26.1` -> `0.26.2`
* `Core`:
* Make `BusinessLocation#location` optional (fix of [#990](https://github.com/InsanusMokrassar/ktgbotapi/issues/990))
## 27.1.0
* `Core`:
* Improve support of local bot api servers files. Next call factories will try to resolve file locally before real call:
* [DownloadFileRequestCallFactory.kt](tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/bot/ktor/base/DownloadFileRequestCallFactory.kt) (for [DownloadFile.kt](tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/DownloadFile.kt) as well)
* [DownloadFileChannelRequestCallFactory.kt](tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/bot/ktor/base/DownloadFileChannelRequestCallFactory.kt) (for [DownloadFileStream.kt](tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/DownloadFileStream.kt) as well)
## 27.0.0
**THIS UPDATE MAY CONTAIN BREAKING CHANGES. IN CASE OF ANY MIGRATION PROBLEMS FEEL FREE TO ASK IN [OUR CHAT](https://t.me/ktgbotapi_chat)**
* `Version`:
* `Kotlin`: `2.1.20` -> `2.2.0`
* `Serialization`: `1.8.1` -> `1.9.0`
* `Ktor`: `3.1.3` -> `3.2.2`
* `MicroUtils`: `0.25.7` -> `0.26.1`
* `KSLog`: `1.4.1` -> `1.5.0`
* `Common`:
* In most `data` classes with non-public constructors has been added `ConsistentCopyVisibility` annotation, preventing
public nature in difference with constructor
* Absence of several API methods for requests has been fixed
## 26.1.0
**THIS UPDATE CONTAINS ADDING SUPPORT OF [Telegram Bots API 9.1](https://core.telegram.org/bots/api-changelog#july-3-2025)**
**THIS UPDATE _MAY_ CONTAINS BREAKING CHANGES**
## 26.0.0 ## 26.0.0
**THIS UPDATE CONTAINS BREAKING CHANGES IN BEHAVIOUR BUILDER AND CORE. BE CAREFUL ON UPDATE** **THIS UPDATE CONTAINS BREAKING CHANGES IN BEHAVIOUR BUILDER AND CORE. BE CAREFUL ON UPDATE**

View File

@@ -1,4 +1,4 @@
# TelegramBotAPI [![Maven Central](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi/badge.svg)](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi) [![Supported version](https://img.shields.io/badge/Telegram%20Bot%20API-9.0-blue)](https://core.telegram.org/bots/api-changelog#april-11-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.2-blue)](https://core.telegram.org/bots/api-changelog#august-15-2025)
| 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) |
|:----------------------:|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:| |:----------------------:|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|
@@ -120,3 +120,20 @@ suspend fun main() {
You may find examples in [this project](https://github.com/InsanusMokrassar/TelegramBotAPI-examples). Besides, you are You may find examples in [this project](https://github.com/InsanusMokrassar/TelegramBotAPI-examples). Besides, you are
always welcome in our [docs](https://docs.inmo.dev/tgbotapi/index.html) and always welcome in our [docs](https://docs.inmo.dev/tgbotapi/index.html) and
[chat](https://t.me/InMoTelegramBotAPIChat). [chat](https://t.me/InMoTelegramBotAPIChat).
### Bot API Server Notice
Under the hood, default bots realizations will try to use links
([PathedFile](tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/files/PathedFile.kt)#filePath) as files each
time you are trying to download file from telegram in any way - via saving to file, use stream or download as byte array.
To let bot correctly download files from bot api server, you must:
* Run bot api server locally
to proxy requests for files to the server where bot api server has been hosted
* In case of local bot api server (shared one host machine) you must ensure that access to bot api server has been
granted for your bot. For example, [aiogram/telegram-bot-api](https://hub.docker.com/r/aiogram/telegram-bot-api) image
use `101` UID/GID in linux for user and group as owners. So, your bot must run under user included in `101` group
(like `systemd-journal`) or be `101` UID user (like `systemd-resolve`)
* **OR** Use some reverse proxy (like nginx). It will allow you to broadcast your bots files without linux rights problems
* Set [TelegramAPIUrlsKeeper](tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/utils/TelegramAPIUrlsKeeper.kt)#fileLinkUrlMapper
to map urls to let bot execute requests to your nginx proxy

View File

@@ -27,8 +27,8 @@ if ((project.hasProperty('SONATYPE_USER') || System.getenv('SONATYPE_USER') != n
centralPortal { centralPortal {
username = project.hasProperty('SONATYPE_USER') ? project.property('SONATYPE_USER') : System.getenv('SONATYPE_USER') username = project.hasProperty('SONATYPE_USER') ? project.property('SONATYPE_USER') : System.getenv('SONATYPE_USER')
password = project.hasProperty('SONATYPE_PASSWORD') ? project.property('SONATYPE_PASSWORD') : System.getenv('SONATYPE_PASSWORD') password = project.hasProperty('SONATYPE_PASSWORD') ? project.property('SONATYPE_PASSWORD') : System.getenv('SONATYPE_PASSWORD')
verificationTimeout = Duration.ofSeconds(0) validationTimeout = Duration.ofSeconds(0)
publishingType = "USER_MANAGED" publishingType = System.getenv('PUBLISHING_TYPE') != "" ? System.getenv('PUBLISHING_TYPE') : "USER_MANAGED"
} }
publishAllProjectsProbablyBreakingProjectIsolation() publishAllProjectsProbablyBreakingProjectIsolation()

View File

@@ -5,5 +5,8 @@ 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=26.0.0 library_version=30.0.1

View File

@@ -1,28 +1,28 @@
[versions] [versions]
kotlin = "2.1.20" kotlin = "2.2.20"
kotlin-serialization = "1.8.1" kotlin-serialization = "1.9.0"
kotlin-coroutines = "1.10.2" kotlin-coroutines = "1.10.2"
javax-activation = "1.1.1" javax-activation = "1.1.1"
korlibs = "5.4.0" korlibs = "5.4.0"
uuid = "0.8.4" uuid = "0.8.4"
ktor = "3.1.3" ktor = "3.3.1"
ksp = "2.1.20-1.0.31" ksp = "2.2.20-2.0.4"
kotlin-poet = "1.18.1" kotlin-poet = "2.2.0"
microutils = "0.25.7" microutils = "0.26.6"
kslog = "1.4.1" kslog = "1.5.1"
versions = "0.51.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.17.0" validator = "0.18.1"
nmcp = "0.1.5" nmcp = "1.2.0"
[libraries] [libraries]
@@ -37,6 +37,8 @@ kotlin-test-js = { module = "org.jetbrains.kotlin:kotlin-test-js", version.ref =
ktor-client-core = { module = "io.ktor:ktor-client-core", version.ref = "ktor" } ktor-client-core = { module = "io.ktor:ktor-client-core", version.ref = "ktor" }
ktor-client-cio = { module = "io.ktor:ktor-client-cio", version.ref = "ktor" } ktor-client-cio = { module = "io.ktor:ktor-client-cio", version.ref = "ktor" }
ktor-client-java = { module = "io.ktor:ktor-client-java", version.ref = "ktor" }
ktor-client-js = { module = "io.ktor:ktor-client-js", version.ref = "ktor" }
ktor-client-curl = { module = "io.ktor:ktor-client-curl", version.ref = "ktor" } ktor-client-curl = { module = "io.ktor:ktor-client-curl", version.ref = "ktor" }
ktor-client-winhttp = { module = "io.ktor:ktor-client-winhttp", version.ref = "ktor" } ktor-client-winhttp = { module = "io.ktor:ktor-client-winhttp", version.ref = "ktor" }
ktor-server = { module = "io.ktor:ktor-server", version.ref = "ktor" } ktor-server = { module = "io.ktor:ktor-server", version.ref = "ktor" }

View File

@@ -4,6 +4,9 @@ project.group = "$group"
apply from: "$mpp_publish" apply from: "$mpp_publish"
kotlin { kotlin {
compilerOptions {
freeCompilerArgs.add("-Xcontext-parameters")
}
js (IR) { js (IR) {
browser() browser()
nodejs() nodejs()

View File

@@ -2,6 +2,9 @@ project.version = "$library_version"
project.group = "$library_group" project.group = "$library_group"
kotlin { kotlin {
compilerOptions {
freeCompilerArgs.add("-Xcontext-parameters")
}
jvm { jvm {
compilations.main { compilations.main {
kotlinOptions { kotlinOptions {

File diff suppressed because it is too large Load Diff

View File

@@ -12,10 +12,11 @@ import io.ktor.client.engine.*
* @param ktorClientEngine Engine like [io.ktor.client.engine.cio.CIO] * @param ktorClientEngine Engine like [io.ktor.client.engine.cio.CIO]
* @param ktorClientConfig Config block for preconfiguring of bot [HttpClient] * @param ktorClientConfig Config block for preconfiguring of bot [HttpClient]
*/ */
@ConsistentCopyVisibility
public data class BotBuilder internal constructor( public data class BotBuilder internal constructor(
var proxy: ProxyConfig? = null, var proxy: ProxyConfig? = null,
var ktorClientEngineFactory: HttpClientEngineFactory<HttpClientEngineConfig>? = null, var ktorClientEngineFactory: HttpClientEngineFactory<HttpClientEngineConfig>? = null,
var ktorClientConfig: (HttpClientConfig<*>.() -> Unit) ? = null var ktorClientConfig: (HttpClientConfig<*>.() -> Unit) ? = null,
) { ) {
internal fun createHttpClient(): HttpClient = ktorClientEngineFactory ?.let { internal fun createHttpClient(): HttpClient = ktorClientEngineFactory ?.let {
HttpClient( HttpClient(
@@ -41,8 +42,14 @@ public fun buildBot(
token: String, token: String,
apiUrl: String = telegramBotAPIDefaultUrl, apiUrl: String = telegramBotAPIDefaultUrl,
testServer: Boolean = false, testServer: Boolean = false,
fileLinkUrlMapper: TelegramAPIUrlsKeeper.(String) -> String = { "${fileBaseUrl}/$it" },
block: BotBuilder.() -> Unit block: BotBuilder.() -> Unit
): TelegramBot = telegramBot( ): TelegramBot = telegramBot(
TelegramAPIUrlsKeeper(token, testServer, apiUrl), urlsKeeper = TelegramAPIUrlsKeeper(
BotBuilder().apply(block).createHttpClient() token = token,
testServer = testServer,
hostUrl = apiUrl,
fileLinkUrlMapper = fileLinkUrlMapper
),
client = BotBuilder().apply(block).createHttpClient()
) )

View File

@@ -3,6 +3,7 @@ package dev.inmo.tgbotapi.extensions.api
import dev.inmo.tgbotapi.bot.ktor.telegramBot import dev.inmo.tgbotapi.bot.ktor.telegramBot
import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.utils.TelegramAPIUrlsKeeper import dev.inmo.tgbotapi.utils.TelegramAPIUrlsKeeper
import dev.inmo.tgbotapi.utils.defaultKtorEngine
import dev.inmo.tgbotapi.utils.telegramBotAPIDefaultUrl import dev.inmo.tgbotapi.utils.telegramBotAPIDefaultUrl
import io.ktor.client.HttpClient import io.ktor.client.HttpClient
import io.ktor.client.HttpClientConfig import io.ktor.client.HttpClientConfig
@@ -13,7 +14,7 @@ import io.ktor.client.engine.*
*/ */
public fun telegramBot( public fun telegramBot(
urlsKeeper: TelegramAPIUrlsKeeper, urlsKeeper: TelegramAPIUrlsKeeper,
client: HttpClient = HttpClient() client: HttpClient = HttpClient(defaultKtorEngine)
): TelegramBot = telegramBot(urlsKeeper) { ): TelegramBot = telegramBot(urlsKeeper) {
this.client = client this.client = client
} }
@@ -63,22 +64,24 @@ public inline fun telegramBot(
* Allows to create bot using bot [token], [apiUrl] (for custom api servers) and already prepared [client] * Allows to create bot using bot [token], [apiUrl] (for custom api servers) and already prepared [client]
*/ */
@Suppress("NOTHING_TO_INLINE") @Suppress("NOTHING_TO_INLINE")
public inline fun telegramBot( public fun telegramBot(
token: String, token: String,
apiUrl: String = telegramBotAPIDefaultUrl, apiUrl: String = telegramBotAPIDefaultUrl,
testServer: Boolean = false, testServer: Boolean = false,
client: HttpClient = HttpClient() fileLinkUrlMapper: TelegramAPIUrlsKeeper.(String) -> String = { "${fileBaseUrl}/$it" },
): TelegramBot = telegramBot(TelegramAPIUrlsKeeper(token, testServer, apiUrl), client) client: HttpClient = HttpClient(defaultKtorEngine)
): TelegramBot = telegramBot(TelegramAPIUrlsKeeper(token, testServer, apiUrl, fileLinkUrlMapper), client)
@Suppress("NOTHING_TO_INLINE") @Suppress("NOTHING_TO_INLINE")
public inline fun <T: HttpClientEngineConfig> telegramBot( public fun <T: HttpClientEngineConfig> telegramBot(
token: String, token: String,
clientFactory: HttpClientEngineFactory<T>, clientFactory: HttpClientEngineFactory<T>,
apiUrl: String = telegramBotAPIDefaultUrl, apiUrl: String = telegramBotAPIDefaultUrl,
testServer: Boolean = false, testServer: Boolean = false,
noinline clientConfig: HttpClientConfig<T>.() -> Unit = {} fileLinkUrlMapper: TelegramAPIUrlsKeeper.(String) -> String = { "${fileBaseUrl}/$it" },
clientConfig: HttpClientConfig<T>.() -> Unit = {}
): TelegramBot = telegramBot( ): TelegramBot = telegramBot(
TelegramAPIUrlsKeeper(token, testServer, apiUrl), TelegramAPIUrlsKeeper(token, testServer, apiUrl, fileLinkUrlMapper),
clientFactory, clientFactory,
clientConfig clientConfig
) )
@@ -87,15 +90,15 @@ public inline fun <T: HttpClientEngineConfig> telegramBot(
* Allows to create bot using bot [token] and specify [HttpClientEngine] by passing [clientEngine] param and optionally * Allows to create bot using bot [token] and specify [HttpClientEngine] by passing [clientEngine] param and optionally
* configure [HttpClient] using [clientConfig] * configure [HttpClient] using [clientConfig]
*/ */
@Suppress("NOTHING_TO_INLINE") public fun telegramBot(
public inline fun telegramBot(
token: String, token: String,
clientEngine: HttpClientEngine, clientEngine: HttpClientEngine,
apiUrl: String = telegramBotAPIDefaultUrl, apiUrl: String = telegramBotAPIDefaultUrl,
testServer: Boolean = false, testServer: Boolean = false,
noinline clientConfig: HttpClientConfig<*>.() -> Unit = {} fileLinkUrlMapper: TelegramAPIUrlsKeeper.(String) -> String = { "${fileBaseUrl}/$it" },
clientConfig: HttpClientConfig<*>.() -> Unit = {}
): TelegramBot = telegramBot( ): TelegramBot = telegramBot(
TelegramAPIUrlsKeeper(token, testServer, apiUrl), TelegramAPIUrlsKeeper(token, testServer, apiUrl, fileLinkUrlMapper),
clientEngine, clientEngine,
clientConfig clientConfig
) )
@@ -104,13 +107,13 @@ public inline fun telegramBot(
* Allows to create bot using bot [token] and [apiUrl] and specify [HttpClientEngine] by configuring [HttpClient] using * Allows to create bot using bot [token] and [apiUrl] and specify [HttpClientEngine] by configuring [HttpClient] using
* [clientConfig] * [clientConfig]
*/ */
@Suppress("NOTHING_TO_INLINE") public fun telegramBot(
public inline fun telegramBot(
token: String, token: String,
apiUrl: String = telegramBotAPIDefaultUrl, apiUrl: String = telegramBotAPIDefaultUrl,
testServer: Boolean = false, testServer: Boolean = false,
noinline clientConfig: HttpClientConfig<*>.() -> Unit fileLinkUrlMapper: TelegramAPIUrlsKeeper.(String) -> String = { "${fileBaseUrl}/$it" },
clientConfig: HttpClientConfig<*>.() -> Unit
): TelegramBot = telegramBot( ): TelegramBot = telegramBot(
TelegramAPIUrlsKeeper(token, testServer, apiUrl), TelegramAPIUrlsKeeper(token, testServer, apiUrl, fileLinkUrlMapper),
clientConfig clientConfig
) )

View File

@@ -3,5 +3,4 @@ package dev.inmo.tgbotapi.extensions.api
import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.local.Close import dev.inmo.tgbotapi.requests.local.Close
@Suppress("unused") public suspend inline fun TelegramBot.executeClose(): Boolean = execute(Close)
public suspend inline fun TelegramBot.close(): Boolean = execute(Close)

View File

@@ -3,12 +3,14 @@ package dev.inmo.tgbotapi.extensions.api
import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.ForwardMessage import dev.inmo.tgbotapi.requests.ForwardMessage
import dev.inmo.tgbotapi.types.ChatIdentifier import dev.inmo.tgbotapi.types.ChatIdentifier
import dev.inmo.tgbotapi.types.DirectMessageThreadId
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 +18,12 @@ 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 = execute( ): PossiblyForwardedMessage = execute(
ForwardMessage(fromChatId, toChatId, messageId, threadId, startTimestamp, disableNotification, protectContent) ForwardMessage(fromChatId, toChatId, messageId, threadId, directMessageThreadId, startTimestamp, disableNotification, protectContent)
) )
public suspend fun TelegramBot.forwardMessage( public suspend fun TelegramBot.forwardMessage(
@@ -28,45 +31,50 @@ 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) ): PossiblyForwardedMessage = forwardMessage(fromChat.id, toChatId, messageId, threadId, directMessageThreadId, startTimestamp, disableNotification, protectContent)
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) ): PossiblyForwardedMessage = forwardMessage(fromChatId, toChat.id, messageId, threadId, directMessageThreadId, startTimestamp, disableNotification, protectContent)
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) ): PossiblyForwardedMessage = forwardMessage(fromChat.id, toChat.id, messageId, threadId, directMessageThreadId, startTimestamp, disableNotification, protectContent)
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) ): PossiblyForwardedMessage = forwardMessage(message.chat, toChatId, message.messageId, threadId, directMessageThreadId, startTimestamp, disableNotification, protectContent)
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) ): PossiblyForwardedMessage = forwardMessage(message.chat, toChat, message.messageId, threadId, directMessageThreadId, startTimestamp, disableNotification, protectContent)

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

@@ -17,6 +17,7 @@ internal fun List<Update>.convertWithMediaGroupUpdates(): List<Update> {
for (update in this) { for (update in this) {
val message = (update.data as? PossiblySentViaBotCommonMessage<*>) ?.let { val message = (update.data as? PossiblySentViaBotCommonMessage<*>) ?.let {
if (it.content is MediaGroupPartContent) { if (it.content is MediaGroupPartContent) {
@Suppress("UNCHECKED_CAST")
it as PossiblySentViaBotCommonMessage<MediaGroupPartContent> it as PossiblySentViaBotCommonMessage<MediaGroupPartContent>
} else { } else {
null null
@@ -48,10 +49,4 @@ internal fun List<Update>.convertWithMediaGroupUpdates(): List<Update> {
return resultUpdates return resultUpdates
} }
/** internal fun BaseEditMessageUpdate.toEditMediaGroupUpdate(): BaseEditMessageUpdate = this
* @return [EditMessageMediaGroupUpdate] in case if [this] is [EditMessageUpdate]. When [this] object is
* [EditChannelPostUpdate] instance - will return [EditChannelPostMediaGroupUpdate]
*
* @throws IllegalStateException
*/
internal fun BaseEditMessageUpdate.toEditMediaGroupUpdate() = this

View File

@@ -1,7 +1,6 @@
package dev.inmo.tgbotapi.extensions.api package dev.inmo.tgbotapi.extensions.api
import dev.inmo.micro_utils.coroutines.LinkedSupervisorScope import dev.inmo.micro_utils.coroutines.LinkedSupervisorScope
import dev.inmo.micro_utils.coroutines.launchSafelyWithoutExceptions
import dev.inmo.tgbotapi.abstracts.Headed import dev.inmo.tgbotapi.abstracts.Headed
import dev.inmo.tgbotapi.abstracts.HorizontallyAccured import dev.inmo.tgbotapi.abstracts.HorizontallyAccured
import dev.inmo.tgbotapi.abstracts.Locationed import dev.inmo.tgbotapi.abstracts.Locationed
@@ -16,9 +15,11 @@ 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
import dev.inmo.tgbotapi.utils.launchWithBotLogger
import kotlinx.coroutines.CoroutineStart import kotlinx.coroutines.CoroutineStart
import kotlinx.coroutines.currentCoroutineContext import kotlinx.coroutines.currentCoroutineContext
import kotlinx.coroutines.delay import kotlinx.coroutines.delay
@@ -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
) { ) {
@@ -63,7 +66,7 @@ public suspend fun TelegramBot.handleLiveLocation(
null null
} else { } else {
val scope = currentCoroutineContext().LinkedSupervisorScope() val scope = currentCoroutineContext().LinkedSupervisorScope()
scope.launchSafelyWithoutExceptions(start = CoroutineStart.LAZY) { scope.launchWithBotLogger(start = CoroutineStart.LAZY) {
while (scope.isActive) { while (scope.isActive) {
delay(liveTimeMillis) delay(liveTimeMillis)
// Remove previous location message info to resend live location message // Remove previous location message info to resend live location message
@@ -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,9 @@
package dev.inmo.tgbotapi.extensions.api.bot
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.bot.GetMe
import dev.inmo.tgbotapi.requests.bot.GetMyStarBalance
import dev.inmo.tgbotapi.types.chat.ExtendedBot
import dev.inmo.tgbotapi.types.payments.stars.StarAmount
public suspend fun TelegramBot.getMyStarBalance(): StarAmount = execute(GetMyStarBalance)

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,47 @@
package dev.inmo.tgbotapi.extensions.api.edit.checklist
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.edit.checklist.EditMessageChecklist
import dev.inmo.tgbotapi.types.ChatIdentifier
import dev.inmo.tgbotapi.types.MessageId
import dev.inmo.tgbotapi.types.businessConnectionIdField
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
import dev.inmo.tgbotapi.types.checklistField
import dev.inmo.tgbotapi.types.checklists.Checklist
import dev.inmo.tgbotapi.types.message.abstracts.BusinessContentMessage
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
import dev.inmo.tgbotapi.types.message.content.ChecklistContent
import dev.inmo.tgbotapi.types.messageIdField
import dev.inmo.tgbotapi.types.replyMarkupField
import kotlinx.serialization.SerialName
public suspend fun TelegramBot.editMessageChecklist(
chatId: ChatIdentifier,
messageId: MessageId,
businessConnectionId: BusinessConnectionId,
checklist: Checklist.Input,
replyMarkup: InlineKeyboardMarkup? = null
): ContentMessage<ChecklistContent> = execute(
EditMessageChecklist(
chatId = chatId,
messageId = messageId,
businessConnectionId = businessConnectionId,
checklist = checklist,
replyMarkup = replyMarkup
)
)
public suspend fun TelegramBot.editMessageChecklist(
message: BusinessContentMessage<ChecklistContent>,
checklist: Checklist.Input,
replyMarkup: InlineKeyboardMarkup? = null
): ContentMessage<ChecklistContent> = execute(
EditMessageChecklist(
chatId = message.chat.id,
messageId = message.messageId,
businessConnectionId = message.businessConnectionId,
checklist = checklist,
replyMarkup = replyMarkup
)
)

View File

@@ -1,3 +1,5 @@
@file:Suppress("KDocUnresolvedReference")
package dev.inmo.tgbotapi.extensions.api.edit.media package dev.inmo.tgbotapi.extensions.api.edit.media
import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.bot.TelegramBot
@@ -45,7 +47,7 @@ public suspend fun TelegramBot.editMessageMedia(
* as a builder for that * as a builder for that
*/ */
public suspend fun TelegramBot.editMessageMedia( public suspend fun TelegramBot.editMessageMedia(
message: ContentMessage<out MediaContent>, message: ContentMessage<MediaContent>,
media: TelegramFreeMedia, media: TelegramFreeMedia,
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId, businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
replyMarkup: InlineKeyboardMarkup? = null replyMarkup: InlineKeyboardMarkup? = 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,12 @@ 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,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): MessageId = execute( ): MessageId = execute(
@@ -36,10 +41,12 @@ 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,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -57,10 +64,12 @@ 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,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): MessageId = copyMessage( ): MessageId = copyMessage(
@@ -71,10 +80,12 @@ 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,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -91,10 +102,12 @@ 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,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): MessageId = copyMessage( ): MessageId = copyMessage(
@@ -105,10 +118,12 @@ 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,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -125,10 +140,12 @@ 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,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): MessageId = copyMessage( ): MessageId = copyMessage(
@@ -139,10 +156,12 @@ 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,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -159,10 +178,12 @@ 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,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): MessageId = execute( ): MessageId = execute(
@@ -173,10 +194,12 @@ 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,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -193,10 +216,12 @@ 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,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): MessageId = copyMessage( ): MessageId = copyMessage(
@@ -206,10 +231,12 @@ 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,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -225,10 +252,12 @@ 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,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): MessageId = copyMessage( ): MessageId = copyMessage(
@@ -238,10 +267,12 @@ 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,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -257,10 +288,12 @@ 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,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): MessageId = copyMessage( ): MessageId = copyMessage(
@@ -270,10 +303,12 @@ 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,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -289,10 +324,12 @@ 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,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): MessageId = copyMessage( ): MessageId = copyMessage(
@@ -303,10 +340,12 @@ 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,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -322,10 +361,12 @@ 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,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): MessageId = copyMessage( ): MessageId = copyMessage(
@@ -336,10 +377,12 @@ 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,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -354,10 +397,12 @@ 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,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): MessageId = copyMessage( ): MessageId = copyMessage(
@@ -367,10 +412,12 @@ 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,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -385,10 +432,12 @@ 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,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): MessageId = copyMessage( ): MessageId = copyMessage(
@@ -398,263 +447,12 @@ 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,
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,34 +2,43 @@ 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
*/ */
@Suppress("UNCHECKED_CAST")
public suspend inline fun <T : MessageContent> TelegramBot.resend( 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>
@@ -40,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,
@@ -50,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,
@@ -67,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,
@@ -77,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,
@@ -94,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,
@@ -104,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,9 +1,7 @@
package dev.inmo.tgbotapi.extensions.api.send package dev.inmo.tgbotapi.extensions.api.send
import dev.inmo.micro_utils.coroutines.LinkedSupervisorScope import dev.inmo.micro_utils.coroutines.LinkedSupervisorScope
import dev.inmo.micro_utils.coroutines.runCatchingSafely import dev.inmo.micro_utils.coroutines.runCatchingLogging
import dev.inmo.micro_utils.coroutines.safelyWithResult
import dev.inmo.micro_utils.coroutines.safelyWithoutExceptions
import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.send.SendAction import dev.inmo.tgbotapi.requests.send.SendAction
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
@@ -21,6 +19,7 @@ public suspend fun <T> TelegramBot.withAction(
actionRequest: SendAction, actionRequest: SendAction,
block: TelegramBotActionCallback<T> block: TelegramBotActionCallback<T>
): T { ): T {
@Suppress("WRONG_INVOCATION_KIND")
contract { contract {
callsInPlace(block, InvocationKind.EXACTLY_ONCE) callsInPlace(block, InvocationKind.EXACTLY_ONCE)
} }
@@ -33,7 +32,7 @@ public suspend fun <T> TelegramBot.withAction(
delay(refreshTime) delay(refreshTime)
} }
} }
val result = runCatchingSafely { block() } val result = runCatchingLogging(logger = Log) { block() }
actionScope.coroutineContext.job.cancel() actionScope.coroutineContext.job.cancel()
return result.getOrThrow() return result.getOrThrow()
} }

View File

@@ -0,0 +1,56 @@
package dev.inmo.tgbotapi.extensions.api.send
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.send.SendChecklist
import dev.inmo.tgbotapi.types.BusinessChatId
import dev.inmo.tgbotapi.types.ChatIdentifier
import dev.inmo.tgbotapi.types.EffectId
import dev.inmo.tgbotapi.types.ReplyParameters
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
import dev.inmo.tgbotapi.types.checklists.Checklist
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
import dev.inmo.tgbotapi.types.message.content.ChecklistContent
public suspend fun TelegramBot.sendChecklist(
chatId: ChatIdentifier,
checklist: Checklist.Input,
businessConnectionId: BusinessConnectionId,
disableNotification: Boolean = false,
protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null
): ContentMessage<ChecklistContent> = execute(
SendChecklist(
chatId = chatId,
checklist = checklist,
businessConnectionId = businessConnectionId,
disableNotification = disableNotification,
protectContent = protectContent,
effectId = effectId,
replyParameters = replyParameters,
replyMarkup = replyMarkup
)
)
public suspend fun TelegramBot.sendChecklist(
chatId: BusinessChatId,
checklist: Checklist.Input,
disableNotification: Boolean = false,
protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null
): ContentMessage<ChecklistContent> = execute(
SendChecklist(
chatId = chatId,
checklist = checklist,
businessConnectionId = chatId.businessConnectionId,
disableNotification = disableNotification,
protectContent = protectContent,
effectId = effectId,
replyParameters = replyParameters,
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.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

@@ -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,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

@@ -1,11 +1,13 @@
package dev.inmo.tgbotapi.extensions.api.utils package dev.inmo.tgbotapi.extensions.api.utils
import dev.inmo.micro_utils.coroutines.launchSafelyWithoutExceptions import dev.inmo.kslog.common.KSLog
import dev.inmo.micro_utils.coroutines.launchLoggingDropExceptions
import dev.inmo.tgbotapi.extensions.api.InternalUtils.convertWithMediaGroupUpdates import dev.inmo.tgbotapi.extensions.api.InternalUtils.convertWithMediaGroupUpdates
import dev.inmo.tgbotapi.types.message.abstracts.PossiblyMediaGroupMessage import dev.inmo.tgbotapi.types.message.abstracts.PossiblyMediaGroupMessage
import dev.inmo.tgbotapi.types.update.abstracts.BaseMessageUpdate import dev.inmo.tgbotapi.types.update.abstracts.BaseMessageUpdate
import dev.inmo.tgbotapi.types.update.abstracts.Update import dev.inmo.tgbotapi.types.update.abstracts.Update
import dev.inmo.tgbotapi.updateshandlers.UpdateReceiver import dev.inmo.tgbotapi.updateshandlers.UpdateReceiver
import dev.inmo.tgbotapi.utils.DefaultKTgBotAPIKSLog
import dev.inmo.tgbotapi.utils.extensions.accumulateByKey import dev.inmo.tgbotapi.utils.extensions.accumulateByKey
import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.channels.Channel import kotlinx.coroutines.channels.Channel
@@ -19,7 +21,8 @@ import kotlinx.coroutines.launch
*/ */
public fun CoroutineScope.updateHandlerWithMediaGroupsAdaptation( public fun CoroutineScope.updateHandlerWithMediaGroupsAdaptation(
output: UpdateReceiver<Update>, output: UpdateReceiver<Update>,
mediaGroupsDebounceMillis: Long = 1000L mediaGroupsDebounceMillis: Long = 1000L,
logger: KSLog = DefaultKTgBotAPIKSLog
): UpdateReceiver<Update> { ): UpdateReceiver<Update> {
val updatesChannel = Channel<Update>(Channel.UNLIMITED) val updatesChannel = Channel<Update>(Channel.UNLIMITED)
val mediaGroupChannel = Channel<Pair<String, BaseMessageUpdate>>(Channel.UNLIMITED) val mediaGroupChannel = Channel<Pair<String, BaseMessageUpdate>>(Channel.UNLIMITED)
@@ -29,7 +32,7 @@ public fun CoroutineScope.updateHandlerWithMediaGroupsAdaptation(
) )
launch { launch {
launchSafelyWithoutExceptions { launchLoggingDropExceptions(logger = logger) {
for (update in updatesChannel) { for (update in updatesChannel) {
val data = update.data val data = update.data
when { when {
@@ -40,7 +43,7 @@ public fun CoroutineScope.updateHandlerWithMediaGroupsAdaptation(
} }
} }
} }
launchSafelyWithoutExceptions { launchLoggingDropExceptions(logger = logger) {
for ((_, mediaGroup) in mediaGroupAccumulatedChannel) { for ((_, mediaGroup) in mediaGroupAccumulatedChannel) {
mediaGroup.convertWithMediaGroupUpdates().forEach { mediaGroup.convertWithMediaGroupUpdates().forEach {
output(it) output(it)

View File

@@ -0,0 +1,11 @@
package dev.inmo.tgbotapi.extensions.api.verifications
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.verifications.RemoveChatVerification
import dev.inmo.tgbotapi.types.ChatIdentifier
public suspend fun TelegramBot.removeChatVerification(
chatId: ChatIdentifier
): Boolean = execute(
RemoveChatVerification(chatId)
)

View File

@@ -0,0 +1,11 @@
package dev.inmo.tgbotapi.extensions.api.verifications
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.verifications.RemoveUserVerification
import dev.inmo.tgbotapi.types.UserId
public suspend fun TelegramBot.removeUserVerification(
userId: UserId
): Boolean = execute(
RemoveUserVerification(userId)
)

View File

@@ -1,11 +1,13 @@
public abstract interface class dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextWithFSM : dev/inmo/micro_utils/fsm/common/StatesMachine, dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext { public abstract interface class dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextWithFSM : dev/inmo/micro_utils/fsm/common/StatesMachine, dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext {
public static final field Companion Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextWithFSM$Companion; public static final field Companion Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextWithFSM$Companion;
public abstract fun add (Lkotlin/reflect/KClass;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandler;)V public abstract fun add (Lkotlin/reflect/KClass;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandler;)V
public abstract fun addStrict (Lkotlin/reflect/KClass;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandler;)V public static synthetic fun add$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextWithFSM;Lkotlin/reflect/KClass;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandler;ILjava/lang/Object;)V
public fun addStrict (Lkotlin/reflect/KClass;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandler;)V
public abstract fun copy (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;ILkotlinx/coroutines/channels/BufferOverflow;Lkotlinx/coroutines/flow/Flow;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;Lkotlin/jvm/functions/Function3;)Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextWithFSM; public abstract fun copy (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;ILkotlinx/coroutines/channels/BufferOverflow;Lkotlinx/coroutines/flow/Flow;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;Lkotlin/jvm/functions/Function3;)Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextWithFSM;
public abstract fun copy (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;ILkotlinx/coroutines/channels/BufferOverflow;Lkotlinx/coroutines/flow/Flow;Lkotlin/jvm/functions/Function3;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;)Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextWithFSM; public abstract fun copy (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;ILkotlinx/coroutines/channels/BufferOverflow;Lkotlinx/coroutines/flow/Flow;Lkotlin/jvm/functions/Function3;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;)Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextWithFSM;
public static synthetic fun copy$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextWithFSM;Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;ILkotlinx/coroutines/channels/BufferOverflow;Lkotlinx/coroutines/flow/Flow;Lkotlin/jvm/functions/Function3;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextWithFSM;
public abstract fun getStateInitialAction ()Lkotlin/jvm/functions/Function3; public abstract fun getStateInitialAction ()Lkotlin/jvm/functions/Function3;
public abstract fun start (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public fun start (Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
} }
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextWithFSM$Companion { public final class dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextWithFSM$Companion {
@@ -33,14 +35,14 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourConte
} }
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextWithFSMBuilderKt { public final class dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextWithFSMBuilderKt {
public static final fun buildBehaviourWithFSM (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun buildBehaviourWithFSM (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;ZLkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static final fun buildBehaviourWithFSM (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/flow/Flow;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun buildBehaviourWithFSM (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/flow/Flow;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;ZLkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static synthetic fun buildBehaviourWithFSM$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public static synthetic fun buildBehaviourWithFSM$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;ZLkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
public static synthetic fun buildBehaviourWithFSM$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/flow/Flow;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public static synthetic fun buildBehaviourWithFSM$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/flow/Flow;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;ZLkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
public static final fun buildBehaviourWithFSMAndStartLongPolling (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;Lkotlin/jvm/functions/Function3;IZZLjava/lang/Long;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun buildBehaviourWithFSMAndStartLongPolling (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;Lkotlin/jvm/functions/Function3;IZZLjava/lang/Long;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;ZLkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static final fun buildBehaviourWithFSMAndStartLongPolling (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/flow/Flow;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;Lkotlin/jvm/functions/Function3;IZZLjava/lang/Long;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun buildBehaviourWithFSMAndStartLongPolling (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/flow/Flow;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;Lkotlin/jvm/functions/Function3;IZZLjava/lang/Long;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;ZLkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static synthetic fun buildBehaviourWithFSMAndStartLongPolling$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;Lkotlin/jvm/functions/Function3;IZZLjava/lang/Long;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public static synthetic fun buildBehaviourWithFSMAndStartLongPolling$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;Lkotlin/jvm/functions/Function3;IZZLjava/lang/Long;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;ZLkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
public static synthetic fun buildBehaviourWithFSMAndStartLongPolling$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/flow/Flow;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;Lkotlin/jvm/functions/Function3;IZZLjava/lang/Long;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public static synthetic fun buildBehaviourWithFSMAndStartLongPolling$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/flow/Flow;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;Lkotlin/jvm/functions/Function3;IZZLjava/lang/Long;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;ZLkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
} }
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextWithFSMKt { public final class dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextWithFSMKt {
@@ -49,7 +51,7 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourConte
} }
public abstract interface class dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandler : dev/inmo/micro_utils/fsm/common/StatesHandler { public abstract interface class dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandler : dev/inmo/micro_utils/fsm/common/StatesHandler {
public abstract fun handleState (Ldev/inmo/micro_utils/fsm/common/StatesMachine;Ldev/inmo/micro_utils/fsm/common/State;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public fun handleState (Ldev/inmo/micro_utils/fsm/common/StatesMachine;Ldev/inmo/micro_utils/fsm/common/State;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public abstract fun handleState (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextWithFSM;Ldev/inmo/micro_utils/fsm/common/State;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public abstract fun handleState (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextWithFSM;Ldev/inmo/micro_utils/fsm/common/State;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
} }
@@ -126,9 +128,9 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/DefaultBehavio
} }
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/TelegramBotWithFSMKt { public final class dev/inmo/tgbotapi/extensions/behaviour_builder/TelegramBotWithFSMKt {
public static final fun telegramBotWithBehaviourAndFSM (Ljava/lang/String;Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;Lkotlinx/coroutines/CoroutineScope;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;ZLkotlin/jvm/functions/Function3;IZZLjava/lang/Long;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun telegramBotWithBehaviourAndFSM (Ljava/lang/String;Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;Lkotlinx/coroutines/CoroutineScope;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;ZLkotlin/jvm/functions/Function3;IZZLjava/lang/Long;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;ZLkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static synthetic fun telegramBotWithBehaviourAndFSM$default (Ljava/lang/String;Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;Lkotlinx/coroutines/CoroutineScope;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;ZLkotlin/jvm/functions/Function3;IZZLjava/lang/Long;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public static synthetic fun telegramBotWithBehaviourAndFSM$default (Ljava/lang/String;Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;Lkotlinx/coroutines/CoroutineScope;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;ZLkotlin/jvm/functions/Function3;IZZLjava/lang/Long;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;ZLkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
public static final fun telegramBotWithBehaviourAndFSMAndStartLongPolling (Ljava/lang/String;Lkotlinx/coroutines/CoroutineScope;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;ZLkotlin/jvm/functions/Function3;IZZLjava/lang/Long;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun telegramBotWithBehaviourAndFSMAndStartLongPolling (Ljava/lang/String;Lkotlinx/coroutines/CoroutineScope;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;ZLkotlin/jvm/functions/Function3;IZZLjava/lang/Long;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;ZLkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static synthetic fun telegramBotWithBehaviourAndFSMAndStartLongPolling$default (Ljava/lang/String;Lkotlinx/coroutines/CoroutineScope;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;ZLkotlin/jvm/functions/Function3;IZZLjava/lang/Long;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public static synthetic fun telegramBotWithBehaviourAndFSMAndStartLongPolling$default (Ljava/lang/String;Lkotlinx/coroutines/CoroutineScope;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;ZLkotlin/jvm/functions/Function3;IZZLjava/lang/Long;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;ZLkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
} }

View File

@@ -1,3 +1,5 @@
@file:Suppress("unused")
package dev.inmo.tgbotapi.extensions.behaviour_builder package dev.inmo.tgbotapi.extensions.behaviour_builder
import dev.inmo.micro_utils.coroutines.* import dev.inmo.micro_utils.coroutines.*
@@ -8,6 +10,8 @@ import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextWithFSM.Companion.DATA_FSM_KEY import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextWithFSM.Companion.DATA_FSM_KEY
import dev.inmo.tgbotapi.types.update.abstracts.Update import dev.inmo.tgbotapi.types.update.abstracts.Update
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.handlers_registrar.TriggersHolder import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.handlers_registrar.TriggersHolder
import dev.inmo.tgbotapi.utils.launchWithBotLogger
import dev.inmo.tgbotapi.utils.subscribeWithBotLogger
import kotlinx.coroutines.* import kotlinx.coroutines.*
import kotlinx.coroutines.channels.BufferOverflow import kotlinx.coroutines.channels.BufferOverflow
import kotlinx.coroutines.flow.* import kotlinx.coroutines.flow.*
@@ -72,6 +76,7 @@ interface BehaviourContextWithFSM<T : State> : BehaviourContext, StatesMachine<T
): BehaviourContextWithFSM<T> ): BehaviourContextWithFSM<T>
companion object { companion object {
@Suppress("RemoveExplicitTypeArguments")
operator fun <T : State> invoke( operator fun <T : State> invoke(
behaviourContext: BehaviourContext, behaviourContext: BehaviourContext,
handlers: List<BehaviourWithFSMStateHandlerHolder<*, T>>, handlers: List<BehaviourWithFSMStateHandlerHolder<*, T>>,
@@ -88,7 +93,7 @@ interface BehaviourContextWithFSM<T : State> : BehaviourContext, StatesMachine<T
/** /**
* Add NON STRICT [handler] to list of available in future [BehaviourContextWithFSM]. Non strict means that * Add NON STRICT [handler] to list of available in future [BehaviourContextWithFSM]. Non strict means that
* for input [State] will be used [KClass.isInstance] and any inheritor of [kClass] will pass this requirement * for input [State] will be used [KClass.isInstance] and any inheritor of I::class will pass this requirement
* *
* @see BehaviourWithFSMStateHandlerHolder * @see BehaviourWithFSMStateHandlerHolder
* @see BehaviourContextWithFSM.add * @see BehaviourContextWithFSM.add
@@ -98,7 +103,7 @@ inline fun <reified I : O, O: State> BehaviourContextWithFSM<O>.onStateOrSubstat
/** /**
* Add STRICT [handler] to list of available in future [BehaviourContextWithFSM]. Strict means that * Add STRICT [handler] to list of available in future [BehaviourContextWithFSM]. Strict means that
* for input [State] will be used [State]::class == [kClass] and any [State] with exactly the same type will pass * for input [State] will be used [State]::class == I::class and any [State] with exactly the same type will pass
* requirements * requirements
* *
* @see BehaviourWithFSMStateHandlerHolder * @see BehaviourWithFSMStateHandlerHolder
@@ -157,7 +162,7 @@ class DefaultBehaviourContextWithFSM<T : State>(
actualHandlersList = additionalHandlers + handlers actualHandlersList = additionalHandlers + handlers
} }
override fun start(scope: CoroutineScope): Job = scope.launchSafelyWithoutExceptions { override fun start(scope: CoroutineScope): Job = scope.launchWithBotLogger {
val statePerformer: suspend (T) -> Unit = { state: T -> val statePerformer: suspend (T) -> Unit = { state: T ->
val newState = getSubContext(state.context).launchStateHandling(state, actualHandlersList) val newState = getSubContext(state.context).launchStateHandling(state, actualHandlersList)
if (newState != null) { if (newState != null) {
@@ -169,7 +174,7 @@ class DefaultBehaviourContextWithFSM<T : State>(
fun Job.enableRemoveOnCompletion(state: T) { fun Job.enableRemoveOnCompletion(state: T) {
invokeOnCompletion { invokeOnCompletion {
launchSafelyWithoutExceptions { launchWithBotLogger {
statesJobsMutex.withLock { statesJobsMutex.withLock {
if (this@enableRemoveOnCompletion === statesJobs[state]) { if (this@enableRemoveOnCompletion === statesJobs[state]) {
statesJobs.remove(state) statesJobs.remove(state)
@@ -179,23 +184,23 @@ class DefaultBehaviourContextWithFSM<T : State>(
} }
} }
statesManager.onStartChain.subscribeSafelyWithoutExceptions(this) { statesManager.onStartChain.subscribeWithBotLogger(this) {
statesJobsMutex.withLock { statesJobsMutex.withLock {
runCatchingSafely { statesJobs.remove(it) ?.cancel() } runCatching { statesJobs.remove(it) ?.cancel() }
statesJobs[it] = launch { statePerformer(it) }.apply { enableRemoveOnCompletion(it) } statesJobs[it] = launch { statePerformer(it) }.apply { enableRemoveOnCompletion(it) }
} }
} }
statesManager.onEndChain.subscribeSafelyWithoutExceptions(this) { statesManager.onEndChain.subscribeWithBotLogger(this) {
statesJobsMutex.withLock { statesJobsMutex.withLock {
runCatchingSafely { statesJobs.remove(it) ?.cancel() } runCatching { statesJobs.remove(it) ?.cancel() }
} }
updatesFlows.remove(it.context) ?.cancel() updatesFlows.remove(it.context) ?.cancel()
} }
statesManager.onChainStateUpdated.subscribeSafelyWithoutExceptions(this) { (old, new) -> statesManager.onChainStateUpdated.subscribeWithBotLogger(this) { (old, new) ->
statesJobsMutex.withLock { statesJobsMutex.withLock {
runCatchingSafely { statesJobs.remove(old) ?.cancel() } runCatching { statesJobs.remove(old) ?.cancel() }
runCatchingSafely { statesJobs.remove(new) ?.cancel() } runCatching { statesJobs.remove(new) ?.cancel() }
statesJobs[new] = launch { statePerformer(new) }.apply { enableRemoveOnCompletion(new) } statesJobs[new] = launch { statePerformer(new) }.apply { enableRemoveOnCompletion(new) }
} }
if (old.context != new.context) { if (old.context != new.context) {
@@ -205,7 +210,7 @@ class DefaultBehaviourContextWithFSM<T : State>(
statesManager.getActiveStates().forEach { statesManager.getActiveStates().forEach {
statesJobsMutex.withLock { statesJobsMutex.withLock {
runCatchingSafely { statesJobs.remove(it) ?.cancel() } runCatching { statesJobs.remove(it) ?.cancel() }
statesJobs[it] = launch { statePerformer(it) }.apply { enableRemoveOnCompletion(it) } statesJobs[it] = launch { statePerformer(it) }.apply { enableRemoveOnCompletion(it) }
} }
@@ -213,7 +218,7 @@ class DefaultBehaviourContextWithFSM<T : State>(
} }
/** /**
* Add NON STRICT [handler] to list of available in future [BehaviourContextWithFSM]. Non strict means that * Add NON STRICT [handler] to list of available in future [BehaviourContextWithFSM]. Non strict means that
* for input [State] will be used [KClass.isInstance] and any inheritor of [kClass] will pass this requirement * for input [State] will be used [KClass.isInstance] and any inheritor of I::class will pass this requirement
* *
* @see BehaviourWithFSMStateHandlerHolder * @see BehaviourWithFSMStateHandlerHolder
* @see BehaviourContextWithFSM.add * @see BehaviourContextWithFSM.add
@@ -223,7 +228,7 @@ class DefaultBehaviourContextWithFSM<T : State>(
/** /**
* Add STRICT [handler] to list of available in future [BehaviourContextWithFSM]. Strict means that * Add STRICT [handler] to list of available in future [BehaviourContextWithFSM]. Strict means that
* for input [State] will be used [State]::class == [kClass] and any [State] with exactly the same type will pass * for input [State] will be used [State]::class == I::class and any [State] with exactly the same type will pass
* requirements * requirements
* *
* @see BehaviourWithFSMStateHandlerHolder * @see BehaviourWithFSMStateHandlerHolder
@@ -295,6 +300,7 @@ class DefaultBehaviourContextWithFSM<T : State>(
* Extracting from [BehaviourContext.data] exists [StatesMachine] by key [DATA_FSM_KEY], which usually some [BehaviourContextWithFSM]. * Extracting from [BehaviourContext.data] exists [StatesMachine] by key [DATA_FSM_KEY], which usually some [BehaviourContextWithFSM].
* In case if value absent in [BehaviourContext.data] will return null * In case if value absent in [BehaviourContext.data] will return null
*/ */
@Suppress("UNCHECKED_CAST")
fun <T : State> BehaviourContext.fsmOrNull(): StatesMachine<T>? = data[DATA_FSM_KEY] as? StatesMachine<T> fun <T : State> BehaviourContext.fsmOrNull(): StatesMachine<T>? = data[DATA_FSM_KEY] as? StatesMachine<T>
/** /**
@@ -303,4 +309,5 @@ fun <T : State> BehaviourContext.fsmOrNull(): StatesMachine<T>? = data[DATA_FSM_
* *
* @throws NullPointerException * @throws NullPointerException
*/ */
@Suppress("RemoveExplicitTypeArguments")
fun <T : State> BehaviourContext.fsmOrThrow(): StatesMachine<T> = fsmOrNull<T>()!! fun <T : State> BehaviourContext.fsmOrThrow(): StatesMachine<T> = fsmOrNull<T>()!!

View File

@@ -14,6 +14,7 @@ import dev.inmo.tgbotapi.types.update.abstracts.Update
import dev.inmo.tgbotapi.updateshandlers.FlowsUpdatesFilter import dev.inmo.tgbotapi.updateshandlers.FlowsUpdatesFilter
import kotlinx.coroutines.* import kotlinx.coroutines.*
import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.emptyFlow
/** /**
* Creates [BehaviourContextWithFSM] via creating of [DefaultBehaviourContext] with [this] as [TelegramBot], * Creates [BehaviourContextWithFSM] via creating of [DefaultBehaviourContext] with [this] as [TelegramBot],
@@ -35,12 +36,14 @@ suspend fun <T : State> TelegramBot.buildBehaviourWithFSM(
onStateHandlingErrorHandler: StateHandlingErrorHandler<T> = defaultStateHandlingErrorHandler(), onStateHandlingErrorHandler: StateHandlingErrorHandler<T> = defaultStateHandlingErrorHandler(),
subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {}, subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {},
stateInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContextWithFSM<T>, Unit, T> = {}, stateInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContextWithFSM<T>, Unit, T> = {},
useDefaultSubcontextInitialAction: Boolean = true,
block: CustomBehaviourContextReceiver<DefaultBehaviourContextWithFSM<T>, Unit> block: CustomBehaviourContextReceiver<DefaultBehaviourContextWithFSM<T>, Unit>
): DefaultBehaviourContextWithFSM<T> = BehaviourContextWithFSM( ): DefaultBehaviourContextWithFSM<T> = BehaviourContextWithFSM(
behaviourContext = DefaultBehaviourContext( behaviourContext = BehaviourContext(
bot = this, bot = this,
scope = defaultExceptionsHandler ?.let { scope + ContextSafelyExceptionHandler(it) } ?: scope, scope = defaultExceptionsHandler ?.let { scope + ContextSafelyExceptionHandler(it) } ?: scope,
upstreamUpdatesFlow = upstreamUpdatesFlow, upstreamUpdatesFlow = upstreamUpdatesFlow ?: emptyFlow(),
useDefaultSubcontextInitialAction = useDefaultSubcontextInitialAction,
subcontextInitialAction = subcontextInitialAction subcontextInitialAction = subcontextInitialAction
), ),
handlers = presetHandlers, handlers = presetHandlers,
@@ -73,6 +76,7 @@ suspend fun <T : State> TelegramBot.buildBehaviourWithFSMAndStartLongPolling(
mediaGroupsDebounceTimeMillis: Long? = 1000L, mediaGroupsDebounceTimeMillis: Long? = 1000L,
subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {}, subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {},
stateInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContextWithFSM<T>, Unit, T> = {}, stateInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContextWithFSM<T>, Unit, T> = {},
useDefaultSubcontextInitialAction: Boolean = true,
block: CustomBehaviourContextReceiver<DefaultBehaviourContextWithFSM<T>, Unit> block: CustomBehaviourContextReceiver<DefaultBehaviourContextWithFSM<T>, Unit>
): Pair<DefaultBehaviourContextWithFSM<T>, Job> = buildBehaviourWithFSM( ): Pair<DefaultBehaviourContextWithFSM<T>, Job> = buildBehaviourWithFSM(
upstreamUpdatesFlow = upstreamUpdatesFlow, upstreamUpdatesFlow = upstreamUpdatesFlow,
@@ -84,6 +88,7 @@ suspend fun <T : State> TelegramBot.buildBehaviourWithFSMAndStartLongPolling(
onStateHandlingErrorHandler = onStateHandlingErrorHandler, onStateHandlingErrorHandler = onStateHandlingErrorHandler,
subcontextInitialAction = subcontextInitialAction, subcontextInitialAction = subcontextInitialAction,
stateInitialAction = stateInitialAction, stateInitialAction = stateInitialAction,
useDefaultSubcontextInitialAction = useDefaultSubcontextInitialAction,
block = block block = block
).run { ).run {
this to scope.launch { this to scope.launch {
@@ -120,13 +125,15 @@ suspend fun <T : State> TelegramBot.buildBehaviourWithFSM(
onStateHandlingErrorHandler: StateHandlingErrorHandler<T> = defaultStateHandlingErrorHandler(), onStateHandlingErrorHandler: StateHandlingErrorHandler<T> = defaultStateHandlingErrorHandler(),
subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {}, subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {},
stateInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContextWithFSM<T>, Unit, T> = {}, stateInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContextWithFSM<T>, Unit, T> = {},
useDefaultSubcontextInitialAction: Boolean = true,
block: CustomBehaviourContextReceiver<DefaultBehaviourContextWithFSM<T>, Unit> block: CustomBehaviourContextReceiver<DefaultBehaviourContextWithFSM<T>, Unit>
): DefaultBehaviourContextWithFSM<T> = BehaviourContextWithFSM( ): DefaultBehaviourContextWithFSM<T> = BehaviourContextWithFSM(
DefaultBehaviourContext( BehaviourContext(
this, this,
defaultExceptionsHandler ?.let { scope + ContextSafelyExceptionHandler(it) } ?: scope, defaultExceptionsHandler ?.let { scope + ContextSafelyExceptionHandler(it) } ?: scope,
upstreamUpdatesFlow = flowUpdatesFilter.allUpdatesFlow, upstreamUpdatesFlow = flowUpdatesFilter.allUpdatesFlow,
subcontextInitialAction = subcontextInitialAction subcontextInitialAction = subcontextInitialAction,
useDefaultSubcontextInitialAction = useDefaultSubcontextInitialAction
), ),
presetHandlers, presetHandlers,
statesManager, statesManager,
@@ -163,6 +170,7 @@ suspend fun <T : State> TelegramBot.buildBehaviourWithFSMAndStartLongPolling(
mediaGroupsDebounceTimeMillis: Long? = 1000L, mediaGroupsDebounceTimeMillis: Long? = 1000L,
subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {}, subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {},
stateInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContextWithFSM<T>, Unit, T> = {}, stateInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContextWithFSM<T>, Unit, T> = {},
useDefaultSubcontextInitialAction: Boolean = true,
block: CustomBehaviourContextReceiver<DefaultBehaviourContextWithFSM<T>, Unit> block: CustomBehaviourContextReceiver<DefaultBehaviourContextWithFSM<T>, Unit>
) = FlowsUpdatesFilter().let { ) = FlowsUpdatesFilter().let {
buildBehaviourWithFSM( buildBehaviourWithFSM(
@@ -175,6 +183,7 @@ suspend fun <T : State> TelegramBot.buildBehaviourWithFSMAndStartLongPolling(
onStateHandlingErrorHandler = onStateHandlingErrorHandler, onStateHandlingErrorHandler = onStateHandlingErrorHandler,
subcontextInitialAction = subcontextInitialAction, subcontextInitialAction = subcontextInitialAction,
stateInitialAction = stateInitialAction, stateInitialAction = stateInitialAction,
useDefaultSubcontextInitialAction = useDefaultSubcontextInitialAction,
block = block block = block
).run { ).run {
start() start()

View File

@@ -15,6 +15,7 @@ import dev.inmo.tgbotapi.extensions.utils.updates.retrieving.updateHandlerWithMe
import dev.inmo.tgbotapi.types.Seconds import dev.inmo.tgbotapi.types.Seconds
import dev.inmo.tgbotapi.types.update.abstracts.Update import dev.inmo.tgbotapi.types.update.abstracts.Update
import dev.inmo.tgbotapi.updateshandlers.FlowsUpdatesFilter import dev.inmo.tgbotapi.updateshandlers.FlowsUpdatesFilter
import dev.inmo.tgbotapi.utils.TelegramAPIUrlsKeeper
import dev.inmo.tgbotapi.utils.telegramBotAPIDefaultUrl import dev.inmo.tgbotapi.utils.telegramBotAPIDefaultUrl
import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Job import kotlinx.coroutines.Job
@@ -56,11 +57,14 @@ suspend fun <T : State> telegramBotWithBehaviourAndFSM(
mediaGroupsDebounceTimeMillis: Long? = 1000L, mediaGroupsDebounceTimeMillis: Long? = 1000L,
subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {}, subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {},
stateInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContextWithFSM<T>, Unit, T> = {}, stateInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContextWithFSM<T>, Unit, T> = {},
fileLinkUrlMapper: TelegramAPIUrlsKeeper.(String) -> String = { "${fileBaseUrl}/$it" },
useDefaultSubcontextInitialAction: Boolean = true,
block: CustomBehaviourContextReceiver<DefaultBehaviourContextWithFSM<T>, Unit> block: CustomBehaviourContextReceiver<DefaultBehaviourContextWithFSM<T>, Unit>
): TelegramBot = telegramBot( ): TelegramBot = telegramBot(
token, token,
apiUrl, apiUrl,
testServer, testServer,
fileLinkUrlMapper,
builder builder
).apply { ).apply {
buildBehaviourWithFSMAndStartLongPolling( buildBehaviourWithFSMAndStartLongPolling(
@@ -77,6 +81,7 @@ suspend fun <T : State> telegramBotWithBehaviourAndFSM(
mediaGroupsDebounceTimeMillis = mediaGroupsDebounceTimeMillis, mediaGroupsDebounceTimeMillis = mediaGroupsDebounceTimeMillis,
subcontextInitialAction = subcontextInitialAction, subcontextInitialAction = subcontextInitialAction,
stateInitialAction = stateInitialAction, stateInitialAction = stateInitialAction,
useDefaultSubcontextInitialAction = useDefaultSubcontextInitialAction,
block = block block = block
) )
} }
@@ -113,12 +118,15 @@ suspend fun <T : State> telegramBotWithBehaviourAndFSMAndStartLongPolling(
mediaGroupsDebounceTimeMillis: Long? = 1000L, mediaGroupsDebounceTimeMillis: Long? = 1000L,
subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {}, subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {},
stateInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContextWithFSM<T>, Unit, T> = {}, stateInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContextWithFSM<T>, Unit, T> = {},
fileLinkUrlMapper: TelegramAPIUrlsKeeper.(String) -> String = { "${fileBaseUrl}/$it" },
useDefaultSubcontextInitialAction: Boolean = true,
block: CustomBehaviourContextReceiver<DefaultBehaviourContextWithFSM<T>, Unit> block: CustomBehaviourContextReceiver<DefaultBehaviourContextWithFSM<T>, Unit>
): Pair<TelegramBot, Job> { ): Pair<TelegramBot, Job> {
return telegramBot( return telegramBot(
token, token,
apiUrl, apiUrl,
testServer, testServer,
fileLinkUrlMapper,
builder builder
).let { ).let {
it to it.buildBehaviourWithFSMAndStartLongPolling ( it to it.buildBehaviourWithFSMAndStartLongPolling (
@@ -134,6 +142,7 @@ suspend fun <T : State> telegramBotWithBehaviourAndFSMAndStartLongPolling(
mediaGroupsDebounceTimeMillis = mediaGroupsDebounceTimeMillis, mediaGroupsDebounceTimeMillis = mediaGroupsDebounceTimeMillis,
subcontextInitialAction = subcontextInitialAction, subcontextInitialAction = subcontextInitialAction,
stateInitialAction = stateInitialAction, stateInitialAction = stateInitialAction,
useDefaultSubcontextInitialAction = useDefaultSubcontextInitialAction,
block = block block = block
) )
} }

View File

@@ -1,16 +1,17 @@
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourBuildersKt { public final class dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourBuildersKt {
public static final fun buildBehaviour (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun buildBehaviour (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function3;ZLkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static synthetic fun buildBehaviour$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public static synthetic fun buildBehaviour$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function3;ZLkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
public static final fun buildBehaviourWithLongPolling (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function2;IZZLjava/lang/Long;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun buildBehaviourWithLongPolling (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function2;IZZLjava/lang/Long;Lkotlin/jvm/functions/Function3;ZLkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static synthetic fun buildBehaviourWithLongPolling$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function2;IZZLjava/lang/Long;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public static synthetic fun buildBehaviourWithLongPolling$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function2;IZZLjava/lang/Long;Lkotlin/jvm/functions/Function3;ZLkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
} }
public abstract interface class dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext : dev/inmo/tgbotapi/bot/RequestsExecutor, dev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter, kotlinx/coroutines/CoroutineScope { public abstract interface class dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext : dev/inmo/tgbotapi/bot/RequestsExecutor, dev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter, kotlinx/coroutines/CoroutineScope {
public abstract fun copy (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;ILkotlinx/coroutines/channels/BufferOverflow;Lkotlinx/coroutines/flow/Flow;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;Lkotlin/jvm/functions/Function3;)Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext; public abstract fun copy (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;ILkotlinx/coroutines/channels/BufferOverflow;Lkotlinx/coroutines/flow/Flow;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;Lkotlin/jvm/functions/Function3;)Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;
public abstract fun getBot ()Ldev/inmo/tgbotapi/bot/RequestsExecutor; public static synthetic fun copy$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;ILkotlinx/coroutines/channels/BufferOverflow;Lkotlinx/coroutines/flow/Flow;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;
public fun getBot ()Ldev/inmo/tgbotapi/bot/RequestsExecutor;
public abstract fun getData ()Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextData; public abstract fun getData ()Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextData;
public abstract fun getFlowsUpdatesFilter ()Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter; public fun getFlowsUpdatesFilter ()Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;
public abstract fun getScope ()Lkotlinx/coroutines/CoroutineScope; public fun getScope ()Lkotlinx/coroutines/CoroutineScope;
public abstract fun getSubcontextInitialAction ()Lkotlin/jvm/functions/Function3; public abstract fun getSubcontextInitialAction ()Lkotlin/jvm/functions/Function3;
public abstract fun getTriggersHolder ()Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder; public abstract fun getTriggersHolder ()Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;
} }
@@ -63,13 +64,18 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourConte
} }
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextKt { public final class dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextKt {
public static final fun BehaviourContext (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;Lkotlin/jvm/functions/Function3;)Ldev/inmo/tgbotapi/extensions/behaviour_builder/DefaultBehaviourContext; public static final fun BehaviourContext (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;Lkotlin/jvm/functions/Function3;ZLkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final fun BehaviourContext (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun BehaviourContext (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;ZLkotlin/jvm/functions/Function3;)Ldev/inmo/tgbotapi/extensions/behaviour_builder/DefaultBehaviourContext;
public static synthetic fun BehaviourContext$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Ldev/inmo/tgbotapi/extensions/behaviour_builder/DefaultBehaviourContext; public static final fun BehaviourContext (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;Lkotlinx/coroutines/flow/Flow;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;Lkotlin/jvm/functions/Function3;ZLkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static synthetic fun BehaviourContext$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ljava/lang/Object; public static final fun BehaviourContext (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;Lkotlinx/coroutines/flow/Flow;Lkotlin/jvm/functions/Function3;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;Z)Ldev/inmo/tgbotapi/extensions/behaviour_builder/DefaultBehaviourContext;
public static synthetic fun BehaviourContext$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;Lkotlin/jvm/functions/Function3;ZLkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ljava/lang/Object;
public static synthetic fun BehaviourContext$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;ZLkotlin/jvm/functions/Function3;ILjava/lang/Object;)Ldev/inmo/tgbotapi/extensions/behaviour_builder/DefaultBehaviourContext;
public static synthetic fun BehaviourContext$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;Lkotlinx/coroutines/flow/Flow;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;Lkotlin/jvm/functions/Function3;ZLkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ljava/lang/Object;
public static synthetic fun BehaviourContext$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;Lkotlinx/coroutines/flow/Flow;Lkotlin/jvm/functions/Function3;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;ZILjava/lang/Object;)Ldev/inmo/tgbotapi/extensions/behaviour_builder/DefaultBehaviourContext;
public static final fun BehaviourContextAndTwoTypesReceiver (Lkotlin/jvm/functions/Function4;)Lkotlin/jvm/functions/Function4; public static final fun BehaviourContextAndTwoTypesReceiver (Lkotlin/jvm/functions/Function4;)Lkotlin/jvm/functions/Function4;
public static final fun BehaviourContextAndTypeReceiver (Lkotlin/jvm/functions/Function3;)Lkotlin/jvm/functions/Function3; public static final fun BehaviourContextAndTypeReceiver (Lkotlin/jvm/functions/Function3;)Lkotlin/jvm/functions/Function3;
public static final fun BehaviourContextReceiver (Lkotlin/jvm/functions/Function2;)Lkotlin/jvm/functions/Function2; public static final fun BehaviourContextReceiver (Lkotlin/jvm/functions/Function2;)Lkotlin/jvm/functions/Function2;
public static final fun CustomBehaviourContextAndTypeReceiver (Lkotlin/jvm/functions/Function3;)Lkotlin/jvm/functions/Function3;
public static final fun CustomBehaviourContextReceiver (Lkotlin/jvm/functions/Function2;)Lkotlin/jvm/functions/Function2; public static final fun CustomBehaviourContextReceiver (Lkotlin/jvm/functions/Function2;)Lkotlin/jvm/functions/Function2;
public static final fun createSubContext (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlinx/coroutines/CoroutineScope;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;Lkotlinx/coroutines/flow/Flow;Lkotlin/jvm/functions/Function3;)Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext; public static final fun createSubContext (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlinx/coroutines/CoroutineScope;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;Lkotlinx/coroutines/flow/Flow;Lkotlin/jvm/functions/Function3;)Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;
public static synthetic fun createSubContext$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlinx/coroutines/CoroutineScope;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;Lkotlinx/coroutines/flow/Flow;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext; public static synthetic fun createSubContext$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlinx/coroutines/CoroutineScope;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;Lkotlinx/coroutines/flow/Flow;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;
@@ -109,8 +115,8 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/CombinedSubcon
} }
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/DefaultBehaviourContext : dev/inmo/tgbotapi/updateshandlers/AbstractFlowsUpdatesFilter, dev/inmo/tgbotapi/bot/RequestsExecutor, dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext, kotlinx/coroutines/CoroutineScope { public final class dev/inmo/tgbotapi/extensions/behaviour_builder/DefaultBehaviourContext : dev/inmo/tgbotapi/updateshandlers/AbstractFlowsUpdatesFilter, dev/inmo/tgbotapi/bot/RequestsExecutor, dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext, kotlinx/coroutines/CoroutineScope {
public fun <init> (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;ILkotlinx/coroutines/channels/BufferOverflow;Lkotlinx/coroutines/flow/Flow;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;Lkotlin/jvm/functions/Function3;)V public fun <init> (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;ILkotlinx/coroutines/channels/BufferOverflow;Lkotlinx/coroutines/flow/Flow;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextData;Lkotlin/jvm/functions/Function3;)V
public synthetic fun <init> (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;ILkotlinx/coroutines/channels/BufferOverflow;Lkotlinx/coroutines/flow/Flow;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;Lkotlin/jvm/functions/Function3;ILkotlin/jvm/internal/DefaultConstructorMarker;)V public synthetic fun <init> (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;ILkotlinx/coroutines/channels/BufferOverflow;Lkotlinx/coroutines/flow/Flow;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextData;Lkotlin/jvm/functions/Function3;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public fun close ()V public fun close ()V
public synthetic fun copy (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;ILkotlinx/coroutines/channels/BufferOverflow;Lkotlinx/coroutines/flow/Flow;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;Lkotlin/jvm/functions/Function3;)Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext; public synthetic fun copy (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;ILkotlinx/coroutines/channels/BufferOverflow;Lkotlinx/coroutines/flow/Flow;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;Lkotlin/jvm/functions/Function3;)Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;
public fun copy (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;ILkotlinx/coroutines/channels/BufferOverflow;Lkotlinx/coroutines/flow/Flow;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;Lkotlin/jvm/functions/Function3;)Ldev/inmo/tgbotapi/extensions/behaviour_builder/DefaultBehaviourContext; public fun copy (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;ILkotlinx/coroutines/channels/BufferOverflow;Lkotlinx/coroutines/flow/Flow;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;Lkotlin/jvm/functions/Function3;)Ldev/inmo/tgbotapi/extensions/behaviour_builder/DefaultBehaviourContext;
@@ -133,10 +139,10 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/DefaultCorouti
} }
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/TelegramBotKt { public final class dev/inmo/tgbotapi/extensions/behaviour_builder/TelegramBotKt {
public static final fun telegramBotWithBehaviour (Ljava/lang/String;Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;Lkotlinx/coroutines/CoroutineScope;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;ZLkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun telegramBotWithBehaviour (Ljava/lang/String;Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;Lkotlinx/coroutines/CoroutineScope;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;ZLkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;ZLkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static synthetic fun telegramBotWithBehaviour$default (Ljava/lang/String;Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;Lkotlinx/coroutines/CoroutineScope;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;ZLkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public static synthetic fun telegramBotWithBehaviour$default (Ljava/lang/String;Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;Lkotlinx/coroutines/CoroutineScope;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;ZLkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;ZLkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
public static final fun telegramBotWithBehaviourAndLongPolling (Ljava/lang/String;Lkotlinx/coroutines/CoroutineScope;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;ZIZZLjava/lang/Long;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun telegramBotWithBehaviourAndLongPolling (Ljava/lang/String;Lkotlinx/coroutines/CoroutineScope;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;ZIZZLjava/lang/Long;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;ZLkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static synthetic fun telegramBotWithBehaviourAndLongPolling$default (Ljava/lang/String;Lkotlinx/coroutines/CoroutineScope;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;ZIZZLjava/lang/Long;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public static synthetic fun telegramBotWithBehaviourAndLongPolling$default (Ljava/lang/String;Lkotlinx/coroutines/CoroutineScope;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;ZIZZLjava/lang/Long;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;ZLkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
} }
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/VariantsKt { public final class dev/inmo/tgbotapi/extensions/behaviour_builder/VariantsKt {
@@ -145,7 +151,7 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/VariantsKt {
public static final fun oneOf (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;[Lkotlinx/coroutines/Deferred;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun oneOf (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;[Lkotlinx/coroutines/Deferred;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static final fun oneOfActions (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/Iterable;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun oneOfActions (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/Iterable;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static final fun oneOfActions (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;[Ldev/inmo/micro_utils/coroutines/DeferredAction;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun oneOfActions (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;[Ldev/inmo/micro_utils/coroutines/DeferredAction;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static final fun parallel (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun parallel (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/Deferred;
public static final fun withAction (Lkotlinx/coroutines/Deferred;Lkotlin/jvm/functions/Function2;)Ldev/inmo/micro_utils/coroutines/DeferredAction; public static final fun withAction (Lkotlinx/coroutines/Deferred;Lkotlin/jvm/functions/Function2;)Ldev/inmo/micro_utils/coroutines/DeferredAction;
} }
@@ -333,12 +339,12 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/W
public static final fun requireCommandAtStart (Lkotlinx/coroutines/flow/Flow;)Lkotlinx/coroutines/flow/Flow; public static final fun requireCommandAtStart (Lkotlinx/coroutines/flow/Flow;)Lkotlinx/coroutines/flow/Flow;
public static final fun requireCommandsWithoutParams (Lkotlinx/coroutines/flow/Flow;)Lkotlinx/coroutines/flow/Flow; public static final fun requireCommandsWithoutParams (Lkotlinx/coroutines/flow/Flow;)Lkotlinx/coroutines/flow/Flow;
public static final fun requireSingleCommand (Lkotlinx/coroutines/flow/Flow;)Lkotlinx/coroutines/flow/Flow; public static final fun requireSingleCommand (Lkotlinx/coroutines/flow/Flow;)Lkotlinx/coroutines/flow/Flow;
public static final fun waitCommandMessage (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow; public static final fun waitCommandMessage (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;Ldev/inmo/tgbotapi/requests/abstracts/Request;ZLkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
public static final fun waitCommandMessage (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow; public static final fun waitCommandMessage (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/requests/abstracts/Request;ZLkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
public static final fun waitCommandMessage (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow; public static final fun waitCommandMessage (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Ldev/inmo/tgbotapi/requests/abstracts/Request;ZLkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
public static synthetic fun waitCommandMessage$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow; public static synthetic fun waitCommandMessage$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;Ldev/inmo/tgbotapi/requests/abstracts/Request;ZLkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
public static synthetic fun waitCommandMessage$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow; public static synthetic fun waitCommandMessage$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/requests/abstracts/Request;ZLkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
public static synthetic fun waitCommandMessage$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow; public static synthetic fun waitCommandMessage$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Ldev/inmo/tgbotapi/requests/abstracts/Request;ZLkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
} }
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitContentKt { public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitContentKt {
@@ -484,12 +490,12 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/W
} }
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitDeepLinksKt { public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitDeepLinksKt {
public static final fun waitDeepLinks (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow; public static final fun waitDeepLinks (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;ZLkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
public static final fun waitDeepLinks (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow; public static final fun waitDeepLinks (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/requests/abstracts/Request;ZLkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
public static final fun waitDeepLinks (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow; public static final fun waitDeepLinks (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Ldev/inmo/tgbotapi/requests/abstracts/Request;ZLkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
public static synthetic fun waitDeepLinks$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow; public static synthetic fun waitDeepLinks$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;ZLkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
public static synthetic fun waitDeepLinks$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow; public static synthetic fun waitDeepLinks$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/requests/abstracts/Request;ZLkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
public static synthetic fun waitDeepLinks$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow; public static synthetic fun waitDeepLinks$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Ldev/inmo/tgbotapi/requests/abstracts/Request;ZLkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
} }
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitDeletedBusinessMessagesKt { public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitDeletedBusinessMessagesKt {
@@ -506,6 +512,8 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/W
public static synthetic fun waitEditedAudio$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 waitEditedAudio$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 waitEditedAudioMediaGroupContent (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 waitEditedAudioMediaGroupContent (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 waitEditedAudioMediaGroupContent$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 waitEditedAudioMediaGroupContent$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 waitEditedChecklistContent (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 waitEditedChecklistContent$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 waitEditedContact (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 waitEditedContact (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 waitEditedContact$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 waitEditedContact$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 waitEditedContentMessage (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 waitEditedContentMessage (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
@@ -563,6 +571,8 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/W
public static synthetic fun waitEditedAudioMediaGroupContentMessage$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 waitEditedAudioMediaGroupContentMessage$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 waitEditedAudioMessage (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 waitEditedAudioMessage (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 waitEditedAudioMessage$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 waitEditedAudioMessage$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 waitEditedChecklistMessage (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 waitEditedChecklistMessage$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 waitEditedContactMessage (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 waitEditedContactMessage (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 waitEditedContactMessage$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 waitEditedContactMessage$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 waitEditedDiceMessage (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 waitEditedDiceMessage (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
@@ -612,6 +622,8 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/W
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitEventActionKt { public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitEventActionKt {
public static final fun waitChannelChatCreatedEvents (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 waitChannelChatCreatedEvents (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 waitChannelChatCreatedEvents$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 waitChannelChatCreatedEvents$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 waitChannelDirectMessagesConfigurationChanged (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 waitChannelDirectMessagesConfigurationChanged$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 waitChannelEvents (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 waitChannelEvents (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 waitChannelEvents$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 waitChannelEvents$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 waitChatBackgroundSet (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 waitChatBackgroundSet (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
@@ -624,6 +636,10 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/W
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;
public static synthetic fun waitChatSharedRequest$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 waitChatSharedRequest$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 waitChecklistTasksAdded (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 waitChecklistTasksAdded$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 waitChecklistTasksDone (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 waitChecklistTasksDone$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 waitCommonEvents (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 waitCommonEvents (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 waitCommonEvents$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 waitCommonEvents$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 waitDeleteChatPhotoEvents (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 waitDeleteChatPhotoEvents (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
@@ -676,6 +692,16 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/W
public static synthetic fun waitRegularGiftSentOrReceived$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow; public static 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;
@@ -1140,42 +1166,42 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handl
} }
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/CommandHandlingKt { public final class dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/CommandHandlingKt {
public static final fun command (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job; public static final fun command (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;ZLkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
public static final fun command (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job; public static final fun command (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;ZLkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
public static final fun command (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job; public static final fun command (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;ZLkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
public static synthetic fun command$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job; public static synthetic fun command$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;ZLkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
public static synthetic fun command$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job; public static synthetic fun command$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;ZLkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
public static synthetic fun command$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job; public static synthetic fun command$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;ZLkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
public static final fun commandWithArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job; public static final fun commandWithArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job;
public static final fun commandWithArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job; public static final fun commandWithArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job;
public static final fun commandWithArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job; public static final fun commandWithArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job;
public static synthetic fun commandWithArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job; public static synthetic fun commandWithArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
public static synthetic fun commandWithArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job; public static synthetic fun commandWithArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
public static synthetic fun commandWithArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job; public static synthetic fun commandWithArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
public static final fun commandWithNamedArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job; public static final fun commandWithNamedArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job;
public static final fun commandWithNamedArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job; public static final fun commandWithNamedArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job;
public static final fun commandWithNamedArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job; public static final fun commandWithNamedArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job;
public static synthetic fun commandWithNamedArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job; public static synthetic fun commandWithNamedArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
public static synthetic fun commandWithNamedArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job; public static synthetic fun commandWithNamedArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
public static synthetic fun commandWithNamedArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job; public static synthetic fun commandWithNamedArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
public static final fun onCommand (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job; public static final fun onCommand (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;ZLkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
public static final fun onCommand (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job; public static final fun onCommand (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;ZLkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
public static final fun onCommand (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job; public static final fun onCommand (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;ZLkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
public static synthetic fun onCommand$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job; public static synthetic fun onCommand$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;ZLkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
public static synthetic fun onCommand$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job; public static synthetic fun onCommand$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;ZLkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
public static synthetic fun onCommand$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job; public static synthetic fun onCommand$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;ZLkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
public static final fun onCommandWithArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job; public static final fun onCommandWithArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job;
public static final fun onCommandWithArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job; public static final fun onCommandWithArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job;
public static final fun onCommandWithArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job; public static final fun onCommandWithArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job;
public static synthetic fun onCommandWithArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job; public static synthetic fun onCommandWithArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
public static synthetic fun onCommandWithArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job; public static synthetic fun onCommandWithArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
public static synthetic fun onCommandWithArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job; public static synthetic fun onCommandWithArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
public static final fun onCommandWithNamedArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job; public static final fun onCommandWithNamedArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job;
public static final fun onCommandWithNamedArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job; public static final fun onCommandWithNamedArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job;
public static final fun onCommandWithNamedArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job; public static final fun onCommandWithNamedArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job;
public static synthetic fun onCommandWithNamedArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job; public static synthetic fun onCommandWithNamedArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
public static synthetic fun onCommandWithNamedArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job; public static synthetic fun onCommandWithNamedArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
public static synthetic fun onCommandWithNamedArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job; public static synthetic fun onCommandWithNamedArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
} }
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/CommandHandlingUnhandledKt { public final class dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/CommandHandlingUnhandledKt {
@@ -1196,6 +1222,8 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handl
public static synthetic fun onAudio$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 onAudio$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 onAudioMediaGroup (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 onAudioMediaGroup (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 onAudioMediaGroup$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 onAudioMediaGroup$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 onChecklistContent (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 onChecklistContent$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 onContact (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 onContact (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 onContact$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 onContact$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 onContentMessage (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 onContentMessage (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;
@@ -1277,6 +1305,8 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handl
public static synthetic fun onEditedAudio$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 onEditedAudio$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 onEditedAudioMediaGroup (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 onEditedAudioMediaGroup (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 onEditedAudioMediaGroup$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 onEditedAudioMediaGroup$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 onEditedChecklist (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 onEditedChecklist$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 onEditedContact (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 onEditedContact (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 onEditedContact$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 onEditedContact$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 onEditedContentMessage (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 onEditedContentMessage (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;
@@ -1318,6 +1348,8 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handl
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/EventTriggersKt { public final class dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/EventTriggersKt {
public static final fun onChannelChatCreated (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 onChannelChatCreated (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 onChannelChatCreated$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job; public static synthetic fun onChannelChatCreated$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
public static final fun onChannelDirectMessagesConfigurationChanged (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 onChannelDirectMessagesConfigurationChanged$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 onChannelEvent (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job; public static final fun onChannelEvent (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
public static synthetic fun onChannelEvent$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job; public static synthetic fun onChannelEvent$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
public static final fun onChatBackgroundSet (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job; public static final fun onChatBackgroundSet (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
@@ -1330,6 +1362,10 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handl
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;
public static synthetic fun onChatSharedRequest$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 onChatSharedRequest$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 onChecklistTasksAdded (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 onChecklistTasksAdded$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 onChecklistTasksDone (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 onChecklistTasksDone$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 onCommonEvent (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 onCommonEvent (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 onCommonEvent$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 onCommonEvent$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 onDeleteChatPhoto (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 onDeleteChatPhoto (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;
@@ -1382,6 +1418,16 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handl
public static synthetic fun onRegularGiftSentOrReceived$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job; public static 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;
@@ -1566,6 +1612,32 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handl
public static synthetic fun onShippingQuery$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job; public static synthetic fun onShippingQuery$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
} }
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/utils/DefaultCustomBehaviourContextAndTypeReceiver : kotlin/coroutines/jvm/internal/SuspendFunction, kotlin/jvm/functions/Function3 {
public static final field BOT_INFO_RECEIVER Ljava/lang/String;
public static final field Companion Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/DefaultCustomBehaviourContextAndTypeReceiver$Companion;
public fun <init> (Lkotlin/jvm/functions/Function3;)V
public fun invoke (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/update/abstracts/Update;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public final fun invoke (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextData;)V
public synthetic fun invoke (Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
}
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/utils/DefaultCustomBehaviourContextAndTypeReceiver$Companion {
}
public abstract interface class dev/inmo/tgbotapi/extensions/behaviour_builder/utils/DefaultCustomBehaviourContextAndTypeReceiver$IReceiver {
public abstract fun invoke (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
}
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/utils/DefaultCustomBehaviourContextAndTypeReceiverKt {
public static final fun botInfo (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static final fun containsCommand (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ljava/util/List;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static final fun containsCommand (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Ljava/util/List;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static final fun containsCommand (Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static final fun containsCommand (Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static final fun optionallyWithDefaultReceiver (Lkotlin/jvm/functions/Function3;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextData;)Lkotlin/jvm/functions/Function3;
public static final fun withDefaultReceiver (Lkotlin/jvm/functions/Function3;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextData;)Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/DefaultCustomBehaviourContextAndTypeReceiver;
}
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/utils/LiveLocationKt { public final class dev/inmo/tgbotapi/extensions/behaviour_builder/utils/LiveLocationKt {
public static final fun followLocation (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/message/abstracts/ContentMessage;Lkotlin/jvm/functions/Function3;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun followLocation (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/message/abstracts/ContentMessage;Lkotlin/jvm/functions/Function3;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
} }

View File

@@ -3,6 +3,8 @@ package dev.inmo.tgbotapi.extensions.behaviour_builder
import dev.inmo.micro_utils.coroutines.ContextSafelyExceptionHandler import dev.inmo.micro_utils.coroutines.ContextSafelyExceptionHandler
import dev.inmo.micro_utils.coroutines.ExceptionHandler import dev.inmo.micro_utils.coroutines.ExceptionHandler
import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.DefaultCustomBehaviourContextAndTypeReceiver
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.optionallyWithDefaultReceiver
import dev.inmo.tgbotapi.extensions.utils.updates.retrieving.longPolling import dev.inmo.tgbotapi.extensions.utils.updates.retrieving.longPolling
import dev.inmo.tgbotapi.extensions.utils.updates.retrieving.startGettingOfUpdatesByLongPolling import dev.inmo.tgbotapi.extensions.utils.updates.retrieving.startGettingOfUpdatesByLongPolling
import dev.inmo.tgbotapi.extensions.utils.updates.retrieving.updateHandlerWithMediaGroupsAdaptation import dev.inmo.tgbotapi.extensions.utils.updates.retrieving.updateHandlerWithMediaGroupsAdaptation
@@ -31,6 +33,7 @@ suspend fun TelegramBot.buildBehaviour(
scope: CoroutineScope = defaultCoroutineScopeProvider(), scope: CoroutineScope = defaultCoroutineScopeProvider(),
defaultExceptionsHandler: ExceptionHandler<Unit>? = null, defaultExceptionsHandler: ExceptionHandler<Unit>? = null,
subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {}, subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {},
useDefaultSubcontextInitialAction: Boolean = true,
block: BehaviourContextReceiver<Unit> block: BehaviourContextReceiver<Unit>
): BehaviourContext = BehaviourContext( ): BehaviourContext = BehaviourContext(
bot = this, bot = this,
@@ -42,6 +45,7 @@ suspend fun TelegramBot.buildBehaviour(
} }
}, },
flowsUpdatesFilter = flowUpdatesFilter, flowsUpdatesFilter = flowUpdatesFilter,
useDefaultSubcontextInitialAction = useDefaultSubcontextInitialAction,
subcontextInitialAction = subcontextInitialAction subcontextInitialAction = subcontextInitialAction
).apply { ).apply {
block() block()
@@ -67,12 +71,14 @@ suspend fun TelegramBot.buildBehaviourWithLongPolling(
autoSkipTimeoutExceptions: Boolean = true, autoSkipTimeoutExceptions: Boolean = true,
mediaGroupsDebounceTimeMillis: Long? = 1000L, mediaGroupsDebounceTimeMillis: Long? = 1000L,
subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {}, subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {},
useDefaultSubcontextInitialAction: Boolean = true,
block: BehaviourContextReceiver<Unit> block: BehaviourContextReceiver<Unit>
): Job { ): Job {
val behaviourContext = buildBehaviour( val behaviourContext = buildBehaviour(
scope = scope, scope = scope,
defaultExceptionsHandler = defaultExceptionsHandler, defaultExceptionsHandler = defaultExceptionsHandler,
subcontextInitialAction = subcontextInitialAction, subcontextInitialAction = subcontextInitialAction,
useDefaultSubcontextInitialAction = useDefaultSubcontextInitialAction,
block = block block = block
) )
return longPolling( return longPolling(
@@ -81,6 +87,7 @@ suspend fun TelegramBot.buildBehaviourWithLongPolling(
timeoutSeconds = timeoutSeconds, timeoutSeconds = timeoutSeconds,
autoDisableWebhooks = autoDisableWebhooks, autoDisableWebhooks = autoDisableWebhooks,
autoSkipTimeoutExceptions = autoSkipTimeoutExceptions, autoSkipTimeoutExceptions = autoSkipTimeoutExceptions,
mediaGroupsDebounceTimeMillis = mediaGroupsDebounceTimeMillis mediaGroupsDebounceTimeMillis = mediaGroupsDebounceTimeMillis,
exceptionsHandler = defaultExceptionsHandler
) )
} }

View File

@@ -2,13 +2,14 @@
package dev.inmo.tgbotapi.extensions.behaviour_builder package dev.inmo.tgbotapi.extensions.behaviour_builder
import dev.inmo.kslog.common.KSLog
import dev.inmo.micro_utils.coroutines.* import dev.inmo.micro_utils.coroutines.*
import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.handlers_registrar.TriggersHolder import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.handlers_registrar.TriggersHolder
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.optionallyWithDefaultReceiver
import dev.inmo.tgbotapi.types.UpdateId import dev.inmo.tgbotapi.types.UpdateId
import dev.inmo.tgbotapi.types.update.abstracts.Update import dev.inmo.tgbotapi.types.update.abstracts.Update
import dev.inmo.tgbotapi.updateshandlers.* import dev.inmo.tgbotapi.updateshandlers.*
import dev.inmo.tgbotapi.utils.launchWithBotLogger
import kotlinx.coroutines.* import kotlinx.coroutines.*
import kotlinx.coroutines.channels.BufferOverflow import kotlinx.coroutines.channels.BufferOverflow
import kotlinx.coroutines.flow.* import kotlinx.coroutines.flow.*
@@ -23,6 +24,7 @@ typealias CustomBehaviourContextAndTwoTypesReceiver<BC, T, I1, I2> = suspend BC.
typealias BehaviourContextAndTwoTypesReceiver<T, I1, I2> = CustomBehaviourContextAndTwoTypesReceiver<BehaviourContext, T, I1, I2> typealias BehaviourContextAndTwoTypesReceiver<T, I1, I2> = CustomBehaviourContextAndTwoTypesReceiver<BehaviourContext, T, I1, I2>
inline fun <T> BehaviourContextReceiver(noinline block: BehaviourContextReceiver<T>) = block inline fun <T> BehaviourContextReceiver(noinline block: BehaviourContextReceiver<T>) = block
inline fun <BC, T> CustomBehaviourContextReceiver(noinline block: CustomBehaviourContextReceiver<BC, T>) = block inline fun <BC, T> CustomBehaviourContextReceiver(noinline block: CustomBehaviourContextReceiver<BC, T>) = block
inline fun <BC, T, I> CustomBehaviourContextAndTypeReceiver(noinline block: CustomBehaviourContextAndTypeReceiver<BC, T, I>) = block
inline fun <T, I> BehaviourContextAndTypeReceiver(noinline block: BehaviourContextAndTypeReceiver<T, I>) = block inline fun <T, I> BehaviourContextAndTypeReceiver(noinline block: BehaviourContextAndTypeReceiver<T, I>) = block
inline fun <T, I1, I2> BehaviourContextAndTwoTypesReceiver(noinline block: BehaviourContextAndTwoTypesReceiver<T, I1, I2>) = block inline fun <T, I1, I2> BehaviourContextAndTwoTypesReceiver(noinline block: BehaviourContextAndTwoTypesReceiver<T, I1, I2>) = block
internal inline fun <BC, T, I1, I2> CustomBehaviourContextAndTwoTypesReceiver<BC, T, I1, I2>.toOneType( internal inline fun <BC, T, I1, I2> CustomBehaviourContextAndTwoTypesReceiver<BC, T, I1, I2>.toOneType(
@@ -81,6 +83,7 @@ class DefaultBehaviourContext(
onBufferOverflow: BufferOverflow = BufferOverflow.SUSPEND, onBufferOverflow: BufferOverflow = BufferOverflow.SUSPEND,
private val upstreamUpdatesFlow: Flow<Update>? = null, private val upstreamUpdatesFlow: Flow<Update>? = null,
override val triggersHolder: TriggersHolder = TriggersHolder(), override val triggersHolder: TriggersHolder = TriggersHolder(),
override val data: BehaviourContextData = BehaviourContextData(),
override val subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {} override val subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {}
) : AbstractFlowsUpdatesFilter(), TelegramBot by bot, CoroutineScope by scope, BehaviourContext { ) : AbstractFlowsUpdatesFilter(), TelegramBot by bot, CoroutineScope by scope, BehaviourContext {
@@ -105,8 +108,6 @@ class DefaultBehaviourContext(
}.accumulatorFlow(WeakScope(scope)) }.accumulatorFlow(WeakScope(scope))
override val asUpdateReceiver: UpdateReceiver<Update> = additionalUpdatesSharedFlow::emit override val asUpdateReceiver: UpdateReceiver<Update> = additionalUpdatesSharedFlow::emit
override val data: BehaviourContextData = BehaviourContextData()
override fun copy( override fun copy(
bot: TelegramBot, bot: TelegramBot,
scope: CoroutineScope, scope: CoroutineScope,
@@ -122,6 +123,7 @@ class DefaultBehaviourContext(
onBufferOverflow = onBufferOverflow, onBufferOverflow = onBufferOverflow,
upstreamUpdatesFlow = upstreamUpdatesFlow, upstreamUpdatesFlow = upstreamUpdatesFlow,
triggersHolder = triggersHolder, triggersHolder = triggersHolder,
data = BehaviourContextData().apply { include(this@DefaultBehaviourContext.data) },
subcontextInitialAction = subcontextInitialAction subcontextInitialAction = subcontextInitialAction
).apply { ).apply {
data.include(this@DefaultBehaviourContext.data) data.include(this@DefaultBehaviourContext.data)
@@ -133,8 +135,19 @@ fun BehaviourContext(
scope: CoroutineScope, scope: CoroutineScope,
flowsUpdatesFilter: FlowsUpdatesFilter = FlowsUpdatesFilter(), flowsUpdatesFilter: FlowsUpdatesFilter = FlowsUpdatesFilter(),
triggersHolder: TriggersHolder = TriggersHolder(), triggersHolder: TriggersHolder = TriggersHolder(),
useDefaultSubcontextInitialAction: Boolean = true,
subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {} subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {}
) = DefaultBehaviourContext(bot, scope, upstreamUpdatesFlow = flowsUpdatesFilter.allUpdatesFlow, triggersHolder = triggersHolder, subcontextInitialAction = subcontextInitialAction) ): DefaultBehaviourContext {
val data = BehaviourContextData()
return DefaultBehaviourContext(
bot = bot,
scope = scope,
upstreamUpdatesFlow = flowsUpdatesFilter.allUpdatesFlow,
triggersHolder = triggersHolder,
data = data,
subcontextInitialAction = subcontextInitialAction.optionallyWithDefaultReceiver(useDefaultSubcontextInitialAction, data)
)
}
inline fun <T> BehaviourContext( inline fun <T> BehaviourContext(
bot: TelegramBot, bot: TelegramBot,
@@ -142,14 +155,65 @@ inline fun <T> BehaviourContext(
flowsUpdatesFilter: FlowsUpdatesFilter = FlowsUpdatesFilter(), flowsUpdatesFilter: FlowsUpdatesFilter = FlowsUpdatesFilter(),
triggersHolder: TriggersHolder = TriggersHolder(), triggersHolder: TriggersHolder = TriggersHolder(),
noinline subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {}, noinline subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {},
useDefaultSubcontextInitialAction: Boolean = true,
crossinline block: BehaviourContext.() -> T crossinline block: BehaviourContext.() -> T
) = DefaultBehaviourContext(bot, scope, upstreamUpdatesFlow = flowsUpdatesFilter.allUpdatesFlow, triggersHolder = triggersHolder, subcontextInitialAction = subcontextInitialAction).run(block) ): T {
val data = BehaviourContextData()
return DefaultBehaviourContext(
bot = bot,
scope = scope,
upstreamUpdatesFlow = flowsUpdatesFilter.allUpdatesFlow,
triggersHolder = triggersHolder,
data = data,
subcontextInitialAction = subcontextInitialAction.optionallyWithDefaultReceiver(useDefaultSubcontextInitialAction, data)
).run(block)
}
inline fun <T> BehaviourContext(
bot: TelegramBot,
scope: CoroutineScope,
upstreamUpdatesFlow: Flow<Update>,
triggersHolder: TriggersHolder = TriggersHolder(),
noinline subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {},
useDefaultSubcontextInitialAction: Boolean = true,
crossinline block: BehaviourContext.() -> T
): T {
val data = BehaviourContextData()
return DefaultBehaviourContext(
bot = bot,
scope = scope,
upstreamUpdatesFlow = upstreamUpdatesFlow,
triggersHolder = triggersHolder,
data = data,
subcontextInitialAction = subcontextInitialAction.optionallyWithDefaultReceiver(useDefaultSubcontextInitialAction, data)
).run(block)
}
fun BehaviourContext(
bot: TelegramBot,
scope: CoroutineScope,
upstreamUpdatesFlow: Flow<Update>,
subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update>,
triggersHolder: TriggersHolder = TriggersHolder(),
useDefaultSubcontextInitialAction: Boolean = true
): DefaultBehaviourContext {
val data = BehaviourContextData()
return DefaultBehaviourContext(
bot = bot,
scope = scope,
upstreamUpdatesFlow = upstreamUpdatesFlow,
triggersHolder = triggersHolder,
data = data,
subcontextInitialAction = subcontextInitialAction.optionallyWithDefaultReceiver(useDefaultSubcontextInitialAction, data)
)
}
/** /**
* Creates new [BehaviourContext] using its [BehaviourContext.copy] method * Creates new [BehaviourContext] using its [BehaviourContext.copy] method
* *
* @param updatesFilter This param will not be used anymore * @param updatesFilter This param will not be used anymore
*/ */
@Suppress("UNCHECKED_CAST")
fun <BC : BehaviourContext> BC.createSubContext( fun <BC : BehaviourContext> BC.createSubContext(
scope: CoroutineScope = LinkedSupervisorScope(), scope: CoroutineScope = LinkedSupervisorScope(),
triggersHolder: TriggersHolder = this.triggersHolder, triggersHolder: TriggersHolder = this.triggersHolder,
@@ -165,7 +229,7 @@ fun <BC : BehaviourContext> BC.createSubContext(
) as BC ) as BC
/** /**
* Launch [behaviourContextReceiver] in context of [this] as [BehaviourContext] and as [kotlin.coroutines.CoroutineContext] * Launch [behaviourContextReceiver] in context of [this] as [BehaviourContext] and as [CoroutineContext]
* *
* [this] [BehaviourContext] will **NOT** be closed automatically * [this] [BehaviourContext] will **NOT** be closed automatically
*/ */
@@ -178,7 +242,7 @@ suspend fun <T, BC : BehaviourContext> BC.doInContext(
} }
/** /**
* Launch [behaviourContextReceiver] in context of [this] as [BehaviourContext] and as [kotlin.coroutines.CoroutineContext] * Launch [behaviourContextReceiver] in context of [this] as [BehaviourContext] and as [CoroutineContext]
* *
* [this] [BehaviourContext] will **NOT** be closed automatically * [this] [BehaviourContext] will **NOT** be closed automatically
*/ */
@@ -200,7 +264,7 @@ suspend fun <T, BC : BehaviourContext> BC.doInNewSubContext(
} }
/** /**
* Launch [behaviourContextReceiver] in context of [this] as [BehaviourContext] and as [kotlin.coroutines.CoroutineContext] * Launch [behaviourContextReceiver] in context of [this] as [BehaviourContext] and as [CoroutineContext]
* *
* [this] [BehaviourContext] will **NOT** be closed automatically * [this] [BehaviourContext] will **NOT** be closed automatically
*/ */
@@ -217,7 +281,7 @@ fun <T, BC : BehaviourContext> BC.launchInNewSubContext(
updatesUpstreamFlow = updatesUpstreamFlow, updatesUpstreamFlow = updatesUpstreamFlow,
subcontextInitialAction = subcontextInitialAction subcontextInitialAction = subcontextInitialAction
).apply { ).apply {
this@apply.launchLoggingDropExceptions(logger = Log) { this@apply.launchWithBotLogger {
behaviourContextReceiver() behaviourContextReceiver()
} }
}.coroutineContext.job }.coroutineContext.job

View File

@@ -1,3 +1,5 @@
@file:Suppress("unused")
package dev.inmo.tgbotapi.extensions.behaviour_builder package dev.inmo.tgbotapi.extensions.behaviour_builder
import dev.inmo.micro_utils.coroutines.ExceptionHandler import dev.inmo.micro_utils.coroutines.ExceptionHandler
@@ -9,6 +11,7 @@ import dev.inmo.tgbotapi.extensions.utils.updates.retrieving.updateHandlerWithMe
import dev.inmo.tgbotapi.types.Seconds import dev.inmo.tgbotapi.types.Seconds
import dev.inmo.tgbotapi.types.update.abstracts.Update import dev.inmo.tgbotapi.types.update.abstracts.Update
import dev.inmo.tgbotapi.updateshandlers.FlowsUpdatesFilter import dev.inmo.tgbotapi.updateshandlers.FlowsUpdatesFilter
import dev.inmo.tgbotapi.utils.TelegramAPIUrlsKeeper
import dev.inmo.tgbotapi.utils.telegramBotAPIDefaultUrl import dev.inmo.tgbotapi.utils.telegramBotAPIDefaultUrl
import kotlinx.coroutines.* import kotlinx.coroutines.*
import kotlin.coroutines.coroutineContext import kotlin.coroutines.coroutineContext
@@ -35,11 +38,14 @@ suspend fun telegramBotWithBehaviour(
defaultExceptionsHandler: ExceptionHandler<Unit>? = null, defaultExceptionsHandler: ExceptionHandler<Unit>? = null,
testServer: Boolean = false, testServer: Boolean = false,
subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {}, subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {},
fileLinkUrlMapper: TelegramAPIUrlsKeeper.(String) -> String = { "${fileBaseUrl}/$it" },
useDefaultSubcontextInitialAction: Boolean = true,
block: BehaviourContextReceiver<Unit> block: BehaviourContextReceiver<Unit>
): TelegramBot = telegramBot( ): TelegramBot = telegramBot(
token, token,
apiUrl, apiUrl,
testServer, testServer,
fileLinkUrlMapper,
builder builder
).apply { ).apply {
buildBehaviour( buildBehaviour(
@@ -47,6 +53,7 @@ suspend fun telegramBotWithBehaviour(
scope = scope ?: CoroutineScope(coroutineContext), scope = scope ?: CoroutineScope(coroutineContext),
defaultExceptionsHandler = defaultExceptionsHandler, defaultExceptionsHandler = defaultExceptionsHandler,
subcontextInitialAction = subcontextInitialAction, subcontextInitialAction = subcontextInitialAction,
useDefaultSubcontextInitialAction = useDefaultSubcontextInitialAction,
block = block block = block
) )
} }
@@ -80,12 +87,15 @@ suspend fun telegramBotWithBehaviourAndLongPolling(
autoSkipTimeoutExceptions: Boolean = true, autoSkipTimeoutExceptions: Boolean = true,
mediaGroupsDebounceTimeMillis: Long? = 1000L, mediaGroupsDebounceTimeMillis: Long? = 1000L,
subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {}, subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {},
fileLinkUrlMapper: TelegramAPIUrlsKeeper.(String) -> String = { "${fileBaseUrl}/$it" },
useDefaultSubcontextInitialAction: Boolean = true,
block: BehaviourContextReceiver<Unit> block: BehaviourContextReceiver<Unit>
): Pair<TelegramBot, Job> { ): Pair<TelegramBot, Job> {
return telegramBot( return telegramBot(
token, token,
apiUrl, apiUrl,
testServer, testServer,
fileLinkUrlMapper,
builder builder
).let { ).let {
it to it.buildBehaviourWithLongPolling( it to it.buildBehaviourWithLongPolling(
@@ -96,6 +106,7 @@ suspend fun telegramBotWithBehaviourAndLongPolling(
autoSkipTimeoutExceptions = autoSkipTimeoutExceptions, autoSkipTimeoutExceptions = autoSkipTimeoutExceptions,
mediaGroupsDebounceTimeMillis = mediaGroupsDebounceTimeMillis, mediaGroupsDebounceTimeMillis = mediaGroupsDebounceTimeMillis,
subcontextInitialAction = subcontextInitialAction, subcontextInitialAction = subcontextInitialAction,
useDefaultSubcontextInitialAction = useDefaultSubcontextInitialAction,
block = block block = block
) )
} }

View File

@@ -1,3 +1,5 @@
@file:Suppress("unused")
package dev.inmo.tgbotapi.extensions.behaviour_builder package dev.inmo.tgbotapi.extensions.behaviour_builder
import dev.inmo.micro_utils.coroutines.DeferredAction import dev.inmo.micro_utils.coroutines.DeferredAction
@@ -5,15 +7,15 @@ import dev.inmo.micro_utils.coroutines.invokeFirstOf
import kotlinx.coroutines.Deferred import kotlinx.coroutines.Deferred
import kotlinx.coroutines.async import kotlinx.coroutines.async
suspend fun <T> BehaviourContext.parallel( fun <T> BehaviourContext.parallel(
action: BehaviourContextReceiver<T> action: BehaviourContextReceiver<T>
) = async { ) = async {
action() action()
} }
inline infix fun <T, O> Deferred<T>.withAction(noinline callback: suspend (T) -> O) = DeferredAction(this, callback) infix fun <T, O> Deferred<T>.withAction(callback: suspend (T) -> O) = DeferredAction(this, callback)
inline fun <T> Deferred<T>.asAction() = DeferredAction(this) { it } fun <T> Deferred<T>.asAction() = DeferredAction(this) { it }
suspend fun <O> BehaviourContext.oneOfActions( suspend fun <O> BehaviourContext.oneOfActions(
deferredActions: Iterable<DeferredAction<*, O>> deferredActions: Iterable<DeferredAction<*, O>>

View File

@@ -44,7 +44,7 @@ fun <T> FlowsUpdatesFilter.expectFlow(
if (result.isFailure || result.getOrThrow().isEmpty()) { if (result.isFailure || result.getOrThrow().isEmpty()) {
if (cancelTrigger(it)) { if (cancelTrigger(it)) {
cancelRequestFactory(it) ?.also { cancelRequestFactory(it) ?.also {
safelyWithResult { bot.execute(it) } runCatching { bot.execute(it) }
throw cancelledByFilterException throw cancelledByFilterException
} }
} }

View File

@@ -1,3 +1,5 @@
@file:Suppress("unused")
package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
@@ -10,9 +12,9 @@ import dev.inmo.tgbotapi.utils.RiskFeature
import dev.inmo.tgbotapi.utils.lowLevelRiskFeatureMessage import dev.inmo.tgbotapi.utils.lowLevelRiskFeatureMessage
import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.Flow
inline fun BehaviourContext.waitChatMessageReactionsCountUpdated( fun BehaviourContext.waitChatMessageReactionsCountUpdated(
initRequest: Request<*>? = null, initRequest: Request<*>? = null,
noinline errorFactory: NullableRequestBuilder<*> = { null } errorFactory: NullableRequestBuilder<*> = { null }
): Flow<ChatMessageReactionsCountUpdated> = expectFlow( ): Flow<ChatMessageReactionsCountUpdated> = expectFlow(
initRequest, initRequest,
errorFactory errorFactory

View File

@@ -1,6 +1,9 @@
@file:Suppress("OPT_IN_USAGE")
package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.containsCommand
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.handlers_registrar.doWithRegistration import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.handlers_registrar.doWithRegistration
import dev.inmo.tgbotapi.extensions.utils.* import dev.inmo.tgbotapi.extensions.utils.*
import dev.inmo.tgbotapi.extensions.utils.extensions.TelegramBotCommandsDefaults import dev.inmo.tgbotapi.extensions.utils.extensions.TelegramBotCommandsDefaults
@@ -25,6 +28,7 @@ import kotlinx.coroutines.flow.*
fun BehaviourContext.waitCommandMessage( fun BehaviourContext.waitCommandMessage(
commandRegex: Regex, commandRegex: Regex,
initRequest: Request<*>? = null, initRequest: Request<*>? = null,
excludeCommandsToOtherBots: Boolean = true,
errorFactory: NullableRequestBuilder<*> = { null } errorFactory: NullableRequestBuilder<*> = { null }
) = channelFlow { ) = channelFlow {
triggersHolder.handleableCommandsHolder.doWithRegistration( triggersHolder.handleableCommandsHolder.doWithRegistration(
@@ -32,6 +36,16 @@ fun BehaviourContext.waitCommandMessage(
) { ) {
waitTextMessage(initRequest, errorFactory).filter { waitTextMessage(initRequest, errorFactory).filter {
it.content.textSources.any { it.botCommandTextSourceOrNull() ?.command ?.matches(commandRegex) == true } it.content.textSources.any { it.botCommandTextSourceOrNull() ?.command ?.matches(commandRegex) == true }
}.let {
if (excludeCommandsToOtherBots) {
it.filter {
with(it.content.textSources) {
containsCommand(commandRegex)
}
}
} else {
it
}
}.collect { }.collect {
send(it) send(it)
} }
@@ -41,14 +55,16 @@ fun BehaviourContext.waitCommandMessage(
fun BehaviourContext.waitCommandMessage( fun BehaviourContext.waitCommandMessage(
command: String, command: String,
initRequest: Request<*>? = null, initRequest: Request<*>? = null,
excludeCommandsToOtherBots: Boolean = true,
errorFactory: NullableRequestBuilder<*> = { null } errorFactory: NullableRequestBuilder<*> = { null }
) = waitCommandMessage(Regex(command), initRequest, errorFactory) ) = waitCommandMessage(Regex(command), initRequest, excludeCommandsToOtherBots, errorFactory)
fun BehaviourContext.waitCommandMessage( fun BehaviourContext.waitCommandMessage(
botCommand: BotCommand, botCommand: BotCommand,
initRequest: Request<*>? = null, initRequest: Request<*>? = null,
excludeCommandsToOtherBots: Boolean = true,
errorFactory: NullableRequestBuilder<*> = { null } errorFactory: NullableRequestBuilder<*> = { null }
) = waitCommandMessage(botCommand.command, initRequest, errorFactory) ) = waitCommandMessage(botCommand.command, initRequest, excludeCommandsToOtherBots, errorFactory)
fun Flow<CommonMessage<TextContent>>.requireCommandAtStart() = filter { fun Flow<CommonMessage<TextContent>>.requireCommandAtStart() = filter {
it.content.textSources.firstOrNull() is BotCommandTextSource it.content.textSources.firstOrNull() is BotCommandTextSource

View File

@@ -10,11 +10,13 @@ import kotlinx.coroutines.flow.*
fun BehaviourContext.waitDeepLinks( fun BehaviourContext.waitDeepLinks(
initRequest: Request<*>? = null, initRequest: Request<*>? = null,
excludeCommandsToOtherBots: Boolean = true,
errorFactory: NullableRequestBuilder<*> = { null }, errorFactory: NullableRequestBuilder<*> = { null },
): Flow<Pair<CommonMessage<TextContent>, String>> = waitCommandMessage( ): Flow<Pair<CommonMessage<TextContent>, String>> = waitCommandMessage(
"start", command = "start",
initRequest, initRequest = initRequest,
errorFactory excludeCommandsToOtherBots = excludeCommandsToOtherBots,
errorFactory = errorFactory
) )
.requireSingleCommand() .requireSingleCommand()
.requireCommandAtStart() .requireCommandAtStart()
@@ -25,13 +27,24 @@ fun BehaviourContext.waitDeepLinks(
fun BehaviourContext.waitDeepLinks( fun BehaviourContext.waitDeepLinks(
regex: Regex, regex: Regex,
initRequest: Request<*>? = null, initRequest: Request<*>? = null,
excludeCommandsToOtherBots: Boolean = true,
errorFactory: NullableRequestBuilder<*> = { null }, errorFactory: NullableRequestBuilder<*> = { null },
): Flow<Pair<CommonMessage<TextContent>, String>> = waitDeepLinks(initRequest, errorFactory).filter { ): Flow<Pair<CommonMessage<TextContent>, String>> = waitDeepLinks(
initRequest = initRequest,
excludeCommandsToOtherBots = excludeCommandsToOtherBots,
errorFactory = errorFactory
).filter {
regex.matches(it.second) regex.matches(it.second)
} }
fun BehaviourContext.waitDeepLinks( fun BehaviourContext.waitDeepLinks(
deepLink: String, deepLink: String,
initRequest: Request<*>? = null, initRequest: Request<*>? = null,
excludeCommandsToOtherBots: Boolean = true,
errorFactory: NullableRequestBuilder<*> = { null }, errorFactory: NullableRequestBuilder<*> = { null },
): Flow<Pair<CommonMessage<TextContent>, String>> = waitDeepLinks(Regex("^$deepLink$"), initRequest, errorFactory) ): Flow<Pair<CommonMessage<TextContent>, String>> = waitDeepLinks(
regex = Regex(pattern = "^$deepLink$"),
initRequest = initRequest,
excludeCommandsToOtherBots = excludeCommandsToOtherBots,
errorFactory = errorFactory
)

View File

@@ -128,3 +128,8 @@ fun BehaviourContext.waitEditedGiveawayPublicResultsContent(
errorFactory: NullableRequestBuilder<*> = { null } errorFactory: NullableRequestBuilder<*> = { null }
) = waitEditedContent<GiveawayPublicResultsContent>(initRequest, errorFactory) ) = waitEditedContent<GiveawayPublicResultsContent>(initRequest, errorFactory)
fun BehaviourContext.waitEditedChecklistContent(
initRequest: Request<*>? = null,
errorFactory: NullableRequestBuilder<*> = { null }
) = waitEditedContent<ChecklistContent>(initRequest, errorFactory)

View File

@@ -141,3 +141,9 @@ fun BehaviourContext.waitEditedGiveawayPublicResultsContentMessage(
errorFactory: NullableRequestBuilder<*> = { null } errorFactory: NullableRequestBuilder<*> = { null }
) = waitEditedContentMessage<GiveawayPublicResultsContent>(initRequest, errorFactory) ) = waitEditedContentMessage<GiveawayPublicResultsContent>(initRequest, errorFactory)
fun BehaviourContext.waitEditedChecklistMessage(
initRequest: Request<*>? = null,
errorFactory: NullableRequestBuilder<*> = { null }
) = waitEditedContentMessage<ChecklistContent>(initRequest, errorFactory)

View File

@@ -5,8 +5,11 @@ 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.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.ChecklistTasksDone
import dev.inmo.tgbotapi.types.gifts.GiftSentOrReceived import dev.inmo.tgbotapi.types.gifts.GiftSentOrReceived
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
@@ -19,6 +22,12 @@ import dev.inmo.tgbotapi.types.message.ChatEvents.forum.ForumTopicReopened
import dev.inmo.tgbotapi.types.message.ChatEvents.forum.GeneralForumTopicHidden import dev.inmo.tgbotapi.types.message.ChatEvents.forum.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.SuggestedPostInfo
import dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostPaid
import dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostRefunded
import dev.inmo.tgbotapi.types.message.ChatEvents.voice.* import dev.inmo.tgbotapi.types.message.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
@@ -264,3 +273,43 @@ fun BehaviourContext.waitUniqueGiftSentOrReceived(
initRequest: Request<*>? = null, initRequest: Request<*>? = null,
errorFactory: NullableRequestBuilder<*> = { null } errorFactory: NullableRequestBuilder<*> = { null }
) = waitEvents<GiftSentOrReceived.Unique>(initRequest, errorFactory) ) = waitEvents<GiftSentOrReceived.Unique>(initRequest, errorFactory)
fun BehaviourContext.waitChecklistTasksDone(
initRequest: Request<*>? = null,
errorFactory: NullableRequestBuilder<*> = { null }
) = waitEvents<ChecklistTasksDone>(initRequest, errorFactory)
fun BehaviourContext.waitChecklistTasksAdded(
initRequest: Request<*>? = null,
errorFactory: NullableRequestBuilder<*> = { null }
) = waitEvents<ChecklistTasksAdded>(initRequest, errorFactory)
fun BehaviourContext.waitChannelDirectMessagesConfigurationChanged(
initRequest: Request<*>? = null,
errorFactory: NullableRequestBuilder<*> = { null }
) = 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

@@ -1,3 +1,5 @@
@file:Suppress("unused")
package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
@@ -17,7 +19,8 @@ inline fun <reified T : MediaGroupPartContent> BehaviourContext.buildMediaGroupW
noinline errorFactory: NullableRequestBuilder<*> = { null } noinline errorFactory: NullableRequestBuilder<*> = { null }
): Flow<MediaGroupContent<T>> = flowsUpdatesFilter.expectFlow(bot, initRequest, errorFactory) { update -> ): Flow<MediaGroupContent<T>> = flowsUpdatesFilter.expectFlow(bot, initRequest, errorFactory) { update ->
update.baseSentMessageUpdateOrNull() ?.data ?.commonMessageOrNull() ?.withContentOrNull<MediaGroupContent<*>>() ?.let { message -> update.baseSentMessageUpdateOrNull() ?.data ?.commonMessageOrNull() ?.withContentOrNull<MediaGroupContent<*>>() ?.let { message ->
if (message.content.group.all { it is T }) { if (message.content.group.all { it.content is T }) {
@Suppress("UNCHECKED_CAST")
listOf(message.content as MediaGroupContent<T>) listOf(message.content as MediaGroupContent<T>)
} else { } else {
null null

View File

@@ -17,7 +17,8 @@ inline fun <reified T : MediaGroupPartContent> BehaviourContext.buildMediaGroupM
noinline errorFactory: NullableRequestBuilder<*> = { null } noinline errorFactory: NullableRequestBuilder<*> = { null }
): Flow<MediaGroupMessage<T>> = flowsUpdatesFilter.expectFlow(bot, initRequest, errorFactory) { update -> ): Flow<MediaGroupMessage<T>> = flowsUpdatesFilter.expectFlow(bot, initRequest, errorFactory) { update ->
update.baseSentMessageUpdateOrNull() ?.data ?.commonMessageOrNull() ?.withContentOrNull<MediaGroupContent<*>>() ?.let { message -> update.baseSentMessageUpdateOrNull() ?.data ?.commonMessageOrNull() ?.withContentOrNull<MediaGroupContent<*>>() ?.let { message ->
if (message.content.group.all { it is T }) { if (message.content.group.all { it.content is T }) {
@Suppress("UNCHECKED_CAST")
listOf(message as MediaGroupMessage<T>) listOf(message as MediaGroupMessage<T>)
} else { } else {
null null

View File

@@ -2,8 +2,6 @@
package dev.inmo.tgbotapi.extensions.behaviour_builder.triggers_handling package dev.inmo.tgbotapi.extensions.behaviour_builder.triggers_handling
import dev.inmo.micro_utils.coroutines.launchSafelyWithoutExceptions
import dev.inmo.micro_utils.coroutines.runCatchingSafely
import dev.inmo.tgbotapi.extensions.behaviour_builder.* import dev.inmo.tgbotapi.extensions.behaviour_builder.*
import dev.inmo.tgbotapi.extensions.behaviour_builder.filters.CallbackQueryFilterByUser import dev.inmo.tgbotapi.extensions.behaviour_builder.filters.CallbackQueryFilterByUser
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter
@@ -13,6 +11,7 @@ import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times
import dev.inmo.tgbotapi.extensions.utils.callbackQueryUpdateOrNull import dev.inmo.tgbotapi.extensions.utils.callbackQueryUpdateOrNull
import dev.inmo.tgbotapi.types.queries.callback.* import dev.inmo.tgbotapi.types.queries.callback.*
import dev.inmo.tgbotapi.types.update.abstracts.Update import dev.inmo.tgbotapi.types.update.abstracts.Update
import dev.inmo.tgbotapi.utils.launchWithBotLogger
import kotlinx.coroutines.Job import kotlinx.coroutines.Job
internal inline fun <BC : BehaviourContext, reified T : CallbackQuery> BC.onCallbackQuery( internal inline fun <BC : BehaviourContext, reified T : CallbackQuery> BC.onCallbackQuery(
@@ -63,7 +62,7 @@ internal inline fun <BC : BehaviourContext, reified T : DataCallbackQuery> BC.on
this@launchInNewSubContext.triggersHolder.handleableCallbackQueriesDataHolder.registerHandleable(newInitialFilterInvoke) this@launchInNewSubContext.triggersHolder.handleableCallbackQueriesDataHolder.registerHandleable(newInitialFilterInvoke)
it.invokeOnCompletion { it.invokeOnCompletion {
runCatching { runCatching {
launchSafelyWithoutExceptions { launchWithBotLogger {
this@launchInNewSubContext.triggersHolder.handleableCallbackQueriesDataHolder.unregisterHandleable(newInitialFilterInvoke) this@launchInNewSubContext.triggersHolder.handleableCallbackQueriesDataHolder.unregisterHandleable(newInitialFilterInvoke)
} }
} }

View File

@@ -2,13 +2,11 @@
package dev.inmo.tgbotapi.extensions.behaviour_builder.triggers_handling package dev.inmo.tgbotapi.extensions.behaviour_builder.triggers_handling
import dev.inmo.kslog.common.KSLog
import dev.inmo.micro_utils.coroutines.launchLoggingDropExceptions
import dev.inmo.micro_utils.coroutines.launchSafelyWithoutExceptions
import dev.inmo.micro_utils.coroutines.runCatchingSafely
import dev.inmo.tgbotapi.extensions.behaviour_builder.* import dev.inmo.tgbotapi.extensions.behaviour_builder.*
import dev.inmo.tgbotapi.extensions.behaviour_builder.filters.CommonMessageFilterExcludeMediaGroups import dev.inmo.tgbotapi.extensions.behaviour_builder.filters.CommonMessageFilterExcludeMediaGroups
import dev.inmo.tgbotapi.extensions.behaviour_builder.filters.MessageFilterByChat import dev.inmo.tgbotapi.extensions.behaviour_builder.filters.MessageFilterByChat
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.botInfo
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.containsCommand
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.ByChatMessageMarkerFactory import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.ByChatMessageMarkerFactory
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times
@@ -19,7 +17,9 @@ import dev.inmo.tgbotapi.extensions.utils.extensions.parseCommandsWithNamedArgs
import dev.inmo.tgbotapi.types.BotCommand import dev.inmo.tgbotapi.types.BotCommand
import dev.inmo.tgbotapi.types.message.content.TextContent import dev.inmo.tgbotapi.types.message.content.TextContent
import dev.inmo.tgbotapi.types.message.content.TextMessage import dev.inmo.tgbotapi.types.message.content.TextMessage
import dev.inmo.tgbotapi.types.message.textsources.BotCommandTextSource
import dev.inmo.tgbotapi.types.update.abstracts.Update import dev.inmo.tgbotapi.types.update.abstracts.Update
import dev.inmo.tgbotapi.utils.launchWithBotLogger
import kotlinx.coroutines.Job import kotlinx.coroutines.Job
import kotlinx.coroutines.job import kotlinx.coroutines.job
@@ -30,6 +30,7 @@ internal fun <BC : BehaviourContext> BC.commandUncounted(
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null, additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
excludeCommandsToOtherBots: Boolean = true,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage>
): Job = onText( ): Job = onText(
CommonMessageFilter<TextContent> { message -> CommonMessageFilter<TextContent> { message ->
@@ -43,6 +44,16 @@ internal fun <BC : BehaviourContext> BC.commandUncounted(
sizeRequirement && textSources.any { sizeRequirement && textSources.any {
commandRegex.matches(it.botCommandTextSourceOrNull() ?.command ?: return@any false) commandRegex.matches(it.botCommandTextSourceOrNull() ?.command ?: return@any false)
} }
}.let {
if (excludeCommandsToOtherBots) {
it * lambda@{
with(it.content.textSources) {
containsCommand(commandRegex)
}
}
} else {
it
}
}.let { }.let {
initialFilter ?.times(it) ?: it initialFilter ?.times(it) ?: it
}, },
@@ -59,17 +70,19 @@ fun <BC : BehaviourContext> BC.command(
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null, additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
excludeCommandsToOtherBots: Boolean = true,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage>
): Job = launchInNewSubContext { ): Job = launchInNewSubContext {
runCatching { runCatching {
this@launchInNewSubContext.commandUncounted( this@launchInNewSubContext.commandUncounted(
commandRegex, commandRegex = commandRegex,
requireOnlyCommandInMessage, requireOnlyCommandInMessage = requireOnlyCommandInMessage,
initialFilter, initialFilter = initialFilter,
subcontextUpdatesFilter, subcontextUpdatesFilter = subcontextUpdatesFilter,
markerFactory, markerFactory = markerFactory,
additionalSubcontextInitialAction, additionalSubcontextInitialAction = additionalSubcontextInitialAction,
scenarioReceiver excludeCommandsToOtherBots = excludeCommandsToOtherBots,
scenarioReceiver = scenarioReceiver
) )
}.onFailure { }.onFailure {
triggersHolder.handleableCommandsHolder.unregisterHandleable(commandRegex) triggersHolder.handleableCommandsHolder.unregisterHandleable(commandRegex)
@@ -77,7 +90,7 @@ fun <BC : BehaviourContext> BC.command(
triggersHolder.handleableCommandsHolder.registerHandleable(commandRegex) triggersHolder.handleableCommandsHolder.registerHandleable(commandRegex)
it.invokeOnCompletion { it.invokeOnCompletion {
runCatching { runCatching {
launchSafelyWithoutExceptions { launchWithBotLogger {
triggersHolder.handleableCommandsHolder.unregisterHandleable(commandRegex) triggersHolder.handleableCommandsHolder.unregisterHandleable(commandRegex)
} }
} }
@@ -97,8 +110,18 @@ fun <BC : BehaviourContext> BC.command(
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null, additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
excludeCommandsToOtherBots: Boolean = true,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage>
) = command(command.toRegex(), requireOnlyCommandInMessage, initialFilter, subcontextUpdatesFilter, markerFactory, additionalSubcontextInitialAction, scenarioReceiver) ) = command(
commandRegex = command.toRegex(),
requireOnlyCommandInMessage = requireOnlyCommandInMessage,
initialFilter = initialFilter,
subcontextUpdatesFilter = subcontextUpdatesFilter,
markerFactory = markerFactory,
additionalSubcontextInitialAction = additionalSubcontextInitialAction,
excludeCommandsToOtherBots = excludeCommandsToOtherBots,
scenarioReceiver = scenarioReceiver
)
/** /**
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
@@ -112,8 +135,18 @@ fun <BC : BehaviourContext> BC.command(
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null, additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
excludeCommandsToOtherBots: Boolean = true,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage>
) = command(botCommand.command, requireOnlyCommandInMessage, initialFilter, subcontextUpdatesFilter, markerFactory, additionalSubcontextInitialAction, scenarioReceiver) ) = command(
command = botCommand.command,
requireOnlyCommandInMessage = requireOnlyCommandInMessage,
initialFilter = initialFilter,
subcontextUpdatesFilter = subcontextUpdatesFilter,
markerFactory = markerFactory,
additionalSubcontextInitialAction = additionalSubcontextInitialAction,
excludeCommandsToOtherBots = excludeCommandsToOtherBots,
scenarioReceiver = scenarioReceiver
)
/** /**
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
@@ -127,8 +160,18 @@ fun <BC : BehaviourContext> BC.onCommand(
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null, additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
excludeCommandsToOtherBots: Boolean = true,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage>
): Job = command(commandRegex, requireOnlyCommandInMessage, initialFilter, subcontextUpdatesFilter, markerFactory, additionalSubcontextInitialAction, scenarioReceiver) ): Job = command(
commandRegex = commandRegex,
requireOnlyCommandInMessage = requireOnlyCommandInMessage,
initialFilter = initialFilter,
subcontextUpdatesFilter = subcontextUpdatesFilter,
markerFactory = markerFactory,
additionalSubcontextInitialAction = additionalSubcontextInitialAction,
excludeCommandsToOtherBots = excludeCommandsToOtherBots,
scenarioReceiver = scenarioReceiver
)
/** /**
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
@@ -142,8 +185,18 @@ fun <BC : BehaviourContext> BC.onCommand(
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null, additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
excludeCommandsToOtherBots: Boolean = true,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage>
): Job = onCommand(command.toRegex(), requireOnlyCommandInMessage, initialFilter, subcontextUpdatesFilter, markerFactory, additionalSubcontextInitialAction, scenarioReceiver) ): Job = onCommand(
commandRegex = command.toRegex(),
requireOnlyCommandInMessage = requireOnlyCommandInMessage,
initialFilter = initialFilter,
subcontextUpdatesFilter = subcontextUpdatesFilter,
markerFactory = markerFactory,
additionalSubcontextInitialAction = additionalSubcontextInitialAction,
excludeCommandsToOtherBots = excludeCommandsToOtherBots,
scenarioReceiver = scenarioReceiver
)
/** /**
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
@@ -157,8 +210,18 @@ fun <BC : BehaviourContext> BC.onCommand(
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null, additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
excludeCommandsToOtherBots: Boolean = true,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage>
): Job = onCommand(botCommand.command, requireOnlyCommandInMessage, initialFilter, subcontextUpdatesFilter, markerFactory, additionalSubcontextInitialAction, scenarioReceiver) ): Job = onCommand(
command = botCommand.command,
requireOnlyCommandInMessage = requireOnlyCommandInMessage,
initialFilter = initialFilter,
subcontextUpdatesFilter = subcontextUpdatesFilter,
markerFactory = markerFactory,
additionalSubcontextInitialAction = additionalSubcontextInitialAction,
excludeCommandsToOtherBots = excludeCommandsToOtherBots,
scenarioReceiver = scenarioReceiver
)
/** /**
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
@@ -172,13 +235,15 @@ fun <BC : BehaviourContext> BC.commandWithArgs(
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null, additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex, argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
excludeCommandsToOtherBots: Boolean = true,
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>> scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>>
) = command( ) = command(
commandRegex, commandRegex,
requireOnlyCommandInMessage = false, requireOnlyCommandInMessage = false,
initialFilter = initialFilter, initialFilter = initialFilter,
subcontextUpdatesFilter = subcontextUpdatesFilter, subcontextUpdatesFilter = subcontextUpdatesFilter,
markerFactory = markerFactory markerFactory = markerFactory,
excludeCommandsToOtherBots = excludeCommandsToOtherBots,
) { ) {
val args = it.parseCommandsWithArgs(argsSeparator = argsSeparator).let { commandsWithArgs -> val args = it.parseCommandsWithArgs(argsSeparator = argsSeparator).let { commandsWithArgs ->
val key = commandsWithArgs.keys.firstOrNull { it.matches(commandRegex) } ?: return@let null val key = commandsWithArgs.keys.firstOrNull { it.matches(commandRegex) } ?: return@let null
@@ -199,6 +264,7 @@ fun <BC : BehaviourContext> BC.commandWithArgs(
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null, additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex, argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
excludeCommandsToOtherBots: Boolean = true,
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>> scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>>
) = commandWithArgs( ) = commandWithArgs(
command.toRegex(), command.toRegex(),
@@ -206,6 +272,7 @@ fun <BC : BehaviourContext> BC.commandWithArgs(
subcontextUpdatesFilter = subcontextUpdatesFilter, subcontextUpdatesFilter = subcontextUpdatesFilter,
markerFactory = markerFactory, markerFactory = markerFactory,
argsSeparator = argsSeparator, argsSeparator = argsSeparator,
excludeCommandsToOtherBots = excludeCommandsToOtherBots,
scenarioReceiver = scenarioReceiver scenarioReceiver = scenarioReceiver
) )
@@ -221,6 +288,7 @@ fun <BC : BehaviourContext> BC.commandWithArgs(
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null, additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex, argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
excludeCommandsToOtherBots: Boolean = true,
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>> scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>>
) = commandWithArgs( ) = commandWithArgs(
botCommand.command, botCommand.command,
@@ -228,6 +296,7 @@ fun <BC : BehaviourContext> BC.commandWithArgs(
subcontextUpdatesFilter = subcontextUpdatesFilter, subcontextUpdatesFilter = subcontextUpdatesFilter,
markerFactory = markerFactory, markerFactory = markerFactory,
argsSeparator = argsSeparator, argsSeparator = argsSeparator,
excludeCommandsToOtherBots = excludeCommandsToOtherBots,
scenarioReceiver = scenarioReceiver scenarioReceiver = scenarioReceiver
) )
@@ -244,12 +313,14 @@ fun <BC : BehaviourContext> BC.commandWithNamedArgs(
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null, additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex, argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex, nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex,
excludeCommandsToOtherBots: Boolean = true,
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, List<Pair<String, String>>> scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, List<Pair<String, String>>>
) = command( ) = command(
commandRegex, commandRegex,
requireOnlyCommandInMessage = false, requireOnlyCommandInMessage = false,
initialFilter = initialFilter, initialFilter = initialFilter,
subcontextUpdatesFilter = subcontextUpdatesFilter, subcontextUpdatesFilter = subcontextUpdatesFilter,
excludeCommandsToOtherBots = excludeCommandsToOtherBots,
markerFactory = markerFactory markerFactory = markerFactory
) { ) {
val args = it.parseCommandsWithNamedArgs(argsSeparator = argsSeparator, nameArgSeparator = nameArgSeparator).let { commandsWithArgs -> val args = it.parseCommandsWithNamedArgs(argsSeparator = argsSeparator, nameArgSeparator = nameArgSeparator).let { commandsWithArgs ->
@@ -272,6 +343,7 @@ fun <BC : BehaviourContext> BC.commandWithNamedArgs(
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null, additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex, argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex, nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex,
excludeCommandsToOtherBots: Boolean = true,
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, List<Pair<String, String>>> scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, List<Pair<String, String>>>
) = commandWithNamedArgs( ) = commandWithNamedArgs(
command.toRegex(), command.toRegex(),
@@ -280,6 +352,7 @@ fun <BC : BehaviourContext> BC.commandWithNamedArgs(
markerFactory = markerFactory, markerFactory = markerFactory,
argsSeparator = argsSeparator, argsSeparator = argsSeparator,
nameArgSeparator = nameArgSeparator, nameArgSeparator = nameArgSeparator,
excludeCommandsToOtherBots = excludeCommandsToOtherBots,
scenarioReceiver = scenarioReceiver scenarioReceiver = scenarioReceiver
) )
@@ -296,6 +369,7 @@ fun <BC : BehaviourContext> BC.commandWithNamedArgs(
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null, additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex, argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex, nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex,
excludeCommandsToOtherBots: Boolean = true,
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, List<Pair<String, String>>> scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, List<Pair<String, String>>>
) = commandWithNamedArgs( ) = commandWithNamedArgs(
botCommand.command, botCommand.command,
@@ -304,6 +378,7 @@ fun <BC : BehaviourContext> BC.commandWithNamedArgs(
markerFactory = markerFactory, markerFactory = markerFactory,
argsSeparator = argsSeparator, argsSeparator = argsSeparator,
nameArgSeparator = nameArgSeparator, nameArgSeparator = nameArgSeparator,
excludeCommandsToOtherBots = excludeCommandsToOtherBots,
scenarioReceiver = scenarioReceiver scenarioReceiver = scenarioReceiver
) )
@@ -319,6 +394,7 @@ fun <BC : BehaviourContext> BC.onCommandWithArgs(
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null, additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex, argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
excludeCommandsToOtherBots: Boolean = true,
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>> scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>>
): Job = commandWithArgs( ): Job = commandWithArgs(
commandRegex = commandRegex, commandRegex = commandRegex,
@@ -326,6 +402,7 @@ fun <BC : BehaviourContext> BC.onCommandWithArgs(
subcontextUpdatesFilter = subcontextUpdatesFilter, subcontextUpdatesFilter = subcontextUpdatesFilter,
markerFactory = markerFactory, markerFactory = markerFactory,
argsSeparator = argsSeparator, argsSeparator = argsSeparator,
excludeCommandsToOtherBots = excludeCommandsToOtherBots,
scenarioReceiver = scenarioReceiver scenarioReceiver = scenarioReceiver
) )
@@ -341,6 +418,7 @@ fun <BC : BehaviourContext> BC.onCommandWithArgs(
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null, additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex, argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
excludeCommandsToOtherBots: Boolean = true,
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>> scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>>
): Job = onCommandWithArgs( ): Job = onCommandWithArgs(
commandRegex = command.toRegex(), commandRegex = command.toRegex(),
@@ -348,6 +426,7 @@ fun <BC : BehaviourContext> BC.onCommandWithArgs(
subcontextUpdatesFilter = subcontextUpdatesFilter, subcontextUpdatesFilter = subcontextUpdatesFilter,
markerFactory = markerFactory, markerFactory = markerFactory,
argsSeparator = argsSeparator, argsSeparator = argsSeparator,
excludeCommandsToOtherBots = excludeCommandsToOtherBots,
scenarioReceiver = scenarioReceiver scenarioReceiver = scenarioReceiver
) )
@@ -363,6 +442,7 @@ fun <BC : BehaviourContext> BC.onCommandWithArgs(
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null, additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex, argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
excludeCommandsToOtherBots: Boolean = true,
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>> scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>>
): Job = onCommandWithArgs( ): Job = onCommandWithArgs(
command = botCommand.command, command = botCommand.command,
@@ -370,6 +450,7 @@ fun <BC : BehaviourContext> BC.onCommandWithArgs(
subcontextUpdatesFilter = subcontextUpdatesFilter, subcontextUpdatesFilter = subcontextUpdatesFilter,
markerFactory = markerFactory, markerFactory = markerFactory,
argsSeparator = argsSeparator, argsSeparator = argsSeparator,
excludeCommandsToOtherBots = excludeCommandsToOtherBots,
scenarioReceiver = scenarioReceiver scenarioReceiver = scenarioReceiver
) )
@@ -386,6 +467,7 @@ fun <BC : BehaviourContext> BC.onCommandWithNamedArgs(
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null, additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex, argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex, nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex,
excludeCommandsToOtherBots: Boolean = true,
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, List<Pair<String, String>>> scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, List<Pair<String, String>>>
) = commandWithNamedArgs( ) = commandWithNamedArgs(
commandRegex, commandRegex,
@@ -394,6 +476,7 @@ fun <BC : BehaviourContext> BC.onCommandWithNamedArgs(
markerFactory = markerFactory, markerFactory = markerFactory,
argsSeparator = argsSeparator, argsSeparator = argsSeparator,
nameArgSeparator = nameArgSeparator, nameArgSeparator = nameArgSeparator,
excludeCommandsToOtherBots = excludeCommandsToOtherBots,
scenarioReceiver = scenarioReceiver, scenarioReceiver = scenarioReceiver,
) )
@@ -410,6 +493,7 @@ fun <BC : BehaviourContext> BC.onCommandWithNamedArgs(
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null, additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex, argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex, nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex,
excludeCommandsToOtherBots: Boolean = true,
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, List<Pair<String, String>>> scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, List<Pair<String, String>>>
) = onCommandWithNamedArgs( ) = onCommandWithNamedArgs(
command.toRegex(), command.toRegex(),
@@ -418,6 +502,7 @@ fun <BC : BehaviourContext> BC.onCommandWithNamedArgs(
markerFactory = markerFactory, markerFactory = markerFactory,
argsSeparator = argsSeparator, argsSeparator = argsSeparator,
nameArgSeparator = nameArgSeparator, nameArgSeparator = nameArgSeparator,
excludeCommandsToOtherBots = excludeCommandsToOtherBots,
scenarioReceiver = scenarioReceiver scenarioReceiver = scenarioReceiver
) )
@@ -434,6 +519,7 @@ fun <BC : BehaviourContext> BC.onCommandWithNamedArgs(
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null, additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex, argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex, nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex,
excludeCommandsToOtherBots: Boolean = true,
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, List<Pair<String, String>>> scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, List<Pair<String, String>>>
) = onCommandWithNamedArgs( ) = onCommandWithNamedArgs(
botCommand.command, botCommand.command,
@@ -442,5 +528,6 @@ fun <BC : BehaviourContext> BC.onCommandWithNamedArgs(
markerFactory = markerFactory, markerFactory = markerFactory,
argsSeparator = argsSeparator, argsSeparator = argsSeparator,
nameArgSeparator = nameArgSeparator, nameArgSeparator = nameArgSeparator,
excludeCommandsToOtherBots = excludeCommandsToOtherBots,
scenarioReceiver = scenarioReceiver scenarioReceiver = scenarioReceiver
) )

View File

@@ -899,3 +899,33 @@ fun <BC : BehaviourContext> BC.onPaidMediaInfoContent(
additionalSubcontextInitialAction, additionalSubcontextInitialAction,
scenarioReceiver 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.onChecklistContent(
initialFilter: CommonMessageFilter<ChecklistContent>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChecklistMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in ChecklistMessage, Any>? = ByChatMessageMarkerFactory,
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, ChecklistMessage>? = null,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChecklistMessage>
) = onContentMessageWithType(
initialFilter,
subcontextUpdatesFilter,
markerFactory,
additionalSubcontextInitialAction,
scenarioReceiver
)

View File

@@ -15,6 +15,7 @@ import dev.inmo.tgbotapi.types.message.content.TextContent
import dev.inmo.tgbotapi.types.message.content.TextMessage import dev.inmo.tgbotapi.types.message.content.TextMessage
import dev.inmo.tgbotapi.types.message.textsources.RegularTextSource import dev.inmo.tgbotapi.types.message.textsources.RegularTextSource
import dev.inmo.tgbotapi.types.update.abstracts.Update import dev.inmo.tgbotapi.types.update.abstracts.Update
import dev.inmo.tgbotapi.utils.launchWithBotLogger
import io.ktor.http.decodeURLQueryComponent import io.ktor.http.decodeURLQueryComponent
import kotlinx.coroutines.Job import kotlinx.coroutines.Job
@@ -43,7 +44,7 @@ fun <BC : BehaviourContext> BC.onDeepLink(
}.also { }.also {
triggersHolder.handleableCommandsHolder.registerHandleable(startRegex) triggersHolder.handleableCommandsHolder.registerHandleable(startRegex)
it.invokeOnCompletion { it.invokeOnCompletion {
this@onDeepLink.launchSafelyWithoutExceptions { triggersHolder.handleableCommandsHolder.unregisterHandleable(startRegex) } this@onDeepLink.launchWithBotLogger { triggersHolder.handleableCommandsHolder.unregisterHandleable(startRegex) }
} }
} }
} }

View File

@@ -591,3 +591,31 @@ fun <BC : BehaviourContext> BC.onEditedInvoice(
additionalSubcontextInitialAction, additionalSubcontextInitialAction,
scenarioReceiver 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.onEditedChecklist(
initialFilter: CommonMessageFilter<ChecklistContent>? = CommonMessageFilterExcludeMediaGroups,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChecklistMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in ChecklistMessage, Any>? = ByChatMessageMarkerFactory,
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, ChecklistMessage>? = null,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChecklistMessage>
)= onEditedContent(
initialFilter,
subcontextUpdatesFilter,
markerFactory,
additionalSubcontextInitialAction,
scenarioReceiver
)

View File

@@ -10,11 +10,15 @@ 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.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.ChecklistTasksDone
import dev.inmo.tgbotapi.types.gifts.GiftSentOrReceived import dev.inmo.tgbotapi.types.gifts.GiftSentOrReceived
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.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
@@ -24,8 +28,15 @@ import dev.inmo.tgbotapi.types.message.ChatEvents.forum.ForumTopicReopened
import dev.inmo.tgbotapi.types.message.ChatEvents.forum.GeneralForumTopicHidden import dev.inmo.tgbotapi.types.message.ChatEvents.forum.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.SuggestedPostInfo
import dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostPaid
import dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostRefunded
import dev.inmo.tgbotapi.types.message.ChatEvents.voice.* import dev.inmo.tgbotapi.types.message.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
@@ -1112,3 +1123,179 @@ fun <BC : BehaviourContext> BC.onUniqueGiftSentOrReceived(
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, ChatEventMessage<GiftSentOrReceived.Unique>>? = null, additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, ChatEventMessage<GiftSentOrReceived.Unique>>? = null,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<GiftSentOrReceived.Unique>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<GiftSentOrReceived.Unique>>
) = 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.onChecklistTasksDone(
initialFilter: SimpleFilter<ChatEventMessage<ChecklistTasksDone>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<ChecklistTasksDone>, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in ChatEventMessage<ChecklistTasksDone>, Any>? = ByChatMessageMarkerFactory,
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, ChatEventMessage<ChecklistTasksDone>>? = null,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<ChecklistTasksDone>>
) = 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.onChecklistTasksAdded(
initialFilter: SimpleFilter<ChatEventMessage<ChecklistTasksAdded>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<ChecklistTasksAdded>, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in ChatEventMessage<ChecklistTasksAdded>, Any>? = ByChatMessageMarkerFactory,
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, ChatEventMessage<ChecklistTasksAdded>>? = null,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<ChecklistTasksAdded>>
) = 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.onChannelDirectMessagesConfigurationChanged(
initialFilter: SimpleFilter<ChannelEventMessage<DirectMessagesConfigurationChanged>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChannelEventMessage<DirectMessagesConfigurationChanged>, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in ChannelEventMessage<DirectMessagesConfigurationChanged>, Any>? = ByChatMessageMarkerFactory,
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, ChannelEventMessage<DirectMessagesConfigurationChanged>>? = null,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChannelEventMessage<DirectMessagesConfigurationChanged>>
) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, additionalSubcontextInitialAction, scenarioReceiver)
/**
* @param initialFilter This filter will be called to remove unnecessary data BEFORE [scenarioReceiver] call
* @param subcontextUpdatesFilter This filter will be applied to each update inside of [scenarioReceiver]. For example,
* this filter will be used if you will call [dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.waitContentMessage].
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data
*/
fun <BC : BehaviourContext> BC.onSuggestedPostApproved(
initialFilter: SimpleFilter<ChannelDirectMessagesEventMessage<SuggestedPostApproved>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChannelDirectMessagesEventMessage<SuggestedPostApproved>, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in ChannelDirectMessagesEventMessage<SuggestedPostApproved>, Any>? = ByChatMessageMarkerFactory,
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, ChannelDirectMessagesEventMessage<SuggestedPostApproved>>? = null,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChannelDirectMessagesEventMessage<SuggestedPostApproved>>
) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, additionalSubcontextInitialAction, scenarioReceiver)
/**
* @param initialFilter This filter will be called to remove unnecessary data BEFORE [scenarioReceiver] call
* @param subcontextUpdatesFilter This filter will be applied to each update inside of [scenarioReceiver]. For example,
* this filter will be used if you will call [dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.waitContentMessage].
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data
*/
fun <BC : BehaviourContext> BC.onSuggestedPostApprovalFailed(
initialFilter: SimpleFilter<ChannelDirectMessagesEventMessage<SuggestedPostApprovalFailed>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChannelDirectMessagesEventMessage<SuggestedPostApprovalFailed>, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in ChannelDirectMessagesEventMessage<SuggestedPostApprovalFailed>, Any>? = ByChatMessageMarkerFactory,
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, ChannelDirectMessagesEventMessage<SuggestedPostApprovalFailed>>? = null,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChannelDirectMessagesEventMessage<SuggestedPostApprovalFailed>>
) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, additionalSubcontextInitialAction, scenarioReceiver)
/**
* @param initialFilter This filter will be called to remove unnecessary data BEFORE [scenarioReceiver] call
* @param subcontextUpdatesFilter This filter will be applied to each update inside of [scenarioReceiver]. For example,
* this filter will be used if you will call [dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.waitContentMessage].
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data
*/
fun <BC : BehaviourContext> BC.onSuggestedPostDeclined(
initialFilter: SimpleFilter<ChannelDirectMessagesEventMessage<SuggestedPostDeclined>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChannelDirectMessagesEventMessage<SuggestedPostDeclined>, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in ChannelDirectMessagesEventMessage<SuggestedPostDeclined>, Any>? = ByChatMessageMarkerFactory,
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, ChannelDirectMessagesEventMessage<SuggestedPostDeclined>>? = null,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChannelDirectMessagesEventMessage<SuggestedPostDeclined>>
) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, additionalSubcontextInitialAction, scenarioReceiver)
/**
* @param initialFilter This filter will be called to remove unnecessary data BEFORE [scenarioReceiver] call
* @param subcontextUpdatesFilter This filter will be applied to each update inside of [scenarioReceiver]. For example,
* this filter will be used if you will call [dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.waitContentMessage].
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data
*/
fun <BC : BehaviourContext> BC.onSuggestedPostPaid(
initialFilter: SimpleFilter<ChannelDirectMessagesEventMessage<SuggestedPostPaid>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChannelDirectMessagesEventMessage<SuggestedPostPaid>, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in ChannelDirectMessagesEventMessage<SuggestedPostPaid>, Any>? = ByChatMessageMarkerFactory,
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, ChannelDirectMessagesEventMessage<SuggestedPostPaid>>? = null,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChannelDirectMessagesEventMessage<SuggestedPostPaid>>
) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, additionalSubcontextInitialAction, scenarioReceiver)
/**
* @param initialFilter This filter will be called to remove unnecessary data BEFORE [scenarioReceiver] call
* @param subcontextUpdatesFilter This filter will be applied to each update inside of [scenarioReceiver]. For example,
* this filter will be used if you will call [dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.waitContentMessage].
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data
*/
fun <BC : BehaviourContext> BC.onSuggestedPostRefunded(
initialFilter: SimpleFilter<ChannelDirectMessagesEventMessage<SuggestedPostRefunded>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChannelDirectMessagesEventMessage<SuggestedPostRefunded>, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in ChannelDirectMessagesEventMessage<SuggestedPostRefunded>, Any>? = ByChatMessageMarkerFactory,
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, ChannelDirectMessagesEventMessage<SuggestedPostRefunded>>? = null,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChannelDirectMessagesEventMessage<SuggestedPostRefunded>>
) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, additionalSubcontextInitialAction, scenarioReceiver)

View File

@@ -1,17 +1,19 @@
@file:OptIn(ExperimentalCoroutinesApi::class)
package dev.inmo.tgbotapi.extensions.behaviour_builder.triggers_handling package dev.inmo.tgbotapi.extensions.behaviour_builder.triggers_handling
import dev.inmo.micro_utils.coroutines.SpecialMutableStateFlow import dev.inmo.micro_utils.coroutines.MutableRedeliverStateFlow
import dev.inmo.micro_utils.coroutines.launchLoggingDropExceptions import dev.inmo.micro_utils.coroutines.runCatchingLogging
import dev.inmo.micro_utils.coroutines.launchSafelyWithoutExceptions import dev.inmo.micro_utils.coroutines.subscribeAsync
import dev.inmo.micro_utils.coroutines.subscribeLoggingDropExceptions import dev.inmo.micro_utils.coroutines.subscribeLoggingDropExceptions
import dev.inmo.micro_utils.coroutines.subscribeSafelyWithoutExceptions
import dev.inmo.micro_utils.coroutines.subscribeSafelyWithoutExceptionsAsync import dev.inmo.micro_utils.coroutines.subscribeSafelyWithoutExceptionsAsync
import dev.inmo.tgbotapi.extensions.behaviour_builder.* import dev.inmo.tgbotapi.extensions.behaviour_builder.*
import dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.expectFlow import dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.expectFlow
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory
import dev.inmo.tgbotapi.extensions.utils.flatMap
import dev.inmo.tgbotapi.types.update.abstracts.Update import dev.inmo.tgbotapi.types.update.abstracts.Update
import dev.inmo.tgbotapi.utils.launchWithBotLogger
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.flow.emptyFlow import kotlinx.coroutines.flow.emptyFlow
import kotlinx.coroutines.flow.filter import kotlinx.coroutines.flow.filter
import kotlinx.coroutines.flow.flatMapLatest import kotlinx.coroutines.flow.flatMapLatest
@@ -47,7 +49,7 @@ internal fun <BC : BehaviourContext, T> BC.on(
} }
val handler: suspend (Pair<Update, T>) -> Unit = subcontextUpdatesFilter ?.let { val handler: suspend (Pair<Update, T>) -> Unit = subcontextUpdatesFilter ?.let {
{ (update, triggerData) -> { (update, triggerData) ->
val contextStateFlow = SpecialMutableStateFlow<BC?>(null) val contextStateFlow = MutableRedeliverStateFlow<BC?>(null)
createSubContextAndDoSynchronouslyWithUpdatesFilter( createSubContextAndDoSynchronouslyWithUpdatesFilter(
updatesUpstreamFlow = contextStateFlow.flatMapLatest { context -> updatesUpstreamFlow = contextStateFlow.flatMapLatest { context ->
if (context == null) { if (context == null) {
@@ -69,13 +71,17 @@ internal fun <BC : BehaviourContext, T> BC.on(
createSubContextAndDoSynchronouslyWithUpdatesFilter(behaviourContextReceiver = { scenarioReceiver(triggerData) }) createSubContextAndDoSynchronouslyWithUpdatesFilter(behaviourContextReceiver = { scenarioReceiver(triggerData) })
} }
markerFactory ?.let { markerFactory ?.let {
subscribeSafelyWithoutExceptionsAsync( subscribeAsync(
scope, scope,
{ markerFactory(it.second) }, { markerFactory(it.second) },
block = handler logger = Log
) ) {
} ?: subscribeLoggingDropExceptions(scope) { runCatchingLogging(logger = Log) {
scope.launchLoggingDropExceptions { handler(it)
}
}
} ?: subscribeLoggingDropExceptions(scope, logger = Log) {
scope.launchWithBotLogger {
handler(it) handler(it)
} }
} }

View File

@@ -24,6 +24,7 @@ internal inline fun <BC : BehaviourContext, reified T : MediaGroupPartContent> B
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, additionalSubcontextInitialAction, scenarioReceiver) { ) = on(markerFactory, initialFilter, subcontextUpdatesFilter, additionalSubcontextInitialAction, scenarioReceiver) {
it.baseSentMessageUpdateOrNull() ?.data ?.commonMessageOrNull() ?.withContentOrNull<MediaGroupContent<*>>() ?.let { it.baseSentMessageUpdateOrNull() ?.data ?.commonMessageOrNull() ?.withContentOrNull<MediaGroupContent<*>>() ?.let {
if (it.content.group.all { it.content is T }) { if (it.content.group.all { it.content is T }) {
@Suppress("UNCHECKED_CAST")
listOf(it as MediaGroupMessage<T>) listOf(it as MediaGroupMessage<T>)
} else { } else {
null null

View File

@@ -24,6 +24,7 @@ internal inline fun <BC : BehaviourContext, reified T : MediaGroupPartContent> B
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, additionalSubcontextInitialAction, scenarioReceiver) { ) = on(markerFactory, initialFilter, subcontextUpdatesFilter, additionalSubcontextInitialAction, scenarioReceiver) {
it.baseSentMessageUpdateOrNull() ?.data ?.commonMessageOrNull() ?.withContentOrNull<MediaGroupContent<*>>() ?.let { it.baseSentMessageUpdateOrNull() ?.data ?.commonMessageOrNull() ?.withContentOrNull<MediaGroupContent<*>>() ?.let {
if (it.content.group.all { it.content is T }) { if (it.content.group.all { it.content is T }) {
@Suppress("UNCHECKED_CAST")
listOf(it.content as MediaGroupContent<T>) listOf(it.content as MediaGroupContent<T>)
} else { } else {
null null

View File

@@ -10,12 +10,12 @@ import dev.inmo.tgbotapi.extensions.utils.pollAnswerUpdateOrNull
import dev.inmo.tgbotapi.types.polls.PollAnswer import dev.inmo.tgbotapi.types.polls.PollAnswer
import dev.inmo.tgbotapi.types.update.abstracts.Update import dev.inmo.tgbotapi.types.update.abstracts.Update
internal inline fun <BC : BehaviourContext> BC.onPollAnswered( internal fun <BC : BehaviourContext> BC.onPollAnswered(
initialFilter: SimpleFilter<PollAnswer>? = null, initialFilter: SimpleFilter<PollAnswer>? = null,
noinline subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, PollAnswer, Update>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, PollAnswer, Update>? = null,
markerFactory: MarkerFactory<in PollAnswer, Any>? = ByIdPollAnswerMarkerFactory, markerFactory: MarkerFactory<in PollAnswer, Any>? = ByIdPollAnswerMarkerFactory,
noinline additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, PollAnswer>? = null, additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, PollAnswer>? = null,
noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, PollAnswer> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, PollAnswer>
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, additionalSubcontextInitialAction, scenarioReceiver) { ) = on(markerFactory, initialFilter, subcontextUpdatesFilter, additionalSubcontextInitialAction, scenarioReceiver) {
(it.pollAnswerUpdateOrNull() ?.data) ?.let(::listOfNotNull) (it.pollAnswerUpdateOrNull() ?.data) ?.let(::listOfNotNull)
} }

View File

@@ -0,0 +1,137 @@
package dev.inmo.tgbotapi.extensions.behaviour_builder.utils
import dev.inmo.micro_utils.common.Warning
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextData
import dev.inmo.tgbotapi.extensions.behaviour_builder.CustomBehaviourContextAndTypeReceiver
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.DefaultCustomBehaviourContextAndTypeReceiver.Companion.BOT_INFO_RECEIVER
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.botInfo
import dev.inmo.tgbotapi.extensions.utils.botCommandTextSourceOrNull
import dev.inmo.tgbotapi.requests.bot.GetMe
import dev.inmo.tgbotapi.types.chat.ExtendedBot
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
import dev.inmo.tgbotapi.types.update.abstracts.Update
import kotlinx.coroutines.sync.Mutex
import kotlinx.coroutines.sync.withLock
/**
* Returns bot information (result of [GetMe]) associated with this [BehaviourContext], if available.
*
* The value is lazily computed and cached by [DefaultCustomBehaviourContextAndTypeReceiver] when it is used
* to wrap behaviour handlers. If this context was not prepared by that wrapper, the function returns null.
*
* Thread-safety:
* - The underlying retrieval is protected by a mutex to ensure the info is fetched at most once per context.
*
* @return [ExtendedBot] with bot details, or null if no bot info provider is registered in this context.
*/
suspend fun BehaviourContext.botInfo(): ExtendedBot? {
return (data[BOT_INFO_RECEIVER] as? DefaultCustomBehaviourContextAndTypeReceiver.IReceiver) ?.run {
invoke()
}
}
suspend fun BehaviourContext.containsCommand(commandRegex: Regex, textSources: TextSourcesList) = textSources.any {
val command = it.botCommandTextSourceOrNull() ?.takeIf {
commandRegex.matches(it.command)
} ?: return@any false
if (command.username == null) {
return@any true
}
val botInfo = botInfo()
if (botInfo == null || command.username == botInfo.username) {
return@any true
}
false
}
context(textSources: TextSourcesList, bc: BehaviourContext)
suspend fun containsCommand(commandRegex: Regex) = bc.containsCommand(commandRegex, textSources)
context(textSources: TextSourcesList, bc: BehaviourContext)
suspend fun containsCommand(command: String) = containsCommand(Regex(command))
suspend fun BehaviourContext.containsCommand(command: String, textSources: TextSourcesList) = containsCommand(Regex(command), textSources)
@Warning("It is internal API and can be changed without notes")
fun <BC : BehaviourContext, R, U : Update> CustomBehaviourContextAndTypeReceiver<BC, R, U>.withDefaultReceiver(
data: BehaviourContextData
) = DefaultCustomBehaviourContextAndTypeReceiver(this).also {
it(data)
}
@Warning("It is internal API and can be changed without notes")
fun <BC : BehaviourContext, R, U : Update> CustomBehaviourContextAndTypeReceiver<BC, R, U>.optionallyWithDefaultReceiver(
include: Boolean,
data: BehaviourContextData
) = if (include) {
withDefaultReceiver(data)
} else {
this
}
/**
* Behaviour wrapper that injects a lazily-evaluated, cached provider of bot information into the [BehaviourContext].
*
* When this wrapper is used, any code executed inside it may call [BehaviourContext.botInfo] to obtain
* the current bot's [ExtendedBot] information. The info is fetched via [GetMe] only once and then cached
* for subsequent calls, with concurrent access synchronized by a mutex.
*
* @param BC Type of [BehaviourContext] used in the wrapped logic.
* @param R Result type produced by the wrapped receiver.
* @param U Type of [Update] handled by the wrapped receiver.
* @param wrapperReceiver The original receiver to be invoked after the bot info provider is registered in the context.
*/
class DefaultCustomBehaviourContextAndTypeReceiver<BC : BehaviourContext, R, U : Update>(
private val wrapperReceiver: CustomBehaviourContextAndTypeReceiver<BC, R, U>
) : suspend (BC, U) -> R {
private var botInfo: ExtendedBot? = null
private val mutex = Mutex()
/**
* Lightweight provider of bot information bound to a [BehaviourContext].
*
* Implementations must return the current [ExtendedBot] instance, computing it if necessary.
*/
fun interface IReceiver {
/**
* Get or compute the bot information for the current [BehaviourContext].
*
* Implementations may cache the value and are free to apply synchronization as needed.
*/
suspend fun BehaviourContext.invoke(): ExtendedBot
}
/**
* Internal provider that performs a single, thread-safe retrieval of bot info via [GetMe] and caches it.
*/
private val internalReceiver: IReceiver = IReceiver {
botInfo ?: mutex.withLock {
botInfo ?: execute(GetMe).also {
botInfo = it
}
}
}
operator fun invoke(data: BehaviourContextData) {
data[BOT_INFO_RECEIVER] = internalReceiver
}
/**
* Registers the internal bot info provider in [BehaviourContext.data] and then delegates to [wrapperReceiver].
*
* The provider is stored under [BOT_INFO_RECEIVER] key, enabling calls to [BehaviourContext.botInfo] within
* the wrapped behaviour.
*/
override suspend fun invoke(p1: BC, p2: U): R {
invoke(p1.data)
return wrapperReceiver(p1, p2)
}
companion object {
/**
* Key used to store the bot info provider inside [BehaviourContext.data].
*/
const val BOT_INFO_RECEIVER = "ktgbotapi_bot_info_receiver"
}
}

View File

@@ -1,6 +1,5 @@
package dev.inmo.tgbotapi.extensions.behaviour_builder.utils.handlers_registrar package dev.inmo.tgbotapi.extensions.behaviour_builder.utils.handlers_registrar
import dev.inmo.micro_utils.coroutines.runCatchingSafely
import kotlinx.coroutines.sync.Mutex import kotlinx.coroutines.sync.Mutex
import kotlinx.coroutines.sync.withLock import kotlinx.coroutines.sync.withLock
@@ -40,7 +39,7 @@ suspend fun <T, R> HandleableTriggersHolder<T>.doWithRegistration(
block: suspend () -> R block: suspend () -> R
): R { ): R {
registerHandleable(data) registerHandleable(data)
val result = runCatchingSafely { val result = runCatching {
block() block()
} }
unregisterHandleable(data) unregisterHandleable(data)

View File

@@ -1,3 +1,5 @@
@file:Suppress("UNCHECKED_CAST")
package dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories package dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories
private val commonAnyMarker = MarkerFactory<Any, Any> { it } private val commonAnyMarker = MarkerFactory<Any, Any> { it }

File diff suppressed because it is too large Load Diff

View File

@@ -47,12 +47,19 @@ kotlin {
api libs.ktor.server.host.common api libs.ktor.server.host.common
api libs.ktor.client.cio api libs.ktor.client.cio
api libs.ktor.client.java
api libs.javax.activation api libs.javax.activation
} }
} }
linuxX64Main { jsMain {
dependencies {
api libs.ktor.client.js
}
}
linuxMain {
dependencies { dependencies {
api libs.ktor.client.curl api libs.ktor.client.curl
} }
@@ -64,7 +71,7 @@ kotlin {
} }
} }
mingwX64Main { mingwMain {
dependencies { dependencies {
api libs.ktor.client.winhttp api libs.ktor.client.winhttp
} }

View File

@@ -27,3 +27,12 @@ interface TextedOutput : ParsableOutput, EntitiesOutput
interface TextedInput : TextedWithTextSources { interface TextedInput : TextedWithTextSources {
override val textSources: List<TextSource> override val textSources: List<TextSource>
} }
interface TitledInput : TextedInput {
val title: String
val titleTextSources: List<TextSource>
override val text: String
get() = title
override val textSources: List<TextSource>
get() = titleTextSources
}

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

@@ -1,10 +1,13 @@
@file:OptIn(ExperimentalCoroutinesApi::class)
package dev.inmo.tgbotapi.bot.exceptions package dev.inmo.tgbotapi.bot.exceptions
import korlibs.time.DateTime import korlibs.time.DateTime
import dev.inmo.tgbotapi.types.Response import dev.inmo.tgbotapi.types.Response
import dev.inmo.tgbotapi.types.RetryAfterError import dev.inmo.tgbotapi.types.RetryAfterError
import io.ktor.utils.io.errors.IOException
import kotlinx.coroutines.CopyableThrowable import kotlinx.coroutines.CopyableThrowable
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.io.IOException
fun newRequestException( fun newRequestException(
response: Response, response: Response,
@@ -42,7 +45,7 @@ class CommonBotException(message: String = "Something went wrong", cause: Throwa
override fun createCopy(): BotException = CommonBotException(message!!, cause) override fun createCopy(): BotException = CommonBotException(message!!, cause)
} }
sealed class RequestException constructor( sealed class RequestException (
val response: Response, val response: Response,
val plainAnswer: String, val plainAnswer: String,
message: String? = null, message: String? = null,

View File

@@ -8,6 +8,7 @@ import dev.inmo.tgbotapi.bot.settings.limiters.RequestLimiter
import dev.inmo.tgbotapi.requests.abstracts.Request import dev.inmo.tgbotapi.requests.abstracts.Request
import dev.inmo.tgbotapi.utils.DefaultKTgBotAPIKSLog import dev.inmo.tgbotapi.utils.DefaultKTgBotAPIKSLog
import dev.inmo.tgbotapi.utils.TelegramAPIUrlsKeeper import dev.inmo.tgbotapi.utils.TelegramAPIUrlsKeeper
import dev.inmo.tgbotapi.utils.defaultKtorEngine
import dev.inmo.tgbotapi.utils.nonstrictJsonFormat import dev.inmo.tgbotapi.utils.nonstrictJsonFormat
import io.ktor.client.* import io.ktor.client.*
import kotlinx.serialization.json.Json import kotlinx.serialization.json.Json
@@ -18,6 +19,7 @@ import kotlinx.serialization.json.Json
* * On JS, JVM and MingwX64 platforms it is [dev.inmo.tgbotapi.bot.ktor.base.DefaultKtorRequestsExecutor] * * On JS, JVM and MingwX64 platforms it is [dev.inmo.tgbotapi.bot.ktor.base.DefaultKtorRequestsExecutor]
* * On LinuxX64 it is [dev.inmo.tgbotapi.bot.ktor.base.MultipleClientKtorRequestsExecutor] * * On LinuxX64 it is [dev.inmo.tgbotapi.bot.ktor.base.MultipleClientKtorRequestsExecutor]
*/ */
@Suppress("EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING")
expect class KtorRequestsExecutor internal constructor( expect class KtorRequestsExecutor internal constructor(
telegramAPIUrlsKeeper: TelegramAPIUrlsKeeper, telegramAPIUrlsKeeper: TelegramAPIUrlsKeeper,
client: HttpClient, client: HttpClient,
@@ -36,7 +38,7 @@ expect class KtorRequestsExecutor internal constructor(
fun KtorRequestsExecutor( fun KtorRequestsExecutor(
telegramAPIUrlsKeeper: TelegramAPIUrlsKeeper, telegramAPIUrlsKeeper: TelegramAPIUrlsKeeper,
client: HttpClient = HttpClient(), client: HttpClient = HttpClient(defaultKtorEngine),
callsFactories: List<KtorCallFactory> = emptyList(), callsFactories: List<KtorCallFactory> = emptyList(),
excludeDefaultFactories: Boolean = false, excludeDefaultFactories: Boolean = false,
requestsLimiter: RequestLimiter = ExceptionsOnlyLimiter, requestsLimiter: RequestLimiter = ExceptionsOnlyLimiter,
@@ -52,5 +54,5 @@ fun KtorRequestsExecutor(
jsonFormatter = jsonFormatter, jsonFormatter = jsonFormatter,
pipelineStepsHolder = pipelineStepsHolder, pipelineStepsHolder = pipelineStepsHolder,
logger = logger, logger = logger,
diff = kotlin.Unit, diff = Unit,
) )

View File

@@ -21,7 +21,7 @@ fun createTelegramBotDefaultKtorCallRequestsFactories(logger: KSLog? = null) = l
class KtorRequestsExecutorBuilder( class KtorRequestsExecutorBuilder(
var telegramAPIUrlsKeeper: TelegramAPIUrlsKeeper var telegramAPIUrlsKeeper: TelegramAPIUrlsKeeper
) { ) {
var client: HttpClient = HttpClient() var client: HttpClient = HttpClient(defaultKtorEngine)
var callsFactories: List<KtorCallFactory> = emptyList() var callsFactories: List<KtorCallFactory> = emptyList()
var excludeDefaultFactories: Boolean = false var excludeDefaultFactories: Boolean = false
var requestsLimiter: RequestLimiter = ExceptionsOnlyLimiter var requestsLimiter: RequestLimiter = ExceptionsOnlyLimiter
@@ -53,11 +53,19 @@ inline fun telegramBot(
/** /**
* Shortcut for [telegramBot] * Shortcut for [telegramBot]
*/ */
@Suppress("NOTHING_TO_INLINE") fun telegramBot(
inline fun telegramBot(
token: String, token: String,
apiUrl: String = telegramBotAPIDefaultUrl, apiUrl: String = telegramBotAPIDefaultUrl,
testServer: Boolean = false, testServer: Boolean = false,
fileLinkUrlMapper: TelegramAPIUrlsKeeper.(String) -> String = { "${fileBaseUrl}/$it" },
builder: KtorRequestsExecutorBuilder.() -> Unit = {} builder: KtorRequestsExecutorBuilder.() -> Unit = {}
): TelegramBot = telegramBot(TelegramAPIUrlsKeeper(token, testServer, apiUrl), builder) ): TelegramBot = telegramBot(
telegramAPIUrlsKeeper = TelegramAPIUrlsKeeper(
token = token,
testServer = testServer,
hostUrl = apiUrl,
fileLinkUrlMapper = fileLinkUrlMapper
),
builder = builder
)

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

@@ -3,7 +3,6 @@ package dev.inmo.tgbotapi.bot.ktor.base
import dev.inmo.kslog.common.KSLog import dev.inmo.kslog.common.KSLog
import dev.inmo.kslog.common.v import dev.inmo.kslog.common.v
import dev.inmo.kslog.common.w import dev.inmo.kslog.common.w
import dev.inmo.micro_utils.coroutines.runCatchingSafely
import dev.inmo.tgbotapi.bot.ktor.KtorCallFactory import dev.inmo.tgbotapi.bot.ktor.KtorCallFactory
import dev.inmo.tgbotapi.bot.exceptions.newRequestException import dev.inmo.tgbotapi.bot.exceptions.newRequestException
import dev.inmo.tgbotapi.requests.GetUpdatesRequest import dev.inmo.tgbotapi.requests.GetUpdatesRequest
@@ -73,7 +72,7 @@ abstract class AbstractRequestCallFactory(
val responseObject = jsonFormatter.decodeFromString(Response.serializer(), content) val responseObject = jsonFormatter.decodeFromString(Response.serializer(), content)
logger.v { "Answer as json for $request: $responseObject" } logger.v { "Answer as json for $request: $responseObject" }
return runCatchingSafely { return runCatching {
(responseObject.result?.let { (responseObject.result?.let {
jsonFormatter.decodeFromJsonElement(request.resultDeserializer, it) jsonFormatter.decodeFromJsonElement(request.resultDeserializer, it)
} ?: response.let { } ?: response.let {

View File

@@ -1,7 +1,7 @@
package dev.inmo.tgbotapi.bot.ktor.base package dev.inmo.tgbotapi.bot.ktor.base
import dev.inmo.kslog.common.* import dev.inmo.kslog.common.*
import dev.inmo.micro_utils.coroutines.runCatchingSafely import dev.inmo.micro_utils.coroutines.runCatchingLogging
import dev.inmo.tgbotapi.bot.BaseRequestsExecutor import dev.inmo.tgbotapi.bot.BaseRequestsExecutor
import dev.inmo.tgbotapi.bot.exceptions.BotException import dev.inmo.tgbotapi.bot.exceptions.BotException
import dev.inmo.tgbotapi.bot.exceptions.CommonBotException import dev.inmo.tgbotapi.bot.exceptions.CommonBotException
@@ -17,6 +17,7 @@ import dev.inmo.tgbotapi.utils.TelegramAPIUrlsKeeper
import io.ktor.client.* import io.ktor.client.*
import io.ktor.client.plugins.* import io.ktor.client.plugins.*
import io.ktor.client.statement.* import io.ktor.client.statement.*
import kotlinx.coroutines.CancellationException
import kotlinx.serialization.json.Json import kotlinx.serialization.json.Json
class DefaultKtorRequestsExecutor internal constructor( class DefaultKtorRequestsExecutor internal constructor(
@@ -48,33 +49,37 @@ class DefaultKtorRequestsExecutor internal constructor(
} }
override suspend fun <T : Any> execute(request: Request<T>): T { override suspend fun <T : Any> execute(request: Request<T>): T {
return runCatching { return runCatchingLogging(logger = logger) {
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 ->
@@ -83,7 +88,7 @@ class DefaultKtorRequestsExecutor internal constructor(
when (e) { when (e) {
is ClientRequestException -> { is ClientRequestException -> {
val exceptionResult = runCatchingSafely { val exceptionResult = runCatchingLogging(logger = Log) {
val content = e.response.bodyAsText() val content = e.response.bodyAsText()
val responseObject = jsonFormatter.decodeFromString(Response.serializer(), content) val responseObject = jsonFormatter.decodeFromString(Response.serializer(), content)
newRequestException( newRequestException(
@@ -96,6 +101,7 @@ class DefaultKtorRequestsExecutor internal constructor(
CommonBotException(cause = e) CommonBotException(cause = e)
} ?: exceptionResult.getOrThrow() } ?: exceptionResult.getOrThrow()
} }
is CancellationException,
is BotException -> e is BotException -> e
else -> CommonBotException(cause = e) else -> CommonBotException(cause = e)
}.also { newException -> }.also { newException ->

View File

@@ -1,6 +1,5 @@
package dev.inmo.tgbotapi.bot.ktor.base package dev.inmo.tgbotapi.bot.ktor.base
import dev.inmo.micro_utils.coroutines.*
import dev.inmo.tgbotapi.bot.ktor.KtorCallFactory import dev.inmo.tgbotapi.bot.ktor.KtorCallFactory
import dev.inmo.tgbotapi.requests.DownloadFileStream import dev.inmo.tgbotapi.requests.DownloadFileStream
import dev.inmo.tgbotapi.requests.abstracts.Request import dev.inmo.tgbotapi.requests.abstracts.Request
@@ -22,15 +21,25 @@ object DownloadFileChannelRequestCallFactory : KtorCallFactory {
request: Request<T>, request: Request<T>,
jsonFormatter: Json jsonFormatter: Json
): T? = (request as? DownloadFileStream) ?.let { ): T? = (request as? DownloadFileStream) ?.let {
val fullUrl = urlsKeeper.createFileLinkUrl(it.filePath) val bodyChannelAllocator: suspend () -> ByteReadChannel = resolveFile(it.filePath) ?.let {
{
byteReadChannel(it)
}
} ?: let { _ ->
val fullUrl = urlsKeeper.createFileLinkUrl(it.filePath)
return@let {
val response = client.get(fullUrl)
response.bodyAsChannel()
}
}
@Suppress("UNCHECKED_CAST")
ByteReadChannelAllocator { ByteReadChannelAllocator {
val scope = CoroutineScope(currentCoroutineContext() + SupervisorJob()) val scope = CoroutineScope(currentCoroutineContext() + SupervisorJob())
val outChannel = ByteChannel() val outChannel = ByteChannel()
scope.launch { scope.launch {
runCatchingSafely { runCatching {
val response = client.get(fullUrl) val channel: ByteReadChannel = bodyChannelAllocator()
val channel: ByteReadChannel = response.bodyAsChannel()
channel.copyAndClose(outChannel) channel.copyAndClose(outChannel)
} }
scope.cancel() scope.cancel()

View File

@@ -1,5 +1,6 @@
package dev.inmo.tgbotapi.bot.ktor.base package dev.inmo.tgbotapi.bot.ktor.base
import dev.inmo.micro_utils.common.bytes
import dev.inmo.micro_utils.coroutines.safely import dev.inmo.micro_utils.coroutines.safely
import dev.inmo.tgbotapi.bot.ktor.KtorCallFactory import dev.inmo.tgbotapi.bot.ktor.KtorCallFactory
import dev.inmo.tgbotapi.requests.DownloadFile import dev.inmo.tgbotapi.requests.DownloadFile
@@ -19,11 +20,14 @@ object DownloadFileRequestCallFactory : KtorCallFactory {
request: Request<T>, request: Request<T>,
jsonFormatter: Json, jsonFormatter: Json,
): T? = (request as? DownloadFile)?.let { ): T? = (request as? DownloadFile)?.let {
resolveFile(it.filePath) ?.let {
@Suppress("UNCHECKED_CAST")
return@makeCall it.bytes() as T // Always ByteArray
}
val fullUrl = urlsKeeper.createFileLinkUrl(it.filePath) val fullUrl = urlsKeeper.createFileLinkUrl(it.filePath)
safely { @Suppress("UNCHECKED_CAST")
@Suppress("UNCHECKED_CAST") client.get(fullUrl).readRawBytes() as T // always ByteArray
client.get(fullUrl).readRawBytes() as T // always ByteArray
}
} }
} }

View File

@@ -0,0 +1,10 @@
package dev.inmo.tgbotapi.bot.ktor.base
import dev.inmo.micro_utils.common.MPPFile
import dev.inmo.micro_utils.ktor.common.input
import io.ktor.utils.io.ByteReadChannel
internal fun byteReadChannel(file: MPPFile): ByteReadChannel {
return ByteReadChannel(file.input())
}
internal expect fun resolveFile(filename: String): MPPFile?

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