mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2025-11-16 12:00:18 +00:00
Compare commits
295 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2ecd42c859 | |||
| 3857950141 | |||
| 6d5bedd315 | |||
| 69a9e8f820 | |||
| 6d8693a003 | |||
| c990d987f5 | |||
| b8530f14ca | |||
| db8bac9b52 | |||
| e53b3b8198 | |||
| 71ccfc88cc | |||
| dd2923f92d | |||
| ff78153591 | |||
| e2ce9cfebf | |||
| 0a01d2567e | |||
| e4fb45c09b | |||
| db0df975c7 | |||
| 2003b314a3 | |||
| 55a78375be | |||
|
|
256607e336 | ||
| 92f2a5afdb | |||
| 3affcf4399 | |||
| 67dfa19a1b | |||
| 86e83f7f1a | |||
| 429fc5d2f9 | |||
| d19e6ad4e0 | |||
| 134145f441 | |||
| ef76fe52ca | |||
| bab69f523a | |||
| 91f4d3bf24 | |||
| 3e316dfde0 | |||
| 1ef49ad48c | |||
| 9297824dc3 | |||
| d02ed592d8 | |||
| 6ea9a28c7c | |||
| 88fc4fc444 | |||
| dd0de3b6d4 | |||
| 838fff8207 | |||
| 751a77f6d8 | |||
| 222fe7594f | |||
| ed6d4d07c6 | |||
| 78d9ce8d19 | |||
| 345009da32 | |||
| de47497223 | |||
| 7477625380 | |||
| 970abf8cde | |||
| 5a7741faf6 | |||
| 8aa29e56d3 | |||
| dab5e072d0 | |||
| 94078939d1 | |||
| 824d3862e3 | |||
| 44f92e8d6c | |||
| ddb79c0d8d | |||
| a9562cc8f9 | |||
| 8a351d5be0 | |||
| 8cd5659b7b | |||
| 1474a07b9e | |||
| c13a0d3193 | |||
| 172f49fa6b | |||
| 4d42972a7e | |||
| c0883d0180 | |||
| e7367da3cb | |||
| effd12711f | |||
| ef1d2e8242 | |||
| 881763f3af | |||
| d36b11c002 | |||
| d2395e836c | |||
| c8c008edd3 | |||
| 3b4fa06924 | |||
| 5d428a5e54 | |||
| 8964e08ce6 | |||
| 745168d181 | |||
| a408c6c7c7 | |||
| e0f5e9b640 | |||
| 0331ff2f42 | |||
| a21d0b56db | |||
|
|
6ea8afee8f | ||
|
|
8799aeca26 | ||
| c610f4eab2 | |||
| 92cd2a3def | |||
| 03d158b03b | |||
|
|
608fde4139 | ||
| 9e56a6cc1a | |||
| c0e3c1d02f | |||
| 341a527d27 | |||
|
|
8d6d70a06a | ||
|
|
67fb552d01 | ||
|
|
93e937aa6a | ||
|
|
09dee188d2 | ||
|
|
29c6bb5dac | ||
| c266ab0120 | |||
|
|
b407fc5c86 | ||
|
|
1bde43ceaf | ||
|
|
389a508fa7 | ||
|
|
69c2586b50 | ||
|
|
7e80f4edac | ||
|
|
99987c3f51 | ||
|
|
713130fd13 | ||
| deb8d7b43a | |||
| b604444f7d | |||
|
|
cb6127bf91 | ||
|
|
d40919f099 | ||
|
|
7cb576e6b1 | ||
|
|
b53fb8da36 | ||
|
|
03ea8dfe7f | ||
|
|
314c8d9ad1 | ||
|
|
6fceee4199 | ||
|
|
e720da708c | ||
|
|
d65706631f | ||
|
|
3312b64564 | ||
|
|
1bfe431393 | ||
|
|
6485353704 | ||
|
|
46a1ed27b7 | ||
|
|
9f3024476c | ||
|
|
93d0e009bb | ||
|
|
ef60549e1c | ||
|
|
2ac83156f6 | ||
|
|
4c9d888668 | ||
|
|
cd3ba8f480 | ||
|
|
99559f477e | ||
|
|
a3949c752d | ||
| fd48a52266 | |||
| 3e0036f7df | |||
| 2978932c87 | |||
| c773736fb8 | |||
| 8a3a05ef12 | |||
| 0afbe8ef2d | |||
| 3f4018f969 | |||
| 097d82b4b4 | |||
| 7c2a379161 | |||
| ba5f76e8cd | |||
| 8aec920a15 | |||
| c92bd33ba1 | |||
| 51927974f5 | |||
| 9350f87e19 | |||
| 6cb9950b36 | |||
| 974c2e883f | |||
| af6f98fd56 | |||
| 75a2b2c282 | |||
| d66d4b4209 | |||
| 9d54820fd7 | |||
| 1876df2c2d | |||
| d818592cd3 | |||
| c29737b6b3 | |||
| 46243a21eb | |||
| d5f45ead59 | |||
| 5a696cdac0 | |||
| 80955eeb55 | |||
| 6ee93e2d68 | |||
| d4490dec75 | |||
| 7d3e9325f1 | |||
| 31a66eb8e6 | |||
| b3b9070cd6 | |||
| 3504776344 | |||
| f22f69534a | |||
| a9c1d7b33c | |||
|
|
376ef0750c | ||
| cdf93e0d12 | |||
| 8c7261fda9 | |||
| 82acc8cb1f | |||
| 4ec1532597 | |||
| 13bfe681d8 | |||
| 5bbbcdb529 | |||
| 7f9d6ce626 | |||
| 71b944f9cc | |||
| d9d68749f1 | |||
| 561aad2274 | |||
| 6a3e95c488 | |||
| a09b3809e2 | |||
| 427b5775a2 | |||
| d222987fc7 | |||
| d211afa26a | |||
| 9952b6c6ae | |||
| 840c6b02a4 | |||
| a6f91d5600 | |||
| 8ec0c8804b | |||
| 2d08c447bc | |||
| 9a0793d81c | |||
| a95f556a5c | |||
| f774b11de4 | |||
|
|
5164903d05 | ||
| adaedb8040 | |||
| 9b4b60eb33 | |||
| b90f8ec389 | |||
| e95550a6eb | |||
| 696219df24 | |||
| 27241fad32 | |||
| a034fa18d7 | |||
| adcaffe115 | |||
| 6388d8db13 | |||
| 2964586cb9 | |||
| e3cb1e4faf | |||
| d7f14020d8 | |||
| 397197023e | |||
| 12dc93313a | |||
| 625760afae | |||
| 795328afdf | |||
| 57175b7698 | |||
| 2d05a334eb | |||
| 0b6d9e47b9 | |||
| 4cdae11adc | |||
| 04b2d1dbd6 | |||
| 4343d6d161 | |||
| 6824f2c992 | |||
| 9cde4927ce | |||
| 819982473a | |||
| 5559923339 | |||
| c7d08df3bf | |||
| 41a142addb | |||
| 652765bf46 | |||
| 32010cf1c7 | |||
| 1c6359f041 | |||
| 4ac5e405ac | |||
| bc00e1f28a | |||
| 191e4cff00 | |||
| de91cc5382 | |||
| 96b872953b | |||
| 433b0989ee | |||
| eddd60ebb1 | |||
| 8b63ed7fa9 | |||
| 85539a9d58 | |||
| ad4bac82dc | |||
| 300be87ffd | |||
| 05f46d08c8 | |||
| eb72ff1c94 | |||
| 6b3fabdb30 | |||
| 402e695f99 | |||
| a87560bc40 | |||
| 6d300de470 | |||
| 3658403f01 | |||
| 082aeab700 | |||
| 4eb6fa7835 | |||
| ddf34aad3f | |||
| c818a44044 | |||
| d578f6af90 | |||
| 5ce4e4cbc0 | |||
| 41e369cea5 | |||
| f85d4a36e1 | |||
| fb3b8a7415 | |||
| 609c2b5fad | |||
| 2c602e4434 | |||
| 1a3c9bca1d | |||
|
|
43496505a7 | ||
| 4a0c0bdc40 | |||
| fa9c95f799 | |||
| dd6f7577ba | |||
| 7d47d0ab61 | |||
| 636c01acb9 | |||
| 479923a04a | |||
| ccfa6e7b6d | |||
| 65048648b8 | |||
| 50b2db8859 | |||
| 45bbcb5ec1 | |||
| dc463b5626 | |||
| d80e578a4c | |||
| b26d21a817 | |||
| 2052072e5d | |||
| 6fb3d3fcb1 | |||
| c39e9fc156 | |||
| 9c5793bec7 | |||
| fd9bff611b | |||
| bb66279044 | |||
| 24b48f2536 | |||
| 670c26c982 | |||
| 7ed5d9ceed | |||
| 787941fcaf | |||
| 6c9f1bc016 | |||
| e5bffa7c51 | |||
|
|
3fe26b057a | ||
| dccd15a5e9 | |||
| 3d14c93d89 | |||
| b8a6534b6a | |||
| f5529033ec | |||
| 482c375327 | |||
| abb8b3491d | |||
| 2953005e6d | |||
| 1f6ddd97e3 | |||
| bc8da1120e | |||
| e895c2f3a8 | |||
| f84180b3ff | |||
| c21c8c5a26 | |||
| 27416daeb8 | |||
| b5b7482c2f | |||
| a7f4ab36c6 | |||
| 7398e53b85 | |||
| be25f705ef | |||
| 5ee87ac78d | |||
| fbd53e1f2d | |||
| 9fe8df9e11 | |||
| a053c08346 | |||
| 6fa769bce3 | |||
| 27ac8ee797 | |||
| ce84e3c198 | |||
| c3a3e9bd44 | |||
| 7b6be48ba8 | |||
| e98d5c7a9c |
2
.github/FUNDING.yml
vendored
2
.github/FUNDING.yml
vendored
@@ -1,3 +1,3 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
custom: ['https://www.tinkoff.ru/rm/ovsyannikov.aleksey113/ObMJ712472', 'https://boosty.to/insanusmokrassar']
|
||||
custom: ['https://tonscan.org/address/UQAtuSLJ76Zehc3qP-eRYMR98fPIu_oOp_atcpVX55zxHwTU']
|
||||
|
||||
2
.github/workflows/packages_publishing.yml
vendored
2
.github/workflows/packages_publishing.yml
vendored
@@ -17,7 +17,7 @@ jobs:
|
||||
rm gradle.properties
|
||||
mv gradle.properties.tmp gradle.properties
|
||||
- name: KotlinSymbolProcessing execution
|
||||
run: ./gradlew ksp
|
||||
run: ./gradlew kspCommonMainKotlinMetadata
|
||||
- name: Build
|
||||
run: ./gradlew build
|
||||
- name: API compatibility check
|
||||
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -13,3 +13,4 @@ out/
|
||||
local.properties
|
||||
kotlin-js-store/
|
||||
secret.gradle
|
||||
.aider*
|
||||
|
||||
195
CHANGELOG.md
195
CHANGELOG.md
@@ -1,5 +1,200 @@
|
||||
# TelegramBotAPI changelog
|
||||
|
||||
## 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
|
||||
|
||||
**THIS UPDATE CONTAINS BREAKING CHANGES IN BEHAVIOUR BUILDER AND CORE. BE CAREFUL ON UPDATE**
|
||||
|
||||
* `Version`:
|
||||
* `Serialization`: `1.8.0` -> `1.8.1`
|
||||
* `Coroutines`: `1.10.1` -> `1.10.2`
|
||||
* `Ktor`: `3.1.1` -> `3.1.3`
|
||||
* `MicroUtils`: `0.25.3` -> `0.25.7`
|
||||
* `Core`:
|
||||
* **POTENTIALLY BREAKING CHANGE** Long polling has been reworked a bit
|
||||
* **BREAKING CHANGE** `RequestsExecutor` got property `RequestsExecutor.Log: KSLog`
|
||||
* `BehaviourContext`:
|
||||
* **BREAKING CHANGE** All triggers and waiters become non-suspend functions
|
||||
* **BREAKING CHANGE** Behaviour of counted extensions (commands, data callback queries, etc.) has been changed a bit: now each one will
|
||||
create subcontext and work in it
|
||||
* New extension `BehaviourContext.launchInNewSubContext` which will launch some job in subcontext of receiver
|
||||
|
||||
## 25.0.1
|
||||
|
||||
**THIS UPDATE CONTAINS ADDING SUPPORT OF [Telegram Bots API 9.0](https://core.telegram.org/bots/api-changelog#april-11-2025)**
|
||||
|
||||
* `Core`:
|
||||
* Previously named `Gift` now presented by `Gift.Regular`
|
||||
* Fixes in `MultipartRequestCallFactory` for correct handling of all `MultipartRequest.Common` inheritors
|
||||
* `Username` now can be safely created with `Username.prepare`
|
||||
* Add extensions `String.splitFor(Text|Caption|StoryCaption)` for preparing several texts for several
|
||||
messages/captions/story captions
|
||||
|
||||
## 24.0.2
|
||||
|
||||
* `Version`:
|
||||
* `Kotlin`: `2.1.10` -> `2.1.20`
|
||||
* `Ktor`: `3.1.0` -> `3.1.1`
|
||||
* `MicroUtils`: `0.24.7` -> `0.25.3`
|
||||
* `DefaultKTgBotAPIKSLog` will drop `CancellationException`s by default
|
||||
* You may configure `DefaultKTgBotAPIKSLog` in simple way with `SetDefaultKTgBotAPIKSLog`
|
||||
* `BehaviourBuilder`:
|
||||
* `FSM`:
|
||||
* Fix chains cancelling on their ends
|
||||
|
||||
## 24.0.1
|
||||
|
||||
* `Core`:
|
||||
* Now you may upload photos with `EditChatMessageMedia`
|
||||
|
||||
## 24.0.0
|
||||
|
||||
**THIS UPDATE CONTAINS BREAKING CHANGES IN `subcontextUpdatesFilter` WORK. TAKE CARE IN MIGRATION**
|
||||
|
||||
* `Version`:
|
||||
* `MicroUtils`: `0.24.6` -> `0.24.7`
|
||||
* `Core`:
|
||||
* `ForumContentMessage` got property `threadCreatingInfo` which represents information about topic where message has been sent
|
||||
* `BehaviourBuilder`:
|
||||
* Fix of overall `subcontextUpdatesFilter` behaviour. In fact, this update will fix its affection on scenaries
|
||||
|
||||
## 23.2.1
|
||||
|
||||
* `Core`:
|
||||
* Fix of `year` field in `Birthdate`
|
||||
|
||||
## 23.2.0
|
||||
|
||||
**THIS UPDATE CONTAINS ADDING SUPPORT OF [Telegram Bots API 8.3](https://core.telegram.org/bots/api-changelog#february-12-2025)**
|
||||
|
||||
* `Version`:
|
||||
* `MicroUtils`: `0.24.5` -> `0.24.6`
|
||||
* `Ktor`: `3.0.3` -> `3.1.0`
|
||||
|
||||
## 23.1.2
|
||||
|
||||
* `Version`:
|
||||
* `Kotlin`: `2.1.0` -> `2.1.10`
|
||||
* `Serialization`: `1.7.3` -> `1.8.0`
|
||||
* `MicroUtils`: `0.24.4` -> `0.24.5`
|
||||
* `KSLog`: `1.4.0` -> `1.4.1`
|
||||
|
||||
## 23.1.1
|
||||
|
||||
* `Version`:
|
||||
* `MicroUtils`: `0.24.0` -> `0.24.4`
|
||||
* `Core`:
|
||||
* Replace `removeFirst` with `removeAt(0)` in `createTextSources`
|
||||
|
||||
## 23.1.0
|
||||
|
||||
**THIS UPDATE CONTAINS ADDING SUPPORT OF [Telegram Bots API 8.2](https://core.telegram.org/bots/api-changelog#january-1-2025)**
|
||||
|
||||
## 23.0.0
|
||||
|
||||
* `Version`:
|
||||
* `Coroutines`: `1.9.0` -> `1.10.1`
|
||||
* `MicroUtils`: `0.23.2` -> `0.24.0`
|
||||
* `KSLog`: `1.3.6` -> `1.4.0`
|
||||
* `Ktor`: `3.0.2` -> `3.0.3`
|
||||
* `Core`:
|
||||
* All old factory methods for `TextSource`s took suffix `TextSource`. For example: `regular` -> `regularTextSource`.
|
||||
That has been for excluding names resolution ambiguity with extensions for `EntitiesBuilder`
|
||||
|
||||
## 22.0.0
|
||||
|
||||
**THIS UPDATE CONTAINS BREAKING CHANGES**
|
||||
|
||||
**IN THIS UPDATE HAS BEEN REWORKED EVENTS API IN WEBAPPS**
|
||||
|
||||
**THIS UPDATE ADDING SUPPORT OF [BOT API 8.0](https://core.telegram.org/bots/api-changelog#november-17-2024) AND [BOT API 8.1](https://core.telegram.org/bots/api-changelog#december-4-2024)**
|
||||
|
||||
* `Version`:
|
||||
* `MicroUtils`: `0.23.1` -> `0.23.2`
|
||||
* `Ktor`: `3.0.1` -> `3.0.2`
|
||||
|
||||
## 21.0.1
|
||||
|
||||
* `Core`:
|
||||
* Improvements in `Update.sourceUser` extension
|
||||
* Add extension `PrivateChat.toUser`
|
||||
* Builder methods of `TextSource`s (like `pre` which returns `PreTextSource`) lost suppression of `redundant inline`
|
||||
due to its redundancy
|
||||
* Add `mention` builders for `EntitiesBuilder` with `UserId` as variant instead of `User`
|
||||
* `BehaviourBuilder`:
|
||||
* Add support of several rounds for `CombinedSubcontextInitialAction`. Now it will try hard to execute all its
|
||||
`SubAction` while all actions will not be completed successfully OR all left actions will not complete with errors
|
||||
|
||||
## 21.0.0
|
||||
|
||||
* `Version`:
|
||||
* `Kotlin`: `2.0.21` -> `2.1.0`
|
||||
* `MicroUtils`: `0.23.0` -> `0.23.1`
|
||||
* `BehaviourBuilder`:
|
||||
* Add special `val data: BehaviourContextData` into all realizations of `BehaviourContext`
|
||||
* Add `CombinedSubcontextInitialAction` and functions
|
||||
`buildSubcontextInitialAction`/`buildSubcontextInitialActionWithSubActions`
|
||||
* Add `subcontextInitialAction` for all the functions-builders of `BehaviourContext` and
|
||||
`additionalSubcontextInitialAction` to all triggers
|
||||
|
||||
## 20.0.1
|
||||
|
||||
* `Core`:
|
||||
* Fix of logger propagation (fix of [#860](https://github.com/InsanusMokrassar/ktgbotapi/issues/860))
|
||||
* Add opportunity to modify keyboards (fix of [#761](https://github.com/InsanusMokrassar/ktgbotapi/issues/761))
|
||||
* Fields of `OrderInfo` became nullable (fix of [#917](https://github.com/InsanusMokrassar/ktgbotapi/issues/917))
|
||||
* Add default `toString` to `ChatType` (fix of [#919](https://github.com/InsanusMokrassar/ktgbotapi/issues/919))
|
||||
* Fix of method in `CreateInvoiceLink` (merging of [#920](https://github.com/InsanusMokrassar/ktgbotapi/issues/920), made by [byteduck-exploit](https://github.com/byteduck-exploit))
|
||||
|
||||
## 20.0.0
|
||||
|
||||
**THIS UPDATE CONTAINS SUPPORT OF [BOTS API 7.11](https://core.telegram.org/bots/api-changelog#october-31-2024)**
|
||||
|
||||
* `All`:
|
||||
* **ALL SEND METHODS GOT PARAMETER `allowPaidBroadcast` WHICH POTENTIALLY MAY SPEND MONEYS FROM BOT BALANCE**
|
||||
|
||||
## 19.0.0
|
||||
|
||||
**THIS UPDATE CONTAINS BREAKING CHANGES**
|
||||
|
||||
**THIS UPDATE CONTAINS UPGRADE UP TO KTOR 3.0 (thanks to [@d1snin](https://github.com/d1snin))**
|
||||
|
||||
* `Version`:
|
||||
* `Ktor`: `2.3.12` -> `3.0.1`
|
||||
* `MicroUtils`: `0.22.7` -> `0.23.0`
|
||||
|
||||
## 18.2.3
|
||||
|
||||
* `Core`:
|
||||
* Add default middleware `ExceptionsThrottlerTelegramBotMiddleware`
|
||||
* Make `TelegramBotMiddlewaresPipelinesHandler` to be default `TelegramBotPipelinesHandler`
|
||||
* Make `DefaultKtorRequestsExecutor` now uses `runCatching` instead of `runCatchingSafely`
|
||||
* `onRequestResultPresented` lambda now accepts non-nullable `result`
|
||||
|
||||
## 18.2.2
|
||||
|
||||
* `Version`:
|
||||
* `Kotlin`: `2.0.20` -> `2.0.21`
|
||||
* `MicroUtils`: `0.22.4` -> `0.22.7`
|
||||
* `Core`:
|
||||
* Fixes in blockquotes serializations
|
||||
* Now `RawMessageEntity` is public. It is still under `Warning` annotation and is subject of changes
|
||||
* `BehaviourBuilder`:
|
||||
* Add `CommonMessageFilterExcludeCommand` to filter commands in messages
|
||||
* Add `minus` operation for `SimpleFilter`s
|
||||
|
||||
## 18.2.1
|
||||
|
||||
* `Version`:
|
||||
* `Serialization`: `1.7.2` -> `1.7.3`
|
||||
* `Coroutines`: `1.8.1` -> `1.9.0`
|
||||
* `MicroUtils`: `0.22.2` -> `0.22.4`
|
||||
|
||||
## 18.2.0
|
||||
|
||||
**THIS UPDATE CONTAINS SUPPORT OF [BOTS API 7.10](https://core.telegram.org/bots/api-changelog#september-6-2024)**
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# TelegramBotAPI [](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi) [](https://core.telegram.org/bots/api-changelog#september-6-2024)
|
||||
# TelegramBotAPI [](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi) [](https://core.telegram.org/bots/api-changelog#april-11-2025)
|
||||
|
||||
| Docs | [](https://tgbotapi.inmo.dev/index.html) [](https://docs.inmo.dev/tgbotapi/index.html) |
|
||||
|:----------------------:|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|
|
||||
|
||||
35
build.gradle
35
build.gradle
@@ -1,8 +1,8 @@
|
||||
buildscript {
|
||||
repositories {
|
||||
mavenLocal()
|
||||
mavenCentral()
|
||||
maven { url "https://plugins.gradle.org/m2/" }
|
||||
mavenLocal()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
@@ -18,15 +18,30 @@ plugins {
|
||||
alias(libs.plugins.kotlin.dokka)
|
||||
alias(libs.plugins.versions)
|
||||
alias(libs.plugins.validator)
|
||||
alias(libs.plugins.nmcp.aggregation)
|
||||
}
|
||||
|
||||
|
||||
if ((project.hasProperty('SONATYPE_USER') || System.getenv('SONATYPE_USER') != null) && (project.hasProperty('SONATYPE_PASSWORD') || System.getenv('SONATYPE_PASSWORD') != null)) {
|
||||
nmcpAggregation {
|
||||
centralPortal {
|
||||
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')
|
||||
verificationTimeout = Duration.ofSeconds(0)
|
||||
publishingType = "USER_MANAGED"
|
||||
}
|
||||
|
||||
publishAllProjectsProbablyBreakingProjectIsolation()
|
||||
}
|
||||
}
|
||||
|
||||
// temporal crutch until legacy tests will be stabled or legacy target will be removed
|
||||
allprojects {
|
||||
repositories {
|
||||
mavenLocal()
|
||||
maven { url "https://nexus.inmo.dev/repository/maven-releases/" }
|
||||
mavenCentral()
|
||||
google()
|
||||
maven { url "https://nexus.inmo.dev/repository/maven-releases/" }
|
||||
mavenLocal()
|
||||
}
|
||||
if (it != rootProject.findProject("docs")) {
|
||||
tasks.whenTaskAdded { task ->
|
||||
@@ -48,12 +63,20 @@ private String getCurrentVersionChangelog() {
|
||||
return changelogDataOS.toString().trim()
|
||||
}
|
||||
|
||||
if (new File(projectDir, "secret.gradle").exists()) {
|
||||
apply from: './secret.gradle'
|
||||
|
||||
def githubTokenVariableName = "GITHUB_RELEASE_TOKEN"
|
||||
def githubTokenVariableFromEnv = System.getenv(githubTokenVariableName)
|
||||
|
||||
def secretFile = new File(projectDir, "secret.gradle")
|
||||
if (secretFile.exists() || project.hasProperty(githubTokenVariableName) || (githubTokenVariableFromEnv != "" && githubTokenVariableFromEnv != null)) {
|
||||
if (secretFile.exists()) {
|
||||
apply from: './secret.gradle'
|
||||
}
|
||||
apply plugin: "com.github.breadmoirai.github-release"
|
||||
def githubReleaseToken = project.hasProperty(githubTokenVariableName) ? project.property(githubTokenVariableName).toString() : githubTokenVariableFromEnv
|
||||
|
||||
githubRelease {
|
||||
token "${project.property('GITHUB_RELEASE_TOKEN')}"
|
||||
token githubReleaseToken
|
||||
|
||||
owner = "InsanusMokrassar"
|
||||
repo = "TelegramBotAPI"
|
||||
|
||||
@@ -55,7 +55,7 @@ Object callback = {
|
||||
|
||||
sourceLink {
|
||||
localDirectory.set(file("../"))
|
||||
remoteUrl.set(new URL("https://github.com/InsanusMokrassar/ktgbotapi/tree/master"))
|
||||
remoteUrl.set(new URL("https://github.com/InsanusMokrassar/ktgbotapi"))
|
||||
remoteLineSuffix.set("#L")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,3 +15,13 @@ allprojects {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tasks.register("getPublishableModules") {
|
||||
doLast {
|
||||
rootProject.subprojects.each { project ->
|
||||
if (project.plugins.hasPlugin('maven-publish')) {
|
||||
println(":${project.name}")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,4 +6,4 @@ kotlin.incremental=true
|
||||
kotlin.incremental.js=true
|
||||
|
||||
library_group=dev.inmo
|
||||
library_version=18.2.0
|
||||
library_version=26.1.0
|
||||
|
||||
@@ -1,27 +1,28 @@
|
||||
[versions]
|
||||
|
||||
kotlin = "2.0.20"
|
||||
kotlin-serialization = "1.7.2"
|
||||
kotlin-coroutines = "1.8.1"
|
||||
kotlin = "2.1.20"
|
||||
kotlin-serialization = "1.8.1"
|
||||
kotlin-coroutines = "1.10.2"
|
||||
|
||||
javax-activation = "1.1.1"
|
||||
|
||||
korlibs = "5.4.0"
|
||||
uuid = "0.8.4"
|
||||
ktor = "2.3.12"
|
||||
ktor = "3.1.3"
|
||||
|
||||
ksp = "2.0.20-1.0.24"
|
||||
ksp = "2.1.20-1.0.31"
|
||||
kotlin-poet = "1.18.1"
|
||||
|
||||
microutils = "0.22.2"
|
||||
kslog = "1.3.6"
|
||||
microutils = "0.25.7"
|
||||
kslog = "1.4.1"
|
||||
|
||||
versions = "0.51.0"
|
||||
|
||||
github-release-plugin = "2.5.2"
|
||||
dokka = "1.9.20"
|
||||
dokka = "2.0.0"
|
||||
|
||||
validator = "0.16.3"
|
||||
validator = "0.17.0"
|
||||
nmcp = "0.1.5"
|
||||
|
||||
[libraries]
|
||||
|
||||
@@ -57,6 +58,11 @@ microutils-serialization-mapper = { module = "dev.inmo:micro_utils.serialization
|
||||
microutils-languageCodes = { module = "dev.inmo:micro_utils.language_codes", version.ref = "microutils" }
|
||||
microutils-ktor-common = { module = "dev.inmo:micro_utils.ktor.common", version.ref = "microutils" }
|
||||
microutils-fsm-common = { module = "dev.inmo:micro_utils.fsm.common", version.ref = "microutils" }
|
||||
microutils-ksp-generator = { module = "dev.inmo:micro_utils.ksp.generator", version.ref = "microutils" }
|
||||
microutils-ksp-sealed = { module = "dev.inmo:micro_utils.ksp.sealed", version.ref = "microutils" }
|
||||
microutils-ksp-sealed-generator = { module = "dev.inmo:micro_utils.ksp.sealed.generator", version.ref = "microutils" }
|
||||
microutils-ksp-variations = { module = "dev.inmo:micro_utils.ksp.variations", version.ref = "microutils" }
|
||||
microutils-ksp-variations-generator = { module = "dev.inmo:micro_utils.ksp.variations.generator", version.ref = "microutils" }
|
||||
|
||||
kslog = { module = "dev.inmo:kslog", version.ref = "kslog" }
|
||||
|
||||
@@ -81,3 +87,4 @@ kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", versi
|
||||
kotlin-dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" }
|
||||
versions = { id = "com.github.ben-manes.versions", version.ref = "versions" }
|
||||
validator = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version.ref = "validator" }
|
||||
nmcp-aggregation = { id = "com.gradleup.nmcp.aggregation", version.ref = "nmcp" }
|
||||
|
||||
@@ -19,59 +19,52 @@ publishing {
|
||||
}
|
||||
|
||||
developers {
|
||||
|
||||
developer {
|
||||
id = "InsanusMokrassar"
|
||||
name = "Ovsiannikov Aleksei"
|
||||
email = "ovsyannikov.alexey95@gmail.com"
|
||||
}
|
||||
|
||||
developer {
|
||||
id = "InsanusMokrassar"
|
||||
name = "Ovsiannikov Aleksei"
|
||||
email = "ovsyannikov.alexey95@gmail.com"
|
||||
}
|
||||
}
|
||||
|
||||
licenses {
|
||||
|
||||
license {
|
||||
name = "Apache Software License 2.0"
|
||||
url = "https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/LICENSE"
|
||||
}
|
||||
|
||||
license {
|
||||
name = "Apache Software License 2.0"
|
||||
url = "https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/LICENSE"
|
||||
}
|
||||
}
|
||||
}
|
||||
repositories {
|
||||
if ((project.hasProperty('GITHUB_USER') || System.getenv('GITHUB_USER') != null) && (project.hasProperty('GITHUB_TOKEN') || System.getenv('GITHUB_TOKEN') != null)) {
|
||||
maven {
|
||||
name = "GithubPackages"
|
||||
url = uri("https://maven.pkg.github.com/InsanusMokrassar/ktgbotapi")
|
||||
|
||||
credentials {
|
||||
username = project.hasProperty('GITHUB_USER') ? project.property('GITHUB_USER') : System.getenv('GITHUB_USER')
|
||||
password = project.hasProperty('GITHUB_TOKEN') ? project.property('GITHUB_TOKEN') : System.getenv('GITHUB_TOKEN')
|
||||
}
|
||||
|
||||
}
|
||||
repositories {
|
||||
if ((project.hasProperty('GITHUB_USER') || System.getenv('GITHUB_USER') != null) && (project.hasProperty('GITHUB_TOKEN') || System.getenv('GITHUB_TOKEN') != null)) {
|
||||
maven {
|
||||
name = "GithubPackages"
|
||||
url = uri("https://maven.pkg.github.com/InsanusMokrassar/ktgbotapi")
|
||||
|
||||
credentials {
|
||||
username = project.hasProperty('GITHUB_USER') ? project.property('GITHUB_USER') : System.getenv('GITHUB_USER')
|
||||
password = project.hasProperty('GITHUB_TOKEN') ? project.property('GITHUB_TOKEN') : System.getenv('GITHUB_TOKEN')
|
||||
}
|
||||
}
|
||||
if ((project.hasProperty('INMONEXUS_USER') || System.getenv('INMONEXUS_USER') != null) && (project.hasProperty('INMONEXUS_PASSWORD') || System.getenv('INMONEXUS_PASSWORD') != null)) {
|
||||
maven {
|
||||
name = "InmoNexus"
|
||||
url = uri("https://nexus.inmo.dev/repository/maven-releases/")
|
||||
|
||||
credentials {
|
||||
username = project.hasProperty('INMONEXUS_USER') ? project.property('INMONEXUS_USER') : System.getenv('INMONEXUS_USER')
|
||||
password = project.hasProperty('INMONEXUS_PASSWORD') ? project.property('INMONEXUS_PASSWORD') : System.getenv('INMONEXUS_PASSWORD')
|
||||
}
|
||||
|
||||
}
|
||||
if ((project.hasProperty('INMONEXUS_USER') || System.getenv('INMONEXUS_USER') != null) && (project.hasProperty('INMONEXUS_PASSWORD') || System.getenv('INMONEXUS_PASSWORD') != null)) {
|
||||
maven {
|
||||
name = "InmoNexus"
|
||||
url = uri("https://nexus.inmo.dev/repository/maven-releases/")
|
||||
|
||||
credentials {
|
||||
username = project.hasProperty('INMONEXUS_USER') ? project.property('INMONEXUS_USER') : System.getenv('INMONEXUS_USER')
|
||||
password = project.hasProperty('INMONEXUS_PASSWORD') ? project.property('INMONEXUS_PASSWORD') : System.getenv('INMONEXUS_PASSWORD')
|
||||
}
|
||||
}
|
||||
if ((project.hasProperty('SONATYPE_USER') || System.getenv('SONATYPE_USER') != null) && (project.hasProperty('SONATYPE_PASSWORD') || System.getenv('SONATYPE_PASSWORD') != null)) {
|
||||
maven {
|
||||
name = "sonatype"
|
||||
url = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/")
|
||||
|
||||
credentials {
|
||||
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')
|
||||
}
|
||||
|
||||
}
|
||||
if ((project.hasProperty('SONATYPE_USER') || System.getenv('SONATYPE_USER') != null) && (project.hasProperty('SONATYPE_PASSWORD') || System.getenv('SONATYPE_PASSWORD') != null)) {
|
||||
maven {
|
||||
name = "sonatype"
|
||||
url = uri("https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/")
|
||||
|
||||
credentials {
|
||||
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')
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -80,13 +73,13 @@ publishing {
|
||||
|
||||
if (project.hasProperty("signing.gnupg.keyName")) {
|
||||
apply plugin: 'signing'
|
||||
|
||||
|
||||
signing {
|
||||
useGpgCmd()
|
||||
|
||||
|
||||
sign publishing.publications
|
||||
}
|
||||
|
||||
|
||||
task signAll {
|
||||
tasks.withType(Sign).forEach {
|
||||
dependsOn(it)
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"licenses":[{"id":"Apache-2.0","title":"Apache Software License 2.0","url":"https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/LICENSE"}],"mavenConfig":{"name":"${project.name}","description":"${project.description}","url":"https://insanusmokrassar.github.io/TelegramBotAPI/TelegramBotAPI","vcsUrl":"https://github.com/insanusmokrassar/TelegramBotAPI.git","developers":[{"id":"InsanusMokrassar","name":"Ovsiannikov Aleksei","eMail":"ovsyannikov.alexey95@gmail.com"}],"repositories":[{"name":"GithubPackages","url":"https://maven.pkg.github.com/InsanusMokrassar/ktgbotapi","credsType":{"type":"dev.inmo.kmppscriptbuilder.core.models.MavenPublishingRepository.CredentialsType.UsernameAndPassword","usernameProperty":"GITHUB_USER","passwordProperty":"GITHUB_TOKEN"}},{"name":"InmoNexus","url":"https://nexus.inmo.dev/repository/maven-releases/"},{"name":"sonatype","url":"https://oss.sonatype.org/service/local/staging/deploy/maven2/"}],"gpgSigning":{"type":"dev.inmo.kmppscriptbuilder.core.models.GpgSigning.Optional"}}}
|
||||
{"licenses":[{"id":"Apache-2.0","title":"Apache Software License 2.0","url":"https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/LICENSE"}],"mavenConfig":{"name":"${project.name}","description":"${project.description}","url":"https://insanusmokrassar.github.io/TelegramBotAPI/TelegramBotAPI","vcsUrl":"https://github.com/insanusmokrassar/TelegramBotAPI.git","developers":[{"id":"InsanusMokrassar","name":"Ovsiannikov Aleksei","eMail":"ovsyannikov.alexey95@gmail.com"}],"repositories":[{"name":"GithubPackages","url":"https://maven.pkg.github.com/InsanusMokrassar/ktgbotapi","credsType":{"type":"dev.inmo.kmppscriptbuilder.core.models.MavenPublishingRepository.CredentialsType.UsernameAndPassword","usernameProperty":"GITHUB_USER","passwordProperty":"GITHUB_TOKEN"}},{"name":"InmoNexus","url":"https://nexus.inmo.dev/repository/maven-releases/"},{"name":"sonatype","url":"https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/"}],"gpgSigning":{"type":"dev.inmo.kmppscriptbuilder.core.models.GpgSigning.Optional"},"includeCentralSonatypeUploadingScript":false}}
|
||||
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -2,6 +2,7 @@ plugins {
|
||||
id "org.jetbrains.kotlin.multiplatform"
|
||||
id "org.jetbrains.kotlin.plugin.serialization"
|
||||
id "org.jetbrains.dokka"
|
||||
id "com.google.devtools.ksp"
|
||||
}
|
||||
|
||||
project.description = "API extensions with \"Telegram Bot API\"-like extensions for TelegramBot and RequestsExecutor"
|
||||
@@ -14,6 +15,7 @@ kotlin {
|
||||
commonMain {
|
||||
dependencies {
|
||||
api project(":tgbotapi.core")
|
||||
api libs.microutils.ksp.variations
|
||||
}
|
||||
}
|
||||
configureEach {
|
||||
@@ -22,3 +24,8 @@ kotlin {
|
||||
}
|
||||
explicitApi()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
add("kspCommonMainMetadata", libs.microutils.ksp.variations.generator)
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import dev.inmo.tgbotapi.requests.ForwardMessage
|
||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.MessageId
|
||||
import dev.inmo.tgbotapi.types.MessageThreadId
|
||||
import dev.inmo.tgbotapi.types.Seconds
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.PossiblyForwardedMessage
|
||||
@@ -15,10 +16,11 @@ public suspend fun TelegramBot.forwardMessage(
|
||||
toChatId: ChatIdentifier,
|
||||
messageId: MessageId,
|
||||
threadId: MessageThreadId? = toChatId.threadId,
|
||||
startTimestamp: Seconds? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false
|
||||
): PossiblyForwardedMessage = execute(
|
||||
ForwardMessage(fromChatId, toChatId, messageId, threadId, disableNotification, protectContent)
|
||||
ForwardMessage(fromChatId, toChatId, messageId, threadId, startTimestamp, disableNotification, protectContent)
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.forwardMessage(
|
||||
@@ -26,40 +28,45 @@ public suspend fun TelegramBot.forwardMessage(
|
||||
toChatId: ChatIdentifier,
|
||||
messageId: MessageId,
|
||||
threadId: MessageThreadId? = toChatId.threadId,
|
||||
startTimestamp: Seconds? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false
|
||||
): PossiblyForwardedMessage = forwardMessage(fromChat.id, toChatId, messageId, threadId, disableNotification, protectContent)
|
||||
): PossiblyForwardedMessage = forwardMessage(fromChat.id, toChatId, messageId, threadId, startTimestamp, disableNotification, protectContent)
|
||||
|
||||
public suspend fun TelegramBot.forwardMessage(
|
||||
fromChatId: ChatIdentifier,
|
||||
toChat: Chat,
|
||||
messageId: MessageId,
|
||||
threadId: MessageThreadId? = toChat.id.threadId,
|
||||
startTimestamp: Seconds? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false
|
||||
): PossiblyForwardedMessage = forwardMessage(fromChatId, toChat.id, messageId, threadId, disableNotification, protectContent)
|
||||
): PossiblyForwardedMessage = forwardMessage(fromChatId, toChat.id, messageId, threadId, startTimestamp, disableNotification, protectContent)
|
||||
|
||||
public suspend fun TelegramBot.forwardMessage(
|
||||
fromChat: Chat,
|
||||
toChat: Chat,
|
||||
messageId: MessageId,
|
||||
threadId: MessageThreadId? = toChat.id.threadId,
|
||||
startTimestamp: Seconds? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false
|
||||
): PossiblyForwardedMessage = forwardMessage(fromChat.id, toChat.id, messageId, threadId, disableNotification, protectContent)
|
||||
): PossiblyForwardedMessage = forwardMessage(fromChat.id, toChat.id, messageId, threadId, startTimestamp, disableNotification, protectContent)
|
||||
|
||||
public suspend fun TelegramBot.forwardMessage(
|
||||
toChatId: ChatIdentifier,
|
||||
message: AccessibleMessage,
|
||||
threadId: MessageThreadId? = toChatId.threadId,
|
||||
startTimestamp: Seconds? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false
|
||||
): PossiblyForwardedMessage = forwardMessage(message.chat, toChatId, message.messageId, threadId, disableNotification, protectContent)
|
||||
): PossiblyForwardedMessage = forwardMessage(message.chat, toChatId, message.messageId, threadId, startTimestamp, disableNotification, protectContent)
|
||||
|
||||
public suspend fun TelegramBot.forwardMessage(
|
||||
toChat: Chat,
|
||||
message: AccessibleMessage,
|
||||
threadId: MessageThreadId? = toChat.id.threadId,
|
||||
startTimestamp: Seconds? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false
|
||||
): PossiblyForwardedMessage = forwardMessage(message.chat, toChat, message.messageId, threadId, disableNotification, protectContent)
|
||||
): PossiblyForwardedMessage = forwardMessage(message.chat, toChat, message.messageId, threadId, startTimestamp, disableNotification, protectContent)
|
||||
|
||||
@@ -53,6 +53,7 @@ public suspend fun TelegramBot.handleLiveLocation(
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
sentMessageFlow: FlowCollector<ContentMessage<LiveLocationContent>>? = null
|
||||
@@ -90,6 +91,7 @@ public suspend fun TelegramBot.handleLiveLocation(
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
allowPaidBroadcast,
|
||||
effectId,
|
||||
replyParameters,
|
||||
it.replyMarkup
|
||||
@@ -126,6 +128,7 @@ public suspend fun TelegramBot.handleLiveLocation(
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
sentMessageFlow: FlowCollector<ContentMessage<LiveLocationContent>>? = null
|
||||
@@ -147,6 +150,7 @@ public suspend fun TelegramBot.handleLiveLocation(
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
sentMessageFlow = sentMessageFlow
|
||||
@@ -167,6 +171,7 @@ public suspend fun TelegramBot.handleLiveLocation(
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
sentMessageFlow: FlowCollector<ContentMessage<LiveLocationContent>>? = null
|
||||
@@ -184,6 +189,7 @@ public suspend fun TelegramBot.handleLiveLocation(
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
sentMessageFlow = sentMessageFlow
|
||||
|
||||
@@ -99,6 +99,7 @@ public suspend fun TelegramBot.startLiveLocation(
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
@@ -106,20 +107,21 @@ public suspend fun TelegramBot.startLiveLocation(
|
||||
val liveTimeAsDouble = liveTimeMillis.toDouble()
|
||||
val locationMessage = execute(
|
||||
SendLiveLocation(
|
||||
chatId,
|
||||
latitude,
|
||||
longitude,
|
||||
ceil(liveTimeAsDouble / 1000).toInt(),
|
||||
initHorizontalAccuracy,
|
||||
initHeading,
|
||||
initProximityAlertRadius,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
effectId,
|
||||
replyParameters,
|
||||
replyMarkup
|
||||
chatId = chatId,
|
||||
latitude = latitude,
|
||||
longitude = longitude,
|
||||
livePeriod = ceil(liveTimeAsDouble / 1000).toInt(),
|
||||
horizontalAccuracy = initHorizontalAccuracy,
|
||||
heading = initHeading,
|
||||
proximityAlertRadius = initProximityAlertRadius,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
)
|
||||
|
||||
@@ -148,25 +150,27 @@ public suspend fun TelegramBot.startLiveLocation(
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): LiveLocationProvider = startLiveLocation(
|
||||
scope,
|
||||
chat.id,
|
||||
latitude,
|
||||
longitude,
|
||||
liveTimeMillis,
|
||||
initHorizontalAccuracy,
|
||||
initHeading,
|
||||
initProximityAlertRadius,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
effectId,
|
||||
replyParameters,
|
||||
replyMarkup
|
||||
scope = scope,
|
||||
chatId = chat.id,
|
||||
latitude = latitude,
|
||||
longitude = longitude,
|
||||
liveTimeMillis = liveTimeMillis,
|
||||
initHorizontalAccuracy = initHorizontalAccuracy,
|
||||
initHeading = initHeading,
|
||||
initProximityAlertRadius = initProximityAlertRadius,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -185,25 +189,27 @@ public suspend fun TelegramBot.startLiveLocation(
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): LiveLocationProvider = startLiveLocation(
|
||||
scope,
|
||||
chatId,
|
||||
location.latitude,
|
||||
location.longitude,
|
||||
liveTimeMillis,
|
||||
initHorizontalAccuracy,
|
||||
initHeading,
|
||||
initProximityAlertRadius,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
effectId,
|
||||
replyParameters,
|
||||
replyMarkup
|
||||
scope = scope,
|
||||
chatId = chatId,
|
||||
latitude = location.latitude,
|
||||
longitude = location.longitude,
|
||||
liveTimeMillis = liveTimeMillis,
|
||||
initHorizontalAccuracy = initHorizontalAccuracy,
|
||||
initHeading = initHeading,
|
||||
initProximityAlertRadius = initProximityAlertRadius,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -222,25 +228,27 @@ public suspend fun TelegramBot.startLiveLocation(
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): LiveLocationProvider = startLiveLocation(
|
||||
scope,
|
||||
chat.id,
|
||||
location.latitude,
|
||||
location.longitude,
|
||||
liveTimeMillis,
|
||||
initHorizontalAccuracy,
|
||||
initHeading,
|
||||
initProximityAlertRadius,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
effectId,
|
||||
replyParameters,
|
||||
replyMarkup
|
||||
scope = scope,
|
||||
chatId = chat.id,
|
||||
latitude = location.latitude,
|
||||
longitude = location.longitude,
|
||||
liveTimeMillis = liveTimeMillis,
|
||||
initHorizontalAccuracy = initHorizontalAccuracy,
|
||||
initHeading = initHeading,
|
||||
initProximityAlertRadius = initProximityAlertRadius,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -260,25 +268,27 @@ public suspend inline fun TelegramBot.replyWithLiveLocation(
|
||||
businessConnectionId: BusinessConnectionId? = to.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): LiveLocationProvider = startLiveLocation(
|
||||
scope,
|
||||
to.chat,
|
||||
latitude,
|
||||
longitude,
|
||||
liveTimeMillis,
|
||||
initHorizontalAccuracy,
|
||||
initHeading,
|
||||
initProximityAlertRadius,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
effectId,
|
||||
ReplyParameters(to.metaInfo, allowSendingWithoutReply = allowSendingWithoutReply),
|
||||
replyMarkup
|
||||
scope = scope,
|
||||
chat = to.chat,
|
||||
latitude = latitude,
|
||||
longitude = longitude,
|
||||
liveTimeMillis = liveTimeMillis,
|
||||
initHorizontalAccuracy = initHorizontalAccuracy,
|
||||
initHeading = initHeading,
|
||||
initProximityAlertRadius = initProximityAlertRadius,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = ReplyParameters(to.metaInfo, allowSendingWithoutReply = allowSendingWithoutReply),
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -297,22 +307,24 @@ public suspend inline fun TelegramBot.replyWithLiveLocation(
|
||||
businessConnectionId: BusinessConnectionId? = to.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): LiveLocationProvider = startLiveLocation(
|
||||
scope,
|
||||
to.chat,
|
||||
location,
|
||||
liveTimeMillis,
|
||||
initHorizontalAccuracy,
|
||||
initHeading,
|
||||
initProximityAlertRadius,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
effectId,
|
||||
ReplyParameters(to.metaInfo, allowSendingWithoutReply = allowSendingWithoutReply),
|
||||
replyMarkup
|
||||
scope = scope,
|
||||
chat = to.chat,
|
||||
location = location,
|
||||
liveTimeMillis = liveTimeMillis,
|
||||
initHorizontalAccuracy = initHorizontalAccuracy,
|
||||
initHeading = initHeading,
|
||||
initProximityAlertRadius = initProximityAlertRadius,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = ReplyParameters(to.metaInfo, allowSendingWithoutReply = allowSendingWithoutReply),
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
@@ -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)
|
||||
@@ -0,0 +1,25 @@
|
||||
package dev.inmo.tgbotapi.extensions.api.business
|
||||
|
||||
import dev.inmo.micro_utils.ksp.variations.GenerateVariations
|
||||
import dev.inmo.micro_utils.ksp.variations.GenerationVariant
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.business_connection.ConvertGiftToStars
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.GiftId
|
||||
import dev.inmo.tgbotapi.types.gifts.Gift
|
||||
|
||||
public suspend fun TelegramBot.convertGiftToStars(
|
||||
businessConnectionId: BusinessConnectionId,
|
||||
ownedGiftId: GiftId
|
||||
): Boolean = execute(
|
||||
ConvertGiftToStars(businessConnectionId, ownedGiftId)
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.convertGiftToStars(
|
||||
businessConnectionId: BusinessConnectionId,
|
||||
gift: Gift.Regular
|
||||
): Boolean = convertGiftToStars(
|
||||
businessConnectionId = businessConnectionId,
|
||||
ownedGiftId = with(gift) {id}
|
||||
)
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package dev.inmo.tgbotapi.extensions.api.business
|
||||
|
||||
import dev.inmo.micro_utils.ksp.variations.GenerateVariations
|
||||
import dev.inmo.micro_utils.ksp.variations.GenerationVariant
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.business_connection.DeleteBusinessMessages
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.ChatId
|
||||
import dev.inmo.tgbotapi.types.MessageId
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage
|
||||
|
||||
@GenerateVariations
|
||||
public suspend fun TelegramBot.deleteBusinessMessages(
|
||||
businessConnectionId: BusinessConnectionId,
|
||||
@GenerationVariant(List::class, "messages.map { it.messageId }", "messages", AccessibleMessage::class)
|
||||
messageIds: List<MessageId>
|
||||
): Boolean = execute(
|
||||
DeleteBusinessMessages(businessConnectionId, messageIds)
|
||||
)
|
||||
@@ -0,0 +1,16 @@
|
||||
// THIS CODE HAVE BEEN GENERATED AUTOMATICALLY
|
||||
// TO REGENERATE IT JUST DELETE FILE
|
||||
// ORIGINAL FILE: DeleteBusinessMessages.kt
|
||||
package dev.inmo.tgbotapi.extensions.api.business
|
||||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage
|
||||
import kotlin.Boolean
|
||||
import kotlin.collections.List
|
||||
|
||||
public suspend fun TelegramBot.deleteBusinessMessages(businessConnectionId: BusinessConnectionId,
|
||||
messages: List<AccessibleMessage>): Boolean = deleteBusinessMessages(
|
||||
businessConnectionId = businessConnectionId, messageIds = with(messages) {messages.map {
|
||||
it.messageId }}
|
||||
)
|
||||
@@ -0,0 +1,94 @@
|
||||
package dev.inmo.tgbotapi.extensions.api.business
|
||||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.business_connection.GetBusinessAccountGifts
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.OwnedGifts
|
||||
import dev.inmo.tgbotapi.types.gifts.GiftSentOrReceived
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
import kotlinx.coroutines.flow.flow
|
||||
import kotlin.runCatching
|
||||
|
||||
public suspend fun TelegramBot.getBusinessAccountGifts(
|
||||
businessConnectionId: BusinessConnectionId,
|
||||
excludeUnsaved: Boolean = false,
|
||||
excludeSaved: Boolean = false,
|
||||
excludeUnlimited: Boolean = false,
|
||||
excludeLimited: Boolean = false,
|
||||
excludeUnique: Boolean = false,
|
||||
sortByPrice: Boolean = false,
|
||||
offset: String? = null,
|
||||
limit: Int? = null
|
||||
): OwnedGifts<GiftSentOrReceived.ReceivedInBusinessAccount> = execute(
|
||||
GetBusinessAccountGifts(
|
||||
businessConnectionId,
|
||||
excludeUnsaved,
|
||||
excludeSaved,
|
||||
excludeUnlimited,
|
||||
excludeLimited,
|
||||
excludeUnique,
|
||||
sortByPrice,
|
||||
offset,
|
||||
limit
|
||||
)
|
||||
)
|
||||
|
||||
/**
|
||||
* Creates a flow that emits business account gifts in a paginated manner.
|
||||
*
|
||||
* This function will automatically handle pagination by using the `nextOffset` from each response
|
||||
* to fetch the next page of gifts until there are no more gifts to fetch.
|
||||
*
|
||||
* @param businessConnectionId The ID of the business connection
|
||||
* @param excludeUnsaved Whether to exclude unsaved gifts
|
||||
* @param excludeSaved Whether to exclude saved gifts
|
||||
* @param excludeUnlimited Whether to exclude unlimited gifts
|
||||
* @param excludeLimited Whether to exclude limited gifts
|
||||
* @param excludeUnique Whether to exclude unique gifts
|
||||
* @param sortByPrice Whether to sort gifts by price
|
||||
* @param initialOffset The initial offset to start fetching from. If null, starts from the beginning
|
||||
* @param limit The maximum number of gifts to fetch per request
|
||||
* @param onErrorContinueChecker A function that determines whether to continue fetching on error.
|
||||
* Returns true to continue, false to stop. Default is to stop on any error.
|
||||
* @return A flow that emits [OwnedGifts] containing the fetched gifts
|
||||
*/
|
||||
public fun TelegramBot.getBusinessAccountGiftsFlow(
|
||||
businessConnectionId: BusinessConnectionId,
|
||||
excludeUnsaved: Boolean = false,
|
||||
excludeSaved: Boolean = false,
|
||||
excludeUnlimited: Boolean = false,
|
||||
excludeLimited: Boolean = false,
|
||||
excludeUnique: Boolean = false,
|
||||
sortByPrice: Boolean = false,
|
||||
initialOffset: String? = null,
|
||||
limit: Int? = null,
|
||||
onErrorContinueChecker: suspend (Throwable?) -> Boolean = { false }
|
||||
): Flow<OwnedGifts<GiftSentOrReceived.ReceivedInBusinessAccount>> = flow {
|
||||
var currentOffset = initialOffset
|
||||
do {
|
||||
val response = runCatching {
|
||||
getBusinessAccountGifts(
|
||||
businessConnectionId,
|
||||
excludeUnsaved,
|
||||
excludeSaved,
|
||||
excludeUnlimited,
|
||||
excludeLimited,
|
||||
excludeUnique,
|
||||
sortByPrice,
|
||||
currentOffset,
|
||||
limit
|
||||
)
|
||||
}
|
||||
if (response.isSuccess) {
|
||||
val result = response.getOrThrow()
|
||||
emit(result)
|
||||
currentOffset = result.nextOffset
|
||||
} else {
|
||||
if (onErrorContinueChecker(response.exceptionOrNull())) {
|
||||
continue
|
||||
} else {
|
||||
break
|
||||
}
|
||||
}
|
||||
} while (currentOffset != null)
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package dev.inmo.tgbotapi.extensions.api.business
|
||||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.business_connection.GetBusinessAccountStarBalance
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.payments.stars.StarAmount
|
||||
|
||||
public suspend fun TelegramBot.getBusinessAccountStarBalance(
|
||||
businessConnectionId: BusinessConnectionId
|
||||
): StarAmount = execute(
|
||||
GetBusinessAccountStarBalance(businessConnectionId)
|
||||
)
|
||||
@@ -0,0 +1,27 @@
|
||||
package dev.inmo.tgbotapi.extensions.api.business
|
||||
|
||||
import dev.inmo.micro_utils.ksp.variations.GenerateVariations
|
||||
import dev.inmo.micro_utils.ksp.variations.GenerationVariant
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.business_connection.ReadBusinessMessage
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.ChatId
|
||||
import dev.inmo.tgbotapi.types.MessageId
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage
|
||||
import dev.inmo.tgbotapi.types.toChatId
|
||||
|
||||
@GenerateVariations
|
||||
public suspend fun TelegramBot.readBusinessMessage(
|
||||
businessConnectionId: BusinessConnectionId,
|
||||
@GenerationVariant(Chat::class, "chat.id.toChatId()", "chat")
|
||||
chatId: ChatId,
|
||||
messageId: MessageId
|
||||
): Boolean = execute(
|
||||
ReadBusinessMessage(businessConnectionId, chatId, messageId)
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.readBusinessMessage(
|
||||
businessConnectionId: BusinessConnectionId,
|
||||
message: AccessibleMessage
|
||||
): Boolean = readBusinessMessage(businessConnectionId, message.chat.id.toChatId(), message.messageId)
|
||||
@@ -0,0 +1,20 @@
|
||||
// THIS CODE HAVE BEEN GENERATED AUTOMATICALLY
|
||||
// TO REGENERATE IT JUST DELETE FILE
|
||||
// ORIGINAL FILE: ReadBusinessMessage.kt
|
||||
package dev.inmo.tgbotapi.extensions.api.business
|
||||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.types.MessageId
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.toChatId
|
||||
import kotlin.Boolean
|
||||
|
||||
public suspend fun TelegramBot.readBusinessMessage(
|
||||
businessConnectionId: BusinessConnectionId,
|
||||
chat: Chat,
|
||||
messageId: MessageId,
|
||||
): Boolean = readBusinessMessage(
|
||||
businessConnectionId = businessConnectionId, chatId = with(chat) {chat.id.toChatId()}, messageId
|
||||
= messageId
|
||||
)
|
||||
@@ -0,0 +1,12 @@
|
||||
package dev.inmo.tgbotapi.extensions.api.business
|
||||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.business_connection.RemoveBusinessAccountProfilePhoto
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
|
||||
public suspend fun TelegramBot.removeBusinessAccountProfilePhoto(
|
||||
businessConnectionId: BusinessConnectionId,
|
||||
isPublic: Boolean = false
|
||||
): Boolean = execute(
|
||||
RemoveBusinessAccountProfilePhoto(businessConnectionId = businessConnectionId, isPublic = isPublic)
|
||||
)
|
||||
@@ -0,0 +1,12 @@
|
||||
package dev.inmo.tgbotapi.extensions.api.business
|
||||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.business_connection.SetBusinessAccountBio
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
|
||||
public suspend fun TelegramBot.setBusinessAccountBio(
|
||||
businessConnectionId: BusinessConnectionId,
|
||||
bio: String
|
||||
): Boolean = execute(
|
||||
SetBusinessAccountBio(businessConnectionId, bio)
|
||||
)
|
||||
@@ -0,0 +1,35 @@
|
||||
package dev.inmo.tgbotapi.extensions.api.business
|
||||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.business_connection.SetBusinessAccountGiftSettings
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.gifts.AcceptedGiftTypes
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.BusinessContentMessage
|
||||
|
||||
/**
|
||||
* Sets the gift settings for a business account
|
||||
*/
|
||||
public suspend fun TelegramBot.setBusinessAccountGiftSettings(
|
||||
businessConnectionId: BusinessConnectionId,
|
||||
showGiftButton: Boolean,
|
||||
acceptedGiftTypes: AcceptedGiftTypes
|
||||
): Boolean = execute(
|
||||
SetBusinessAccountGiftSettings(
|
||||
businessConnectionId = businessConnectionId,
|
||||
showGiftButton = showGiftButton,
|
||||
acceptedGiftTypes = acceptedGiftTypes
|
||||
)
|
||||
)
|
||||
|
||||
/**
|
||||
* Sets the gift settings for a business account using business message context
|
||||
*/
|
||||
public suspend fun TelegramBot.setBusinessAccountGiftSettings(
|
||||
message: BusinessContentMessage<*>,
|
||||
showGiftButton: Boolean,
|
||||
acceptedGiftTypes: AcceptedGiftTypes
|
||||
): Boolean = setBusinessAccountGiftSettings(
|
||||
businessConnectionId = message.businessConnectionId,
|
||||
showGiftButton = showGiftButton,
|
||||
acceptedGiftTypes = acceptedGiftTypes
|
||||
)
|
||||
@@ -0,0 +1,13 @@
|
||||
package dev.inmo.tgbotapi.extensions.api.business
|
||||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.business_connection.SetBusinessAccountName
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
|
||||
public suspend fun TelegramBot.setBusinessAccountName(
|
||||
businessConnectionId: BusinessConnectionId,
|
||||
firstName: String,
|
||||
lastName: String? = null
|
||||
): Boolean = execute(
|
||||
SetBusinessAccountName(businessConnectionId, firstName, lastName)
|
||||
)
|
||||
@@ -0,0 +1,14 @@
|
||||
package dev.inmo.tgbotapi.extensions.api.business
|
||||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.business_connection.InputProfilePhoto
|
||||
import dev.inmo.tgbotapi.requests.business_connection.SetBusinessAccountProfilePhoto
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
|
||||
public suspend fun TelegramBot.setBusinessAccountProfilePhoto(
|
||||
businessConnectionId: BusinessConnectionId,
|
||||
photo: InputProfilePhoto,
|
||||
isPublic: Boolean = false
|
||||
): Boolean = execute(
|
||||
SetBusinessAccountProfilePhoto(businessConnectionId, photo, isPublic)
|
||||
)
|
||||
@@ -0,0 +1,17 @@
|
||||
package dev.inmo.tgbotapi.extensions.api.business
|
||||
|
||||
import dev.inmo.micro_utils.ksp.variations.GenerateVariations
|
||||
import dev.inmo.micro_utils.ksp.variations.GenerationVariant
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.business_connection.SetBusinessAccountUsername
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.Username
|
||||
|
||||
@GenerateVariations
|
||||
public suspend fun TelegramBot.setBusinessAccountUsername(
|
||||
businessConnectionId: BusinessConnectionId,
|
||||
@GenerationVariant(String::class, "Username(username)", "username")
|
||||
username: Username
|
||||
): Boolean = execute(
|
||||
SetBusinessAccountUsername(businessConnectionId, username)
|
||||
)
|
||||
@@ -0,0 +1,16 @@
|
||||
// THIS CODE HAVE BEEN GENERATED AUTOMATICALLY
|
||||
// TO REGENERATE IT JUST DELETE FILE
|
||||
// ORIGINAL FILE: SetBusinessAccountUsername.kt
|
||||
package dev.inmo.tgbotapi.extensions.api.business
|
||||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.types.Username
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import kotlin.Boolean
|
||||
import kotlin.String
|
||||
|
||||
public suspend
|
||||
fun TelegramBot.setBusinessAccountUsername(businessConnectionId: BusinessConnectionId,
|
||||
username: String): Boolean = setBusinessAccountUsername(
|
||||
businessConnectionId = businessConnectionId, username = with(username) { Username.prepare(username) }
|
||||
)
|
||||
@@ -0,0 +1,12 @@
|
||||
package dev.inmo.tgbotapi.extensions.api.business
|
||||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.business_connection.TransferBusinessAccountStars
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
|
||||
public suspend fun TelegramBot.transferBusinessAccountStars(
|
||||
businessConnectionId: BusinessConnectionId,
|
||||
amount: Int
|
||||
): Boolean = execute(
|
||||
TransferBusinessAccountStars(businessConnectionId, amount)
|
||||
)
|
||||
@@ -0,0 +1,43 @@
|
||||
package dev.inmo.tgbotapi.extensions.api.business
|
||||
|
||||
import dev.inmo.micro_utils.ksp.variations.GenerateVariations
|
||||
import dev.inmo.micro_utils.ksp.variations.GenerationVariant
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.business_connection.ConvertGiftToStars
|
||||
import dev.inmo.tgbotapi.requests.business_connection.TransferGift
|
||||
import dev.inmo.tgbotapi.requests.business_connection.UpgradeGift
|
||||
import dev.inmo.tgbotapi.types.ChatId
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.GiftId
|
||||
import dev.inmo.tgbotapi.types.businessConnectionIdField
|
||||
import dev.inmo.tgbotapi.types.gifts.Gift
|
||||
import dev.inmo.tgbotapi.types.keepOriginalDetailsField
|
||||
import dev.inmo.tgbotapi.types.ownedGiftIdField
|
||||
import dev.inmo.tgbotapi.types.starCountField
|
||||
import kotlinx.serialization.SerialName
|
||||
|
||||
public suspend fun TelegramBot.transferGift(
|
||||
businessConnectionId: BusinessConnectionId,
|
||||
ownedGiftId: GiftId,
|
||||
newOwnerChatId: ChatId,
|
||||
transferPaymentStarCount: Int? = null,
|
||||
): Boolean = execute(
|
||||
TransferGift(
|
||||
businessConnectionId = businessConnectionId,
|
||||
ownedGiftId = ownedGiftId,
|
||||
newOwnerChatId = newOwnerChatId,
|
||||
transferPaymentStarCount = transferPaymentStarCount
|
||||
)
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.transferGift(
|
||||
businessConnectionId: BusinessConnectionId,
|
||||
gift: Gift.Regular,
|
||||
newOwnerChatId: ChatId,
|
||||
transferPaymentStarCount: Int? = null,
|
||||
): Boolean = transferGift(
|
||||
businessConnectionId = businessConnectionId,
|
||||
ownedGiftId = gift.id,
|
||||
newOwnerChatId = newOwnerChatId,
|
||||
transferPaymentStarCount = transferPaymentStarCount
|
||||
)
|
||||
@@ -0,0 +1,42 @@
|
||||
package dev.inmo.tgbotapi.extensions.api.business
|
||||
|
||||
import dev.inmo.micro_utils.ksp.variations.GenerateVariations
|
||||
import dev.inmo.micro_utils.ksp.variations.GenerationVariant
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.business_connection.ConvertGiftToStars
|
||||
import dev.inmo.tgbotapi.requests.business_connection.UpgradeGift
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.GiftId
|
||||
import dev.inmo.tgbotapi.types.businessConnectionIdField
|
||||
import dev.inmo.tgbotapi.types.gifts.Gift
|
||||
import dev.inmo.tgbotapi.types.keepOriginalDetailsField
|
||||
import dev.inmo.tgbotapi.types.ownedGiftIdField
|
||||
import dev.inmo.tgbotapi.types.starCountField
|
||||
import kotlinx.serialization.SerialName
|
||||
|
||||
public suspend fun TelegramBot.convertGiftToStars(
|
||||
businessConnectionId: BusinessConnectionId,
|
||||
ownedGiftId: GiftId,
|
||||
keepOriginalDetails: Boolean = false,
|
||||
starCount: Int? = null
|
||||
): Boolean = execute(
|
||||
UpgradeGift(
|
||||
businessConnectionId = businessConnectionId,
|
||||
ownedGiftId = ownedGiftId,
|
||||
keepOriginalDetails = keepOriginalDetails,
|
||||
starCount = starCount
|
||||
)
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.convertGiftToStars(
|
||||
businessConnectionId: BusinessConnectionId,
|
||||
gift: Gift.Regular,
|
||||
keepOriginalDetails: Boolean = false,
|
||||
): Boolean = execute(
|
||||
UpgradeGift(
|
||||
businessConnectionId = businessConnectionId,
|
||||
ownedGiftId = gift.id,
|
||||
keepOriginalDetails = keepOriginalDetails,
|
||||
starCount = gift.upgradeStarCount
|
||||
)
|
||||
)
|
||||
@@ -4,6 +4,7 @@ import dev.inmo.tgbotapi.abstracts.TextedWithTextSources
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.extensions.api.edit.caption.editMessageCaption
|
||||
import dev.inmo.tgbotapi.extensions.api.edit.location.live.editLiveLocation
|
||||
import dev.inmo.tgbotapi.extensions.api.edit.media.addMessageMedia
|
||||
import dev.inmo.tgbotapi.extensions.api.edit.media.editMessageMedia
|
||||
import dev.inmo.tgbotapi.extensions.api.edit.reply_markup.editMessageReplyMarkup
|
||||
import dev.inmo.tgbotapi.extensions.api.edit.text.editMessageText
|
||||
@@ -173,6 +174,17 @@ public suspend fun TelegramBot.edit(
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
): ContentMessage<MediaContent> = editMessageMedia(message, media, businessConnectionId, replyMarkup)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
* as a builder for that
|
||||
*/
|
||||
public suspend fun TelegramBot.addMedia(
|
||||
message: ContentMessage<TextContent>,
|
||||
media: TelegramFreeMedia,
|
||||
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
): ContentMessage<MediaContent> = addMessageMedia(message, media, businessConnectionId, replyMarkup)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
* as a builder for that
|
||||
|
||||
@@ -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
|
||||
)
|
||||
)
|
||||
@@ -11,6 +11,8 @@ import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||
import dev.inmo.tgbotapi.types.message.content.MediaContent
|
||||
import dev.inmo.tgbotapi.types.message.content.TextContent
|
||||
import kotlin.jvm.JvmName
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
@@ -48,3 +50,14 @@ public suspend fun TelegramBot.editMessageMedia(
|
||||
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
): ContentMessage<MediaContent> = editMessageMedia(message.chat.id, message.messageId, media, businessConnectionId, replyMarkup)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
* as a builder for that
|
||||
*/
|
||||
public suspend fun TelegramBot.addMessageMedia(
|
||||
message: ContentMessage<TextContent>,
|
||||
media: TelegramFreeMedia,
|
||||
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
): ContentMessage<MediaContent> = editMessageMedia(message.chat.id, message.messageId, media, businessConnectionId, replyMarkup)
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
package dev.inmo.tgbotapi.extensions.api.edit.payments
|
||||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.edit.payments.EditUserStarSubscription
|
||||
import dev.inmo.tgbotapi.types.UserId
|
||||
import dev.inmo.tgbotapi.types.chat.User
|
||||
import dev.inmo.tgbotapi.types.payments.abstracts.TelegramPaymentChargeId
|
||||
|
||||
public suspend fun TelegramBot.editUserStarSubscription(
|
||||
userId: UserId,
|
||||
telegramPaymentChargeId: TelegramPaymentChargeId,
|
||||
isCanceled: Boolean
|
||||
): Boolean = execute(
|
||||
EditUserStarSubscription(
|
||||
userId = userId,
|
||||
telegramPaymentChargeId = telegramPaymentChargeId,
|
||||
isCanceled = isCanceled
|
||||
)
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.editUserStarSubscription(
|
||||
user: User,
|
||||
telegramPaymentChargeId: TelegramPaymentChargeId,
|
||||
isCanceled: Boolean
|
||||
): Boolean = editUserStarSubscription(
|
||||
userId = user.id,
|
||||
telegramPaymentChargeId = telegramPaymentChargeId,
|
||||
isCanceled = isCanceled
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.cancelUserStarSubscription(
|
||||
userId: UserId,
|
||||
telegramPaymentChargeId: TelegramPaymentChargeId,
|
||||
): Boolean = editUserStarSubscription(
|
||||
userId = userId,
|
||||
telegramPaymentChargeId = telegramPaymentChargeId,
|
||||
isCanceled = true
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.cancelUserStarSubscription(
|
||||
user: User,
|
||||
telegramPaymentChargeId: TelegramPaymentChargeId,
|
||||
): Boolean = editUserStarSubscription(
|
||||
user = user,
|
||||
telegramPaymentChargeId = telegramPaymentChargeId,
|
||||
isCanceled = true
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.enableUserStarSubscription(
|
||||
userId: UserId,
|
||||
telegramPaymentChargeId: TelegramPaymentChargeId,
|
||||
): Boolean = editUserStarSubscription(
|
||||
userId = userId,
|
||||
telegramPaymentChargeId = telegramPaymentChargeId,
|
||||
isCanceled = false
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.enableUserStarSubscription(
|
||||
user: User,
|
||||
telegramPaymentChargeId: TelegramPaymentChargeId,
|
||||
): Boolean = editUserStarSubscription(
|
||||
user = user,
|
||||
telegramPaymentChargeId = telegramPaymentChargeId,
|
||||
isCanceled = false
|
||||
)
|
||||
@@ -0,0 +1,7 @@
|
||||
package dev.inmo.tgbotapi.extensions.api.gifts
|
||||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.gifts.GetAvailableGifts
|
||||
import dev.inmo.tgbotapi.types.gifts.Gifts
|
||||
|
||||
public suspend fun TelegramBot.getAvailableGifts(): Gifts = execute(GetAvailableGifts)
|
||||
@@ -0,0 +1,55 @@
|
||||
package dev.inmo.tgbotapi.extensions.api.gifts
|
||||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.gifts.GiftPremiumSubscription
|
||||
import dev.inmo.tgbotapi.types.UserId
|
||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||
import dev.inmo.tgbotapi.types.message.textsources.TextSource
|
||||
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
||||
import dev.inmo.tgbotapi.utils.EntitiesBuilderBody
|
||||
import dev.inmo.tgbotapi.utils.buildEntities
|
||||
|
||||
public suspend fun TelegramBot.giftPremiumSubscription(
|
||||
userId: UserId,
|
||||
monthCount: Int,
|
||||
starCount: Int,
|
||||
text: String,
|
||||
parseMode: ParseMode? = null
|
||||
): Boolean = execute(
|
||||
GiftPremiumSubscription(
|
||||
userId = userId,
|
||||
monthCount = monthCount,
|
||||
starCount = starCount,
|
||||
text = text,
|
||||
parseMode = parseMode
|
||||
)
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.giftPremiumSubscription(
|
||||
userId: UserId,
|
||||
monthCount: Int,
|
||||
starCount: Int,
|
||||
textSources: TextSourcesList? = null,
|
||||
): Boolean = execute(
|
||||
GiftPremiumSubscription(
|
||||
userId = userId,
|
||||
monthCount = monthCount,
|
||||
starCount = starCount,
|
||||
textSources = textSources
|
||||
)
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.giftPremiumSubscription(
|
||||
userId: UserId,
|
||||
monthCount: Int,
|
||||
starCount: Int,
|
||||
separator: TextSource? = null,
|
||||
textBuilder: EntitiesBuilderBody
|
||||
): Boolean = execute(
|
||||
GiftPremiumSubscription(
|
||||
userId = userId,
|
||||
monthCount = monthCount,
|
||||
starCount = starCount,
|
||||
textSources = buildEntities(separator, textBuilder),
|
||||
)
|
||||
)
|
||||
@@ -0,0 +1,118 @@
|
||||
package dev.inmo.tgbotapi.extensions.api.gifts
|
||||
|
||||
import dev.inmo.micro_utils.ksp.variations.GenerateVariations
|
||||
import dev.inmo.micro_utils.ksp.variations.GenerationVariant
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.gifts.SendGift
|
||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.GiftId
|
||||
import dev.inmo.tgbotapi.types.UserId
|
||||
import dev.inmo.tgbotapi.types.chat.PublicChat
|
||||
import dev.inmo.tgbotapi.types.chat.User
|
||||
import dev.inmo.tgbotapi.types.gifts.Gift
|
||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
||||
|
||||
@GenerateVariations
|
||||
public suspend fun TelegramBot.sendGift(
|
||||
@GenerationVariant(
|
||||
User::class,
|
||||
"id",
|
||||
"user"
|
||||
)
|
||||
userId: UserId,
|
||||
@GenerationVariant(
|
||||
Gift.Regular::class,
|
||||
"id",
|
||||
"gift"
|
||||
)
|
||||
giftId: GiftId,
|
||||
text: String,
|
||||
parseMode: ParseMode?,
|
||||
upgradableToUnique: Boolean = false
|
||||
): Boolean = execute(
|
||||
SendGift.toUser(
|
||||
userId = userId,
|
||||
giftId = giftId,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
upgradableToUnique = upgradableToUnique
|
||||
)
|
||||
)
|
||||
|
||||
@GenerateVariations
|
||||
public suspend fun TelegramBot.sendGiftToChat(
|
||||
@GenerationVariant(
|
||||
PublicChat::class,
|
||||
"id",
|
||||
"chat"
|
||||
)
|
||||
chatId: ChatIdentifier,
|
||||
@GenerationVariant(
|
||||
Gift.Regular::class,
|
||||
"id",
|
||||
"gift"
|
||||
)
|
||||
giftId: GiftId,
|
||||
text: String,
|
||||
parseMode: ParseMode?,
|
||||
upgradableToUnique: Boolean = false
|
||||
): Boolean = execute(
|
||||
SendGift.toChat(
|
||||
chatId = chatId,
|
||||
giftId = giftId,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
upgradableToUnique = upgradableToUnique
|
||||
)
|
||||
)
|
||||
|
||||
@GenerateVariations
|
||||
public suspend fun TelegramBot.sendGift(
|
||||
@GenerationVariant(
|
||||
User::class,
|
||||
"id",
|
||||
"user"
|
||||
)
|
||||
userId: UserId,
|
||||
@GenerationVariant(
|
||||
Gift.Regular::class,
|
||||
"id",
|
||||
"gift"
|
||||
)
|
||||
giftId: GiftId,
|
||||
textSources: TextSourcesList,
|
||||
upgradableToUnique: Boolean = false,
|
||||
): Boolean = execute(
|
||||
SendGift.toUser(
|
||||
userId = userId,
|
||||
giftId = giftId,
|
||||
textSources = textSources,
|
||||
upgradableToUnique = upgradableToUnique
|
||||
)
|
||||
)
|
||||
|
||||
@GenerateVariations
|
||||
public suspend fun TelegramBot.sendGiftToChat(
|
||||
@GenerationVariant(
|
||||
PublicChat::class,
|
||||
"id",
|
||||
"chat"
|
||||
)
|
||||
chatId: ChatIdentifier,
|
||||
@GenerationVariant(
|
||||
Gift.Regular::class,
|
||||
"id",
|
||||
"gift"
|
||||
)
|
||||
giftId: GiftId,
|
||||
textSources: TextSourcesList,
|
||||
upgradableToUnique: Boolean = false,
|
||||
): Boolean = execute(
|
||||
SendGift.toChat(
|
||||
chatId = chatId,
|
||||
giftId = giftId,
|
||||
textSources = textSources,
|
||||
upgradableToUnique = upgradableToUnique
|
||||
)
|
||||
)
|
||||
@@ -0,0 +1,73 @@
|
||||
// THIS CODE HAVE BEEN GENERATED AUTOMATICALLY
|
||||
// TO REGENERATE IT JUST DELETE FILE
|
||||
// ORIGINAL FILE: SendGift.kt
|
||||
package dev.inmo.tgbotapi.extensions.api.gifts
|
||||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.types.GiftId
|
||||
import dev.inmo.tgbotapi.types.UserId
|
||||
import dev.inmo.tgbotapi.types.chat.User
|
||||
import dev.inmo.tgbotapi.types.gifts.Gift
|
||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||
import kotlin.Boolean
|
||||
import kotlin.String
|
||||
|
||||
public suspend fun TelegramBot.sendGift(
|
||||
user: User,
|
||||
giftId: GiftId,
|
||||
text: String,
|
||||
parseMode: ParseMode?,
|
||||
): Boolean = sendGift(
|
||||
userId = with(user) {id}, giftId = giftId, text = text, parseMode = parseMode
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.sendGift(
|
||||
user: User,
|
||||
giftId: GiftId,
|
||||
text: String,
|
||||
parseMode: ParseMode?,
|
||||
upgradableToUnique: Boolean,
|
||||
): Boolean = sendGift(
|
||||
userId = with(user) {id}, giftId = giftId, text = text, parseMode = parseMode,
|
||||
upgradableToUnique = upgradableToUnique
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.sendGift(
|
||||
userId: UserId,
|
||||
gift: Gift.Regular,
|
||||
text: String,
|
||||
parseMode: ParseMode?,
|
||||
): Boolean = sendGift(
|
||||
userId = userId, giftId = with(gift) {id}, text = text, parseMode = parseMode
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.sendGift(
|
||||
userId: UserId,
|
||||
gift: Gift.Regular,
|
||||
text: String,
|
||||
parseMode: ParseMode?,
|
||||
upgradableToUnique: Boolean,
|
||||
): Boolean = sendGift(
|
||||
userId = userId, giftId = with(gift) {id}, text = text, parseMode = parseMode,
|
||||
upgradableToUnique = upgradableToUnique
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.sendGift(
|
||||
user: User,
|
||||
gift: Gift.Regular,
|
||||
text: String,
|
||||
parseMode: ParseMode?,
|
||||
): Boolean = sendGift(
|
||||
user = user, giftId = with(gift) {id}, text = text, parseMode = parseMode
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.sendGift(
|
||||
user: User,
|
||||
gift: Gift.Regular,
|
||||
text: String,
|
||||
parseMode: ParseMode?,
|
||||
upgradableToUnique: Boolean,
|
||||
): Boolean = sendGift(
|
||||
user = user, giftId = with(gift) {id}, text = text, parseMode = parseMode, upgradableToUnique =
|
||||
upgradableToUnique
|
||||
)
|
||||
@@ -0,0 +1,73 @@
|
||||
// THIS CODE HAVE BEEN GENERATED AUTOMATICALLY
|
||||
// TO REGENERATE IT JUST DELETE FILE
|
||||
// ORIGINAL FILE: SendGift.kt
|
||||
package dev.inmo.tgbotapi.extensions.api.gifts
|
||||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.GiftId
|
||||
import dev.inmo.tgbotapi.types.chat.PublicChat
|
||||
import dev.inmo.tgbotapi.types.gifts.Gift
|
||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||
import kotlin.Boolean
|
||||
import kotlin.String
|
||||
|
||||
public suspend fun TelegramBot.sendGiftToChat(
|
||||
chat: PublicChat,
|
||||
giftId: GiftId,
|
||||
text: String,
|
||||
parseMode: ParseMode?,
|
||||
): Boolean = sendGiftToChat(
|
||||
chatId = with(chat) {id}, giftId = giftId, text = text, parseMode = parseMode
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.sendGiftToChat(
|
||||
chat: PublicChat,
|
||||
giftId: GiftId,
|
||||
text: String,
|
||||
parseMode: ParseMode?,
|
||||
upgradableToUnique: Boolean,
|
||||
): Boolean = sendGiftToChat(
|
||||
chatId = with(chat) {id}, giftId = giftId, text = text, parseMode = parseMode,
|
||||
upgradableToUnique = upgradableToUnique
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.sendGiftToChat(
|
||||
chatId: ChatIdentifier,
|
||||
gift: Gift.Regular,
|
||||
text: String,
|
||||
parseMode: ParseMode?,
|
||||
): Boolean = sendGiftToChat(
|
||||
chatId = chatId, giftId = with(gift) {id}, text = text, parseMode = parseMode
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.sendGiftToChat(
|
||||
chatId: ChatIdentifier,
|
||||
gift: Gift.Regular,
|
||||
text: String,
|
||||
parseMode: ParseMode?,
|
||||
upgradableToUnique: Boolean,
|
||||
): Boolean = sendGiftToChat(
|
||||
chatId = chatId, giftId = with(gift) {id}, text = text, parseMode = parseMode,
|
||||
upgradableToUnique = upgradableToUnique
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.sendGiftToChat(
|
||||
chat: PublicChat,
|
||||
gift: Gift.Regular,
|
||||
text: String,
|
||||
parseMode: ParseMode?,
|
||||
): Boolean = sendGiftToChat(
|
||||
chat = chat, giftId = with(gift) {id}, text = text, parseMode = parseMode
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.sendGiftToChat(
|
||||
chat: PublicChat,
|
||||
gift: Gift.Regular,
|
||||
text: String,
|
||||
parseMode: ParseMode?,
|
||||
upgradableToUnique: Boolean,
|
||||
): Boolean = sendGiftToChat(
|
||||
chat = chat, giftId = with(gift) {id}, text = text, parseMode = parseMode, upgradableToUnique =
|
||||
upgradableToUnique
|
||||
)
|
||||
@@ -0,0 +1,45 @@
|
||||
package dev.inmo.tgbotapi.extensions.api.inline
|
||||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.answers.InlineQueryAnswersResultsSerializer
|
||||
import dev.inmo.tgbotapi.requests.inline.SavePreparedInlineMessage
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.InlineQueryResult
|
||||
import dev.inmo.tgbotapi.types.InlineQueries.prepared.PreparedInlineMessage
|
||||
import dev.inmo.tgbotapi.types.chat.User
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
public suspend fun TelegramBot.savePreparedInlineMessage(
|
||||
userId: UserId,
|
||||
result: InlineQueryResult,
|
||||
allowSendToUsers: Boolean = false,
|
||||
allowSendToBots: Boolean = false,
|
||||
allowSendToGroups: Boolean = false,
|
||||
allowSendToChannels: Boolean = false,
|
||||
): PreparedInlineMessage = execute(
|
||||
SavePreparedInlineMessage(
|
||||
userId = userId,
|
||||
result = result,
|
||||
allowSendToUsers = allowSendToUsers,
|
||||
allowSendToBots = allowSendToBots,
|
||||
allowSendToGroups = allowSendToGroups,
|
||||
allowSendToChannels = allowSendToChannels
|
||||
)
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.savePreparedInlineMessage(
|
||||
user: User,
|
||||
result: InlineQueryResult,
|
||||
allowSendToUsers: Boolean = false,
|
||||
allowSendToBots: Boolean = false,
|
||||
allowSendToGroups: Boolean = false,
|
||||
allowSendToChannels: Boolean = false,
|
||||
): PreparedInlineMessage = savePreparedInlineMessage(
|
||||
userId = user.id,
|
||||
result = result,
|
||||
allowSendToUsers = allowSendToUsers,
|
||||
allowSendToBots = allowSendToBots,
|
||||
allowSendToGroups = allowSendToGroups,
|
||||
allowSendToChannels = allowSendToChannels
|
||||
)
|
||||
@@ -21,23 +21,27 @@ public suspend inline fun TelegramBot.copyMessage(
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
threadId: MessageThreadId? = toChatId.threadId,
|
||||
startTimestamp: Seconds? = null,
|
||||
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,
|
||||
replyParameters,
|
||||
replyMarkup
|
||||
fromChatId = fromChatId,
|
||||
messageId = messageId,
|
||||
toChatId = toChatId,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
threadId = threadId,
|
||||
startTimestamp = startTimestamp,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
)
|
||||
|
||||
@@ -53,11 +57,27 @@ public suspend inline fun TelegramBot.copyMessage(
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
threadId: MessageThreadId? = toChatId.threadId,
|
||||
startTimestamp: Seconds? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): MessageId = copyMessage(fromChat.id, messageId, toChatId, text, parseMode, showCaptionAboveMedia, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
||||
): MessageId = copyMessage(
|
||||
fromChatId = fromChat.id,
|
||||
messageId = messageId,
|
||||
toChatId = toChatId,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
threadId = threadId,
|
||||
startTimestamp = startTimestamp,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
@@ -71,11 +91,27 @@ public suspend inline fun TelegramBot.copyMessage(
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
threadId: MessageThreadId? = toChat.id.threadId,
|
||||
startTimestamp: Seconds? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): MessageId = copyMessage(fromChatId, messageId, toChat.id, text, parseMode, showCaptionAboveMedia, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
||||
): MessageId = copyMessage(
|
||||
fromChatId = fromChatId,
|
||||
messageId = messageId,
|
||||
toChatId = toChat.id,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
threadId = threadId,
|
||||
startTimestamp = startTimestamp,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
@@ -89,11 +125,27 @@ public suspend inline fun TelegramBot.copyMessage(
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
threadId: MessageThreadId? = toChat.id.threadId,
|
||||
startTimestamp: Seconds? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): MessageId = copyMessage(fromChat.id, messageId, toChat.id, text, parseMode, showCaptionAboveMedia, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
||||
): MessageId = copyMessage(
|
||||
fromChatId = fromChat.id,
|
||||
messageId = messageId,
|
||||
toChatId = toChat.id,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
threadId = threadId,
|
||||
startTimestamp = startTimestamp,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
|
||||
/**
|
||||
@@ -107,22 +159,26 @@ public suspend inline fun TelegramBot.copyMessage(
|
||||
entities: TextSourcesList,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
threadId: MessageThreadId? = toChatId.threadId,
|
||||
startTimestamp: Seconds? = null,
|
||||
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,
|
||||
replyParameters,
|
||||
replyMarkup
|
||||
fromChatId = fromChatId,
|
||||
messageId = messageId,
|
||||
toChatId = toChatId,
|
||||
entities = entities,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
threadId = threadId,
|
||||
startTimestamp = startTimestamp,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
)
|
||||
|
||||
@@ -137,11 +193,26 @@ public suspend inline fun TelegramBot.copyMessage(
|
||||
entities: TextSourcesList,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
threadId: MessageThreadId? = toChatId.threadId,
|
||||
startTimestamp: Seconds? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): MessageId = copyMessage(fromChat.id, messageId, toChatId, entities, showCaptionAboveMedia, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
||||
): MessageId = copyMessage(
|
||||
fromChatId = fromChat.id,
|
||||
messageId = messageId,
|
||||
toChatId = toChatId,
|
||||
entities = entities,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
threadId = threadId,
|
||||
startTimestamp = startTimestamp,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
@@ -154,11 +225,26 @@ public suspend inline fun TelegramBot.copyMessage(
|
||||
entities: TextSourcesList,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
threadId: MessageThreadId? = toChat.id.threadId,
|
||||
startTimestamp: Seconds? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): MessageId = copyMessage(fromChatId, messageId, toChat.id, entities, showCaptionAboveMedia, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
||||
): MessageId = copyMessage(
|
||||
fromChatId = fromChatId,
|
||||
messageId = messageId,
|
||||
toChatId = toChat.id,
|
||||
entities = entities,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
threadId = threadId,
|
||||
startTimestamp = startTimestamp,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
@@ -171,11 +257,26 @@ public suspend inline fun TelegramBot.copyMessage(
|
||||
entities: TextSourcesList,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
threadId: MessageThreadId? = toChat.id.threadId,
|
||||
startTimestamp: Seconds? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): MessageId = copyMessage(fromChat.id, messageId, toChat.id, entities, showCaptionAboveMedia, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
||||
): MessageId = copyMessage(
|
||||
fromChatId = fromChat.id,
|
||||
messageId = messageId,
|
||||
toChatId = toChat.id,
|
||||
entities = entities,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
threadId = threadId,
|
||||
startTimestamp = startTimestamp,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
@@ -188,11 +289,27 @@ public suspend inline fun TelegramBot.copyMessage(
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
threadId: MessageThreadId? = toChatId.threadId,
|
||||
startTimestamp: Seconds? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): MessageId = copyMessage(message.chat, message.messageId, toChatId, text, parseMode, showCaptionAboveMedia, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
||||
): MessageId = copyMessage(
|
||||
fromChat = message.chat,
|
||||
messageId = message.messageId,
|
||||
toChatId = toChatId,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
threadId = threadId,
|
||||
startTimestamp = startTimestamp,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
@@ -205,11 +322,27 @@ public suspend inline fun TelegramBot.copyMessage(
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
threadId: MessageThreadId? = toChat.id.threadId,
|
||||
startTimestamp: Seconds? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): MessageId = copyMessage(message.chat, message.messageId, toChat, text, parseMode, showCaptionAboveMedia, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
||||
): MessageId = copyMessage(
|
||||
fromChat = message.chat,
|
||||
messageId = message.messageId,
|
||||
toChat = toChat,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
threadId = threadId,
|
||||
startTimestamp = startTimestamp,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
@@ -221,11 +354,26 @@ public suspend inline fun TelegramBot.copyMessage(
|
||||
entities: TextSourcesList,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
threadId: MessageThreadId? = toChatId.threadId,
|
||||
startTimestamp: Seconds? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): MessageId = copyMessage(message.chat, message.messageId, toChatId, entities, showCaptionAboveMedia, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
||||
): MessageId = copyMessage(
|
||||
fromChat = message.chat,
|
||||
messageId = message.messageId,
|
||||
toChatId = toChatId,
|
||||
entities = entities,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
threadId = threadId,
|
||||
startTimestamp = startTimestamp,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
@@ -237,245 +385,276 @@ public suspend inline fun TelegramBot.copyMessage(
|
||||
entities: TextSourcesList,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
threadId: MessageThreadId? = toChat.id.threadId,
|
||||
startTimestamp: Seconds? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): MessageId = copyMessage(message.chat, message.messageId, toChat, entities, showCaptionAboveMedia, threadId, disableNotification, protectContent, 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,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
threadId: MessageThreadId? = toChatId.threadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): MessageId = execute(
|
||||
CopyMessage(
|
||||
fromChatId,
|
||||
messageId,
|
||||
toChatId,
|
||||
text,
|
||||
parseMode,
|
||||
showCaptionAboveMedia,
|
||||
threadId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
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,
|
||||
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,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): MessageId = copyMessage(
|
||||
toChat.id,
|
||||
fromChatId,
|
||||
messageId,
|
||||
text,
|
||||
parseMode,
|
||||
showCaptionAboveMedia,
|
||||
threadId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
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,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): MessageId = copyMessage(
|
||||
toChat.id,
|
||||
fromChat.id,
|
||||
messageId,
|
||||
text,
|
||||
parseMode,
|
||||
showCaptionAboveMedia,
|
||||
threadId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
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,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): MessageId = execute(
|
||||
CopyMessage(
|
||||
fromChatId,
|
||||
messageId,
|
||||
toChatId,
|
||||
entities,
|
||||
showCaptionAboveMedia,
|
||||
threadId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
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,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): MessageId = copyMessage(
|
||||
toChatId,
|
||||
fromChat.id,
|
||||
messageId,
|
||||
entities,
|
||||
showCaptionAboveMedia,
|
||||
threadId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
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,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): MessageId = copyMessage(
|
||||
toChat.id,
|
||||
fromChatId,
|
||||
messageId,
|
||||
entities,
|
||||
showCaptionAboveMedia,
|
||||
threadId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
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,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): MessageId = copyMessage(
|
||||
toChat.id,
|
||||
fromChat.id,
|
||||
messageId,
|
||||
entities,
|
||||
showCaptionAboveMedia,
|
||||
threadId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyParameters,
|
||||
replyMarkup
|
||||
fromChat = message.chat,
|
||||
messageId = message.messageId,
|
||||
toChat = toChat,
|
||||
entities = entities,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
threadId = threadId,
|
||||
startTimestamp = startTimestamp,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
//
|
||||
///**
|
||||
// * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
// * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||
// */
|
||||
//public suspend inline fun TelegramBot.copyMessage(
|
||||
// toChatId: ChatIdentifier,
|
||||
// fromChatId: ChatIdentifier,
|
||||
// messageId: MessageId,
|
||||
// text: String? = null,
|
||||
// parseMode: ParseMode? = null,
|
||||
// showCaptionAboveMedia: Boolean = false,
|
||||
// threadId: MessageThreadId? = toChatId.threadId,
|
||||
// disableNotification: Boolean = false,
|
||||
// protectContent: Boolean = false,
|
||||
// allowPaidBroadcast: Boolean = false,
|
||||
// replyParameters: ReplyParameters? = null,
|
||||
// replyMarkup: KeyboardMarkup? = null
|
||||
//): MessageId = execute(
|
||||
// CopyMessage(
|
||||
// fromChatId,
|
||||
// messageId,
|
||||
// toChatId,
|
||||
// text,
|
||||
// parseMode,
|
||||
// showCaptionAboveMedia,
|
||||
// threadId,
|
||||
// disableNotification,
|
||||
// protectContent,
|
||||
// allowPaidBroadcast,
|
||||
// replyParameters,
|
||||
// replyMarkup
|
||||
// )
|
||||
//)
|
||||
//
|
||||
///**
|
||||
// * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
// * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||
// */
|
||||
//public suspend inline fun TelegramBot.copyMessage(
|
||||
// toChatId: ChatIdentifier,
|
||||
// fromChat: Chat,
|
||||
// messageId: MessageId,
|
||||
// text: String? = null,
|
||||
// parseMode: ParseMode? = null,
|
||||
// showCaptionAboveMedia: Boolean = false,
|
||||
// threadId: MessageThreadId? = toChatId.threadId,
|
||||
// disableNotification: Boolean = false,
|
||||
// protectContent: Boolean = false,
|
||||
// allowPaidBroadcast: Boolean = false,
|
||||
// replyParameters: ReplyParameters? = null,
|
||||
// replyMarkup: KeyboardMarkup? = null
|
||||
//): MessageId = copyMessage(
|
||||
// toChatId,
|
||||
// fromChat.id,
|
||||
// messageId,
|
||||
// text,
|
||||
// parseMode,
|
||||
// showCaptionAboveMedia,
|
||||
// threadId,
|
||||
// disableNotification,
|
||||
// protectContent,
|
||||
// allowPaidBroadcast,
|
||||
// replyParameters,
|
||||
// replyMarkup
|
||||
//)
|
||||
//
|
||||
///**
|
||||
// * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
// * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||
// */
|
||||
//public suspend inline fun TelegramBot.copyMessage(
|
||||
// toChat: Chat,
|
||||
// fromChatId: ChatIdentifier,
|
||||
// messageId: MessageId,
|
||||
// text: String? = null,
|
||||
// parseMode: ParseMode? = null,
|
||||
// showCaptionAboveMedia: Boolean = false,
|
||||
// threadId: MessageThreadId? = toChat.id.threadId,
|
||||
// disableNotification: Boolean = false,
|
||||
// protectContent: Boolean = false,
|
||||
// allowPaidBroadcast: Boolean = false,
|
||||
// replyParameters: ReplyParameters? = null,
|
||||
// replyMarkup: KeyboardMarkup? = null
|
||||
//): MessageId = copyMessage(
|
||||
// toChat.id,
|
||||
// fromChatId,
|
||||
// messageId,
|
||||
// text,
|
||||
// parseMode,
|
||||
// showCaptionAboveMedia,
|
||||
// threadId,
|
||||
// disableNotification,
|
||||
// protectContent,
|
||||
// allowPaidBroadcast,
|
||||
// replyParameters,
|
||||
// replyMarkup
|
||||
//)
|
||||
//
|
||||
///**
|
||||
// * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
// * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||
// */
|
||||
//public suspend inline fun TelegramBot.copyMessage(
|
||||
// toChat: Chat,
|
||||
// fromChat: Chat,
|
||||
// messageId: MessageId,
|
||||
// text: String? = null,
|
||||
// parseMode: ParseMode? = null,
|
||||
// showCaptionAboveMedia: Boolean = false,
|
||||
// threadId: MessageThreadId? = toChat.id.threadId,
|
||||
// disableNotification: Boolean = false,
|
||||
// protectContent: Boolean = false,
|
||||
// allowPaidBroadcast: Boolean = false,
|
||||
// replyParameters: ReplyParameters? = null,
|
||||
// replyMarkup: KeyboardMarkup? = null
|
||||
//): MessageId = copyMessage(
|
||||
// toChat.id,
|
||||
// fromChat.id,
|
||||
// messageId,
|
||||
// text,
|
||||
// parseMode,
|
||||
// showCaptionAboveMedia,
|
||||
// threadId,
|
||||
// disableNotification,
|
||||
// protectContent,
|
||||
// allowPaidBroadcast,
|
||||
// replyParameters,
|
||||
// replyMarkup
|
||||
//)
|
||||
//
|
||||
//
|
||||
///**
|
||||
// * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
// * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||
// */
|
||||
//public suspend inline fun TelegramBot.copyMessage(
|
||||
// toChatId: ChatIdentifier,
|
||||
// fromChatId: ChatIdentifier,
|
||||
// messageId: MessageId,
|
||||
// entities: TextSourcesList,
|
||||
// showCaptionAboveMedia: Boolean = false,
|
||||
// threadId: MessageThreadId? = toChatId.threadId,
|
||||
// disableNotification: Boolean = false,
|
||||
// protectContent: Boolean = false,
|
||||
// allowPaidBroadcast: Boolean = false,
|
||||
// replyParameters: ReplyParameters? = null,
|
||||
// replyMarkup: KeyboardMarkup? = null
|
||||
//): MessageId = execute(
|
||||
// CopyMessage(
|
||||
// fromChatId,
|
||||
// messageId,
|
||||
// toChatId,
|
||||
// entities,
|
||||
// showCaptionAboveMedia,
|
||||
// threadId,
|
||||
// disableNotification,
|
||||
// protectContent,
|
||||
// allowPaidBroadcast,
|
||||
// replyParameters,
|
||||
// replyMarkup
|
||||
// )
|
||||
//)
|
||||
//
|
||||
///**
|
||||
// * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
// * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||
// */
|
||||
//public suspend inline fun TelegramBot.copyMessage(
|
||||
// toChatId: ChatIdentifier,
|
||||
// fromChat: Chat,
|
||||
// messageId: MessageId,
|
||||
// entities: TextSourcesList,
|
||||
// showCaptionAboveMedia: Boolean = false,
|
||||
// threadId: MessageThreadId? = toChatId.threadId,
|
||||
// disableNotification: Boolean = false,
|
||||
// protectContent: Boolean = false,
|
||||
// allowPaidBroadcast: Boolean = false,
|
||||
// replyParameters: ReplyParameters? = null,
|
||||
// replyMarkup: KeyboardMarkup? = null
|
||||
//): MessageId = copyMessage(
|
||||
// toChatId,
|
||||
// fromChat.id,
|
||||
// messageId,
|
||||
// entities,
|
||||
// showCaptionAboveMedia,
|
||||
// threadId,
|
||||
// disableNotification,
|
||||
// protectContent,
|
||||
// allowPaidBroadcast,
|
||||
// replyParameters,
|
||||
// replyMarkup
|
||||
//)
|
||||
//
|
||||
///**
|
||||
// * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
// * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||
// */
|
||||
//public suspend inline fun TelegramBot.copyMessage(
|
||||
// toChat: Chat,
|
||||
// fromChatId: ChatIdentifier,
|
||||
// messageId: MessageId,
|
||||
// entities: TextSourcesList,
|
||||
// showCaptionAboveMedia: Boolean = false,
|
||||
// threadId: MessageThreadId? = toChat.id.threadId,
|
||||
// disableNotification: Boolean = false,
|
||||
// protectContent: Boolean = false,
|
||||
// allowPaidBroadcast: Boolean = false,
|
||||
// replyParameters: ReplyParameters? = null,
|
||||
// replyMarkup: KeyboardMarkup? = null
|
||||
//): MessageId = copyMessage(
|
||||
// toChat.id,
|
||||
// fromChatId,
|
||||
// messageId,
|
||||
// entities,
|
||||
// showCaptionAboveMedia,
|
||||
// threadId,
|
||||
// disableNotification,
|
||||
// protectContent,
|
||||
// allowPaidBroadcast,
|
||||
// replyParameters,
|
||||
// replyMarkup
|
||||
//)
|
||||
//
|
||||
///**
|
||||
// * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
// * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||
// */
|
||||
//public suspend inline fun TelegramBot.copyMessage(
|
||||
// toChat: Chat,
|
||||
// fromChat: Chat,
|
||||
// messageId: MessageId,
|
||||
// entities: TextSourcesList,
|
||||
// showCaptionAboveMedia: Boolean = false,
|
||||
// threadId: MessageThreadId? = toChat.id.threadId,
|
||||
// disableNotification: Boolean = false,
|
||||
// protectContent: Boolean = false,
|
||||
// allowPaidBroadcast: Boolean = false,
|
||||
// replyParameters: ReplyParameters? = null,
|
||||
// replyMarkup: KeyboardMarkup? = null
|
||||
//): MessageId = copyMessage(
|
||||
// toChat.id,
|
||||
// fromChat.id,
|
||||
// messageId,
|
||||
// entities,
|
||||
// showCaptionAboveMedia,
|
||||
// threadId,
|
||||
// disableNotification,
|
||||
// protectContent,
|
||||
// allowPaidBroadcast,
|
||||
// replyParameters,
|
||||
// replyMarkup
|
||||
//)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -16,6 +16,7 @@ public suspend inline fun <T : MessageContent> TelegramBot.resend(
|
||||
messageThreadId: MessageThreadId? = chatId.threadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
@@ -25,6 +26,7 @@ public suspend inline fun <T : MessageContent> TelegramBot.resend(
|
||||
messageThreadId = messageThreadId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
@@ -40,6 +42,7 @@ public suspend inline fun <T : MessageContent> TelegramBot.resend(
|
||||
messageThreadId: MessageThreadId? = chat.id.threadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
@@ -49,6 +52,7 @@ public suspend inline fun <T : MessageContent> TelegramBot.resend(
|
||||
messageThreadId = messageThreadId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
@@ -65,6 +69,7 @@ public suspend inline fun <T : MessageContent> TelegramBot.resend(
|
||||
messageThreadId: MessageThreadId? = chatId.threadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
@@ -74,6 +79,7 @@ public suspend inline fun <T : MessageContent> TelegramBot.resend(
|
||||
messageThreadId = messageThreadId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
@@ -90,6 +96,7 @@ public suspend inline fun <T : MessageContent> TelegramBot.resend(
|
||||
messageThreadId: MessageThreadId? = chat.id.threadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
@@ -99,6 +106,7 @@ public suspend inline fun <T : MessageContent> TelegramBot.resend(
|
||||
messageThreadId = messageThreadId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
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
|
||||
|
||||
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
|
||||
) = 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
|
||||
) = execute(
|
||||
SendChecklist(
|
||||
chatId = chatId,
|
||||
checklist = checklist,
|
||||
businessConnectionId = chatId.businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
)
|
||||
@@ -22,12 +22,24 @@ public suspend fun TelegramBot.sendContact(
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<ContactContent> = execute(
|
||||
SendContact(
|
||||
chatId, phoneNumber, firstName, lastName, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup
|
||||
chatId = chatId,
|
||||
phoneNumber = phoneNumber,
|
||||
firstName = firstName,
|
||||
lastName = lastName,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
)
|
||||
|
||||
@@ -42,12 +54,22 @@ public suspend fun TelegramBot.sendContact(
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<ContactContent> = execute(
|
||||
SendContact(
|
||||
chatId, contact, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup
|
||||
chatId = chatId,
|
||||
contact = contact,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
)
|
||||
|
||||
@@ -64,11 +86,23 @@ public suspend fun TelegramBot.sendContact(
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<ContactContent> = sendContact(
|
||||
chat.id, phoneNumber, firstName, lastName, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup
|
||||
chatId = chat.id,
|
||||
phoneNumber = phoneNumber,
|
||||
firstName = firstName,
|
||||
lastName = lastName,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -82,9 +116,19 @@ public suspend fun TelegramBot.sendContact(
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<ContactContent> = sendContact(
|
||||
chat.id, contact, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup
|
||||
chatId = chat.id,
|
||||
contact = contact,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
@@ -21,11 +21,23 @@ public suspend fun TelegramBot.sendDice(
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<DiceContent> = execute(
|
||||
SendDice(chatId, animationType, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
SendDice(
|
||||
chatId = chatId,
|
||||
animationType = animationType,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -39,7 +51,19 @@ public suspend fun TelegramBot.sendDice(
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<DiceContent> = sendDice(chat.id, animationType, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
): ContentMessage<DiceContent> = sendDice(
|
||||
chatId = chat.id,
|
||||
animationType = animationType,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
@@ -27,25 +27,27 @@ public suspend fun TelegramBot.sendLocation(
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<LiveLocationContent> = execute(
|
||||
SendLiveLocation(
|
||||
chatId,
|
||||
latitude,
|
||||
longitude,
|
||||
livePeriod,
|
||||
horizontalAccuracy,
|
||||
heading,
|
||||
proximityAlertRadius,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
effectId,
|
||||
replyParameters,
|
||||
replyMarkup
|
||||
chatId = chatId,
|
||||
latitude = latitude,
|
||||
longitude = longitude,
|
||||
livePeriod = livePeriod,
|
||||
horizontalAccuracy = horizontalAccuracy,
|
||||
heading = heading,
|
||||
proximityAlertRadius = proximityAlertRadius,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
)
|
||||
|
||||
@@ -64,24 +66,26 @@ public suspend fun TelegramBot.sendLocation(
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<LiveLocationContent> = sendLocation(
|
||||
chatId,
|
||||
location.latitude,
|
||||
location.longitude,
|
||||
livePeriod,
|
||||
horizontalAccuracy,
|
||||
heading,
|
||||
proximityAlertRadius,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
effectId,
|
||||
replyParameters,
|
||||
replyMarkup
|
||||
chatId = chatId,
|
||||
latitude = location.latitude,
|
||||
longitude = location.longitude,
|
||||
livePeriod = livePeriod,
|
||||
horizontalAccuracy = horizontalAccuracy,
|
||||
heading = heading,
|
||||
proximityAlertRadius = proximityAlertRadius,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -100,24 +104,26 @@ public suspend fun TelegramBot.sendLocation(
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<LiveLocationContent> = sendLocation(
|
||||
chat.id,
|
||||
latitude,
|
||||
longitude,
|
||||
livePeriod,
|
||||
horizontalAccuracy,
|
||||
heading,
|
||||
proximityAlertRadius,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
effectId,
|
||||
replyParameters,
|
||||
replyMarkup
|
||||
chatId = chat.id,
|
||||
latitude = latitude,
|
||||
longitude = longitude,
|
||||
livePeriod = livePeriod,
|
||||
horizontalAccuracy = horizontalAccuracy,
|
||||
heading = heading,
|
||||
proximityAlertRadius = proximityAlertRadius,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -135,6 +141,7 @@ public suspend fun TelegramBot.sendLocation(
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
@@ -150,6 +157,7 @@ public suspend fun TelegramBot.sendLocation(
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
@@ -171,10 +179,27 @@ public suspend fun TelegramBot.sendLiveLocation(
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<LiveLocationContent> = sendLocation(chatId, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
): ContentMessage<LiveLocationContent> = sendLocation(
|
||||
chatId = chatId,
|
||||
latitude = latitude,
|
||||
longitude = longitude,
|
||||
livePeriod = livePeriod,
|
||||
horizontalAccuracy = horizontalAccuracy,
|
||||
heading = heading,
|
||||
proximityAlertRadius = proximityAlertRadius,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
@@ -191,10 +216,27 @@ public suspend fun TelegramBot.sendLiveLocation(
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<LiveLocationContent> = sendLocation(chatId, location.latitude, location.longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
): ContentMessage<LiveLocationContent> = sendLocation(
|
||||
chatId = chatId,
|
||||
latitude = location.latitude,
|
||||
longitude = location.longitude,
|
||||
livePeriod = livePeriod,
|
||||
horizontalAccuracy = horizontalAccuracy,
|
||||
heading = heading,
|
||||
proximityAlertRadius = proximityAlertRadius,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
@@ -212,10 +254,27 @@ public suspend fun TelegramBot.sendLiveLocation(
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<LiveLocationContent> = sendLocation(chat.id, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
): ContentMessage<LiveLocationContent> = sendLocation(
|
||||
chatId = chat.id,
|
||||
latitude = latitude,
|
||||
longitude = longitude,
|
||||
livePeriod = livePeriod,
|
||||
horizontalAccuracy = horizontalAccuracy,
|
||||
heading = heading,
|
||||
proximityAlertRadius = proximityAlertRadius,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
@@ -232,7 +291,24 @@ public suspend fun TelegramBot.sendLiveLocation(
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<LiveLocationContent> = sendLocation(chat.id, location.latitude, location.longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
): ContentMessage<LiveLocationContent> = sendLocation(
|
||||
chatId = chat.id,
|
||||
latitude = location.latitude,
|
||||
longitude = location.longitude,
|
||||
livePeriod = livePeriod,
|
||||
horizontalAccuracy = horizontalAccuracy,
|
||||
heading = heading,
|
||||
proximityAlertRadius = proximityAlertRadius,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
@@ -27,22 +27,24 @@ public suspend fun TelegramBot.sendMessage(
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<TextContent> = execute(
|
||||
SendTextMessage(
|
||||
chatId,
|
||||
text,
|
||||
parseMode,
|
||||
linkPreviewOptions,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
effectId,
|
||||
replyParameters,
|
||||
replyMarkup
|
||||
chatId = chatId,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
linkPreviewOptions = linkPreviewOptions,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
)
|
||||
|
||||
@@ -59,11 +61,23 @@ public suspend fun TelegramBot.sendTextMessage(
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<TextContent> = sendMessage(
|
||||
chatId, text, parseMode, linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup
|
||||
chatId = chatId,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
linkPreviewOptions = linkPreviewOptions,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -79,10 +93,24 @@ public suspend fun TelegramBot.sendTextMessage(
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<TextContent> = sendTextMessage(chat.id, text, parseMode, linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
): ContentMessage<TextContent> = sendTextMessage(
|
||||
chatId = chat.id,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
linkPreviewOptions = linkPreviewOptions,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
|
||||
/**
|
||||
@@ -98,10 +126,24 @@ public suspend fun TelegramBot.sendMessage(
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<TextContent> = sendMessage(chat.id, text, parseMode, linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
): ContentMessage<TextContent> = sendMessage(
|
||||
chatId = chat.id,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
linkPreviewOptions = linkPreviewOptions,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
@@ -115,11 +157,24 @@ public suspend fun TelegramBot.sendMessage(
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<TextContent> = execute(
|
||||
SendTextMessage(chatId, entities, linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
SendTextMessage(
|
||||
chatId = chatId,
|
||||
entities = entities,
|
||||
linkPreviewOptions = linkPreviewOptions,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -134,11 +189,24 @@ public suspend fun TelegramBot.sendMessage(
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null,
|
||||
builderBody: EntitiesBuilderBody
|
||||
): ContentMessage<TextContent> = sendMessage(chatId, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
): ContentMessage<TextContent> = sendMessage(
|
||||
chatId = chatId,
|
||||
entities = buildEntities(separator, builderBody),
|
||||
linkPreviewOptions = linkPreviewOptions,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
|
||||
/**
|
||||
@@ -153,11 +221,24 @@ public suspend fun TelegramBot.sendMessage(
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null,
|
||||
builderBody: EntitiesBuilderBody
|
||||
): ContentMessage<TextContent> = sendMessage(chatId, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
): ContentMessage<TextContent> = sendMessage(
|
||||
chatId = chatId,
|
||||
entities = buildEntities(separator, builderBody),
|
||||
linkPreviewOptions = linkPreviewOptions,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
@@ -171,11 +252,22 @@ public suspend fun TelegramBot.sendTextMessage(
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<TextContent> = sendMessage(
|
||||
chatId, entities, linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup
|
||||
chatId = chatId,
|
||||
entities = entities,
|
||||
linkPreviewOptions = linkPreviewOptions,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -190,11 +282,24 @@ public suspend fun TelegramBot.sendTextMessage(
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null,
|
||||
builderBody: EntitiesBuilderBody
|
||||
): ContentMessage<TextContent> = sendTextMessage(chatId, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
): ContentMessage<TextContent> = sendTextMessage(
|
||||
chatId = chatId,
|
||||
entities = buildEntities(separator, builderBody),
|
||||
linkPreviewOptions = linkPreviewOptions,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
|
||||
/**
|
||||
@@ -209,11 +314,24 @@ public suspend fun TelegramBot.sendTextMessage(
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null,
|
||||
builderBody: EntitiesBuilderBody
|
||||
): ContentMessage<TextContent> = sendTextMessage(chatId, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
): ContentMessage<TextContent> = sendTextMessage(
|
||||
chatId = chatId,
|
||||
entities = buildEntities(separator, builderBody),
|
||||
linkPreviewOptions = linkPreviewOptions,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
@@ -227,10 +345,23 @@ public suspend fun TelegramBot.sendMessage(
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<TextContent> = sendMessage(chat.id, entities, linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
): ContentMessage<TextContent> = sendMessage(
|
||||
chatId = chat.id,
|
||||
entities = entities,
|
||||
linkPreviewOptions = linkPreviewOptions,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some [dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
@@ -244,11 +375,24 @@ public suspend fun TelegramBot.sendMessage(
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null,
|
||||
builderBody: EntitiesBuilderBody
|
||||
): ContentMessage<TextContent> = sendMessage(chat, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
): ContentMessage<TextContent> = sendMessage(
|
||||
chat = chat,
|
||||
entities = buildEntities(separator, builderBody),
|
||||
linkPreviewOptions = linkPreviewOptions,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
|
||||
/**
|
||||
@@ -263,11 +407,24 @@ public suspend fun TelegramBot.sendMessage(
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null,
|
||||
builderBody: EntitiesBuilderBody
|
||||
): ContentMessage<TextContent> = sendMessage(chat, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
): ContentMessage<TextContent> = sendMessage(
|
||||
chat = chat,
|
||||
entities = buildEntities(separator, builderBody),
|
||||
linkPreviewOptions = linkPreviewOptions,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
|
||||
/**
|
||||
@@ -282,10 +439,23 @@ public suspend fun TelegramBot.sendTextMessage(
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<TextContent> = sendTextMessage(chat.id, entities, linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
): ContentMessage<TextContent> = sendTextMessage(
|
||||
chatId = chat.id,
|
||||
entities = entities,
|
||||
linkPreviewOptions = linkPreviewOptions,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some [dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
@@ -299,11 +469,24 @@ public suspend fun TelegramBot.sendTextMessage(
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null,
|
||||
builderBody: EntitiesBuilderBody
|
||||
): ContentMessage<TextContent> = sendTextMessage(chat, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
): ContentMessage<TextContent> = sendTextMessage(
|
||||
chat = chat,
|
||||
entities = buildEntities(separator, builderBody),
|
||||
linkPreviewOptions = linkPreviewOptions,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
|
||||
/**
|
||||
@@ -318,8 +501,21 @@ public suspend fun TelegramBot.sendTextMessage(
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null,
|
||||
builderBody: EntitiesBuilderBody
|
||||
): ContentMessage<TextContent> = sendTextMessage(chat, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
): ContentMessage<TextContent> = sendTextMessage(
|
||||
chat = chat,
|
||||
entities = buildEntities(separator, builderBody),
|
||||
linkPreviewOptions = linkPreviewOptions,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
@@ -23,18 +23,20 @@ public suspend fun TelegramBot.sendLocation(
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<StaticLocationContent> = execute(
|
||||
SendStaticLocation(
|
||||
chatId,
|
||||
latitude,
|
||||
longitude,
|
||||
chatId = chatId,
|
||||
latitude = latitude,
|
||||
longitude = longitude,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
@@ -52,20 +54,22 @@ public suspend fun TelegramBot.sendLocation(
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<StaticLocationContent> = sendLocation(
|
||||
chatId,
|
||||
location.latitude,
|
||||
location.longitude,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
effectId,
|
||||
replyParameters,
|
||||
replyMarkup
|
||||
chatId = chatId,
|
||||
latitude = location.latitude,
|
||||
longitude = location.longitude,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -80,20 +84,22 @@ public suspend fun TelegramBot.sendLocation(
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<StaticLocationContent> = sendLocation(
|
||||
chat.id,
|
||||
latitude,
|
||||
longitude,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
effectId,
|
||||
replyParameters,
|
||||
replyMarkup
|
||||
chatId = chat.id,
|
||||
latitude = latitude,
|
||||
longitude = longitude,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -107,20 +113,22 @@ public suspend fun TelegramBot.sendLocation(
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<StaticLocationContent> = sendLocation(
|
||||
chat.id,
|
||||
location.latitude,
|
||||
location.longitude,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
effectId,
|
||||
replyParameters,
|
||||
replyMarkup
|
||||
chatId = chat.id,
|
||||
latitude = location.latitude,
|
||||
longitude = location.longitude,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -135,10 +143,23 @@ public suspend fun TelegramBot.sendStaticLocation(
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<StaticLocationContent> = sendLocation(chatId, latitude, longitude, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
): ContentMessage<StaticLocationContent> = sendLocation(
|
||||
chatId = chatId,
|
||||
latitude = latitude,
|
||||
longitude = longitude,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
@@ -151,10 +172,23 @@ public suspend fun TelegramBot.sendStaticLocation(
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<StaticLocationContent> = sendLocation(chatId, location.latitude, location.longitude, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
): ContentMessage<StaticLocationContent> = sendLocation(
|
||||
chatId = chatId,
|
||||
latitude = location.latitude,
|
||||
longitude = location.longitude,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
@@ -168,10 +202,23 @@ public suspend fun TelegramBot.sendStaticLocation(
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<StaticLocationContent> = sendLocation(chat.id, latitude, longitude, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
): ContentMessage<StaticLocationContent> = sendLocation(
|
||||
chatId = chat.id,
|
||||
latitude = latitude,
|
||||
longitude = longitude,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
@@ -184,7 +231,20 @@ public suspend fun TelegramBot.sendStaticLocation(
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<StaticLocationContent> = sendLocation(chat.id, location.latitude, location.longitude, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
): ContentMessage<StaticLocationContent> = sendLocation(
|
||||
chatId = chat.id,
|
||||
latitude = location.latitude,
|
||||
longitude = location.longitude,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
@@ -29,6 +29,7 @@ public suspend fun TelegramBot.sendVenue(
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
@@ -47,6 +48,7 @@ public suspend fun TelegramBot.sendVenue(
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
@@ -71,6 +73,7 @@ public suspend fun TelegramBot.sendVenue(
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
@@ -88,6 +91,7 @@ public suspend fun TelegramBot.sendVenue(
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
@@ -110,6 +114,7 @@ public suspend fun TelegramBot.sendVenue(
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
@@ -127,6 +132,7 @@ public suspend fun TelegramBot.sendVenue(
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
@@ -149,6 +155,7 @@ public suspend fun TelegramBot.sendVenue(
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
@@ -166,6 +173,7 @@ public suspend fun TelegramBot.sendVenue(
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
@@ -182,6 +190,7 @@ public suspend fun TelegramBot.sendVenue(
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
@@ -193,6 +202,7 @@ public suspend fun TelegramBot.sendVenue(
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
@@ -210,6 +220,7 @@ public suspend fun TelegramBot.sendVenue(
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
@@ -220,6 +231,7 @@ public suspend fun TelegramBot.sendVenue(
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -21,12 +21,22 @@ public suspend fun TelegramBot.sendGame(
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<GameContent> = execute(
|
||||
SendGame(
|
||||
chatId, gameShortName, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup
|
||||
chatId = chatId,
|
||||
gameShortName = gameShortName,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
)
|
||||
|
||||
@@ -41,11 +51,21 @@ public suspend fun TelegramBot.sendGame(
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<GameContent> = sendGame(
|
||||
chat.id, gameShortName, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup
|
||||
chatId = chat.id,
|
||||
gameShortName = gameShortName,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -59,11 +79,21 @@ public suspend fun TelegramBot.sendGame(
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<GameContent> = sendGame(
|
||||
chatId, game.title, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup
|
||||
chatId = chatId,
|
||||
gameShortName = game.title,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -77,9 +107,19 @@ public suspend fun TelegramBot.sendGame(
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<GameContent> = sendGame(
|
||||
chat.id, game.title, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup
|
||||
chatId = chat.id,
|
||||
gameShortName = game.title,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
@@ -32,6 +32,7 @@ public suspend fun TelegramBot.sendAnimation(
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
@@ -51,6 +52,7 @@ public suspend fun TelegramBot.sendAnimation(
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
@@ -75,6 +77,7 @@ public suspend fun TelegramBot.sendAnimation(
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
@@ -93,6 +96,7 @@ public suspend fun TelegramBot.sendAnimation(
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
@@ -117,6 +121,7 @@ public suspend fun TelegramBot.sendAnimation(
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
@@ -135,6 +140,7 @@ public suspend fun TelegramBot.sendAnimation(
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
@@ -158,6 +164,7 @@ public suspend fun TelegramBot.sendAnimation(
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
@@ -175,6 +182,7 @@ public suspend fun TelegramBot.sendAnimation(
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
@@ -199,6 +207,7 @@ public suspend fun TelegramBot.sendAnimation(
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
@@ -217,6 +226,7 @@ public suspend fun TelegramBot.sendAnimation(
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
@@ -240,6 +250,7 @@ public suspend fun TelegramBot.sendAnimation(
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
@@ -257,6 +268,7 @@ public suspend fun TelegramBot.sendAnimation(
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
@@ -280,6 +292,7 @@ public suspend fun TelegramBot.sendAnimation(
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
@@ -297,6 +310,7 @@ public suspend fun TelegramBot.sendAnimation(
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
@@ -319,6 +333,7 @@ public suspend fun TelegramBot.sendAnimation(
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
@@ -335,6 +350,7 @@ public suspend fun TelegramBot.sendAnimation(
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
|
||||
@@ -30,26 +30,28 @@ public suspend fun TelegramBot.sendAudio(
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<AudioContent> = execute(
|
||||
SendAudio(
|
||||
chatId,
|
||||
audio,
|
||||
thumb,
|
||||
text,
|
||||
parseMode,
|
||||
duration,
|
||||
performer,
|
||||
title,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
effectId,
|
||||
replyParameters,
|
||||
replyMarkup
|
||||
chatId = chatId,
|
||||
audio = audio,
|
||||
thumbnail = thumb,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
duration = duration,
|
||||
performer = performer,
|
||||
title = title,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
)
|
||||
|
||||
@@ -70,10 +72,28 @@ public suspend fun TelegramBot.sendAudio(
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<AudioContent> = sendAudio(chat.id, audio, thumb, text, parseMode, duration, performer, title, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
): ContentMessage<AudioContent> = sendAudio(
|
||||
chatId = chat.id,
|
||||
audio = audio,
|
||||
thumb = thumb,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
duration = duration,
|
||||
performer = performer,
|
||||
title = title,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
@@ -89,10 +109,28 @@ public suspend fun TelegramBot.sendAudio(
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<AudioContent> = sendAudio(chatId, audio.fileId, audio.thumbnail ?.fileId, text, parseMode, audio.duration, audio.performer, title, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
): ContentMessage<AudioContent> = sendAudio(
|
||||
chatId = chatId,
|
||||
audio = audio.fileId,
|
||||
thumb = audio.thumbnail ?.fileId,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
duration = audio.duration,
|
||||
performer = audio.performer,
|
||||
title = title,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
@@ -108,10 +146,25 @@ public suspend fun TelegramBot.sendAudio(
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<AudioContent> = sendAudio(chat.id, audio, text, parseMode, title, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
): ContentMessage<AudioContent> = sendAudio(
|
||||
chatId = chat.id,
|
||||
audio = audio,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
title = title,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
|
||||
/**
|
||||
@@ -130,25 +183,27 @@ public suspend inline fun TelegramBot.sendAudio(
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<AudioContent> = execute(
|
||||
SendAudio(
|
||||
chatId,
|
||||
audio,
|
||||
thumb,
|
||||
entities,
|
||||
duration,
|
||||
performer,
|
||||
title,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
effectId,
|
||||
replyParameters,
|
||||
replyMarkup
|
||||
chatId = chatId,
|
||||
audio = audio,
|
||||
thumbnail = thumb,
|
||||
entities = entities,
|
||||
duration = duration,
|
||||
performer = performer,
|
||||
title = title,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
)
|
||||
|
||||
@@ -168,10 +223,27 @@ public suspend inline fun TelegramBot.sendAudio(
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<AudioContent> = sendAudio(chat.id, audio, thumb, entities, duration, performer, title, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
): ContentMessage<AudioContent> = sendAudio(
|
||||
chatId = chat.id,
|
||||
audio = audio,
|
||||
thumb = thumb,
|
||||
entities = entities,
|
||||
duration = duration,
|
||||
performer = performer,
|
||||
title = title,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
@@ -186,10 +258,27 @@ public suspend inline fun TelegramBot.sendAudio(
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<AudioContent> = sendAudio(chatId, audio.fileId, audio.thumbnail ?.fileId, entities, audio.duration, audio.performer, title, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
): ContentMessage<AudioContent> = sendAudio(
|
||||
chatId = chatId,
|
||||
audio = audio.fileId,
|
||||
thumb = audio.thumbnail ?.fileId,
|
||||
entities = entities,
|
||||
duration = audio.duration,
|
||||
performer = audio.performer,
|
||||
title = title,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
@@ -204,7 +293,21 @@ public suspend inline fun TelegramBot.sendAudio(
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<AudioContent> = sendAudio(chat.id, audio, entities, title, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
): ContentMessage<AudioContent> = sendAudio(
|
||||
chatId = chat.id,
|
||||
audio = audio,
|
||||
entities = entities,
|
||||
title = title,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
@@ -27,25 +27,27 @@ public suspend fun TelegramBot.sendDocument(
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null,
|
||||
disableContentTypeDetection: Boolean? = null
|
||||
): ContentMessage<DocumentContent> = execute(
|
||||
SendDocument(
|
||||
chatId,
|
||||
document,
|
||||
thumb,
|
||||
text,
|
||||
parseMode,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
effectId,
|
||||
replyParameters,
|
||||
replyMarkup,
|
||||
disableContentTypeDetection
|
||||
chatId = chatId,
|
||||
document = document,
|
||||
thumbnail = thumb,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup,
|
||||
disableContentTypeDetection = disableContentTypeDetection
|
||||
)
|
||||
)
|
||||
|
||||
@@ -63,11 +65,27 @@ public suspend fun TelegramBot.sendDocument(
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null,
|
||||
disableContentTypeDetection: Boolean? = null
|
||||
): ContentMessage<DocumentContent> = sendDocument(chat.id, document, thumb, text, parseMode, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup, disableContentTypeDetection)
|
||||
): ContentMessage<DocumentContent> = sendDocument(
|
||||
chatId = chat.id,
|
||||
document = document,
|
||||
thumb = thumb,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup,
|
||||
disableContentTypeDetection = disableContentTypeDetection
|
||||
)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
@@ -82,12 +100,26 @@ public suspend fun TelegramBot.sendDocument(
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null,
|
||||
disableContentTypeDetection: Boolean? = null
|
||||
): ContentMessage<DocumentContent> = sendDocument(
|
||||
chatId, document.fileId, document.thumbnail ?.fileId, text, parseMode, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup, disableContentTypeDetection
|
||||
chatId = chatId,
|
||||
document = document.fileId,
|
||||
thumb = document.thumbnail ?.fileId,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup,
|
||||
disableContentTypeDetection = disableContentTypeDetection
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -103,11 +135,26 @@ public suspend fun TelegramBot.sendDocument(
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null,
|
||||
disableContentTypeDetection: Boolean? = null
|
||||
): ContentMessage<DocumentContent> = sendDocument(chat.id, document, text, parseMode, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup, disableContentTypeDetection)
|
||||
): ContentMessage<DocumentContent> = sendDocument(
|
||||
chatId = chat.id,
|
||||
document = document,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup,
|
||||
disableContentTypeDetection = disableContentTypeDetection
|
||||
)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
@@ -122,24 +169,26 @@ public suspend inline fun TelegramBot.sendDocument(
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null,
|
||||
disableContentTypeDetection: Boolean? = null
|
||||
): ContentMessage<DocumentContent> = execute(
|
||||
SendDocument(
|
||||
chatId,
|
||||
document,
|
||||
thumb,
|
||||
entities,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
effectId,
|
||||
replyParameters,
|
||||
replyMarkup,
|
||||
disableContentTypeDetection
|
||||
chatId = chatId,
|
||||
document = document,
|
||||
thumbnail = thumb,
|
||||
entities = entities,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup,
|
||||
disableContentTypeDetection = disableContentTypeDetection
|
||||
)
|
||||
)
|
||||
|
||||
@@ -156,11 +205,26 @@ public suspend inline fun TelegramBot.sendDocument(
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null,
|
||||
disableContentTypeDetection: Boolean? = null
|
||||
): ContentMessage<DocumentContent> = sendDocument(chat.id, document, thumb, entities, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup, disableContentTypeDetection)
|
||||
): ContentMessage<DocumentContent> = sendDocument(
|
||||
chatId = chat.id,
|
||||
document = document,
|
||||
thumb = thumb,
|
||||
entities = entities,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup,
|
||||
disableContentTypeDetection = disableContentTypeDetection
|
||||
)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
@@ -174,12 +238,25 @@ public suspend inline fun TelegramBot.sendDocument(
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null,
|
||||
disableContentTypeDetection: Boolean? = null
|
||||
): ContentMessage<DocumentContent> = sendDocument(
|
||||
chatId, document.fileId, document.thumbnail ?.fileId, entities, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup, disableContentTypeDetection
|
||||
chatId = chatId,
|
||||
document = document.fileId,
|
||||
thumb = document.thumbnail ?.fileId,
|
||||
entities = entities,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup,
|
||||
disableContentTypeDetection = disableContentTypeDetection
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -194,8 +271,22 @@ public suspend inline fun TelegramBot.sendDocument(
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null,
|
||||
disableContentTypeDetection: Boolean? = null
|
||||
): ContentMessage<DocumentContent> = sendDocument(chat.id, document, entities, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup, disableContentTypeDetection)
|
||||
): ContentMessage<DocumentContent> = sendDocument(
|
||||
chatId = chat.id,
|
||||
document = document,
|
||||
entities = entities,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup,
|
||||
disableContentTypeDetection = disableContentTypeDetection
|
||||
)
|
||||
|
||||
@@ -22,11 +22,20 @@ public suspend fun TelegramBot.sendMediaGroup(
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null
|
||||
): ContentMessage<MediaGroupContent<MediaGroupPartContent>> = execute(
|
||||
SendMediaGroup<MediaGroupPartContent>(
|
||||
chatId, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
|
||||
chatId = chatId,
|
||||
media = media,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters
|
||||
)
|
||||
)
|
||||
|
||||
@@ -41,10 +50,19 @@ public suspend fun TelegramBot.sendMediaGroup(
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null
|
||||
): ContentMessage<MediaGroupContent<MediaGroupPartContent>> = sendMediaGroup(
|
||||
chat.id, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
|
||||
chatId = chat.id,
|
||||
media = media,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -59,10 +77,19 @@ public suspend fun TelegramBot.sendMediaGroup(
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null
|
||||
): ContentMessage<MediaGroupContent<MediaGroupPartContent>> = sendMediaGroup(
|
||||
chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
|
||||
chatId = chatId,
|
||||
media = media.map { it.toMediaGroupMemberTelegramMedia() },
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -77,10 +104,19 @@ public suspend fun TelegramBot.sendMediaGroup(
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null
|
||||
): ContentMessage<MediaGroupContent<MediaGroupPartContent>> = sendMediaGroup(
|
||||
chat.id, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
|
||||
chatId = chat.id,
|
||||
media = media,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -93,11 +129,20 @@ public suspend fun TelegramBot.sendPlaylist(
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null
|
||||
): ContentMessage<MediaGroupContent<AudioContent>> = execute(
|
||||
SendPlaylist(
|
||||
chatId, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
|
||||
chatId = chatId,
|
||||
media = media,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters
|
||||
)
|
||||
)
|
||||
|
||||
@@ -111,10 +156,19 @@ public suspend fun TelegramBot.sendPlaylist(
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null
|
||||
): ContentMessage<MediaGroupContent<AudioContent>> = sendPlaylist(
|
||||
chat.id, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
|
||||
chatId = chat.id,
|
||||
media = media,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -128,10 +182,19 @@ public suspend fun TelegramBot.sendPlaylist(
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null
|
||||
): ContentMessage<MediaGroupContent<AudioContent>> = sendPlaylist(
|
||||
chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
|
||||
chatId = chatId,
|
||||
media = media.map { it.toMediaGroupMemberTelegramMedia() },
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -145,10 +208,19 @@ public suspend fun TelegramBot.sendPlaylist(
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null
|
||||
): ContentMessage<MediaGroupContent<AudioContent>> = sendPlaylist(
|
||||
chat.id, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
|
||||
chatId = chat.id,
|
||||
media = media,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -161,11 +233,20 @@ public suspend fun TelegramBot.sendDocumentsGroup(
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null
|
||||
): ContentMessage<MediaGroupContent<DocumentContent>> = execute(
|
||||
SendDocumentsGroup(
|
||||
chatId, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
|
||||
chatId = chatId,
|
||||
media = media,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters
|
||||
)
|
||||
)
|
||||
|
||||
@@ -179,10 +260,19 @@ public suspend fun TelegramBot.sendDocumentsGroup(
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null
|
||||
): ContentMessage<MediaGroupContent<DocumentContent>> = sendDocumentsGroup(
|
||||
chat.id, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
|
||||
chatId = chat.id,
|
||||
media = media,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -196,10 +286,19 @@ public suspend fun TelegramBot.sendDocumentsGroup(
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null
|
||||
): ContentMessage<MediaGroupContent<DocumentContent>> = sendDocumentsGroup(
|
||||
chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
|
||||
chatId = chatId,
|
||||
media = media.map { it.toMediaGroupMemberTelegramMedia() },
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -213,10 +312,19 @@ public suspend fun TelegramBot.sendDocumentsGroup(
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null
|
||||
): ContentMessage<MediaGroupContent<DocumentContent>> = sendDocumentsGroup(
|
||||
chat.id, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
|
||||
chatId = chat.id,
|
||||
media = media,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -229,11 +337,20 @@ public suspend fun TelegramBot.sendVisualMediaGroup(
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null
|
||||
): ContentMessage<MediaGroupContent<VisualMediaGroupPartContent>> = execute(
|
||||
SendVisualMediaGroup(
|
||||
chatId, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
|
||||
chatId = chatId,
|
||||
media = media,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters
|
||||
)
|
||||
)
|
||||
|
||||
@@ -247,10 +364,19 @@ public suspend fun TelegramBot.sendVisualMediaGroup(
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null
|
||||
): ContentMessage<MediaGroupContent<VisualMediaGroupPartContent>> = sendVisualMediaGroup(
|
||||
chat.id, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
|
||||
chatId = chat.id,
|
||||
media = media,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -264,10 +390,19 @@ public suspend fun TelegramBot.sendVisualMediaGroup(
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null
|
||||
): ContentMessage<MediaGroupContent<VisualMediaGroupPartContent>> = sendVisualMediaGroup(
|
||||
chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
|
||||
chatId = chatId,
|
||||
media = media.map { it.toMediaGroupMemberTelegramMedia() },
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -281,8 +416,17 @@ public suspend fun TelegramBot.sendVisualMediaGroup(
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null
|
||||
): ContentMessage<MediaGroupContent<VisualMediaGroupPartContent>> = sendVisualMediaGroup(
|
||||
chat.id, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
|
||||
chatId = chat.id,
|
||||
media = media,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters
|
||||
)
|
||||
|
||||
@@ -28,6 +28,7 @@ public suspend fun TelegramBot.sendPaidMedia(
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<PaidMediaInfoContent> = execute(
|
||||
@@ -43,6 +44,7 @@ public suspend fun TelegramBot.sendPaidMedia(
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -64,6 +66,7 @@ public suspend fun TelegramBot.sendPaidMedia(
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<PaidMediaInfoContent> = sendPaidMedia(
|
||||
@@ -78,6 +81,7 @@ public suspend fun TelegramBot.sendPaidMedia(
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -98,6 +102,7 @@ public suspend inline fun TelegramBot.sendPaidMedia(
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<PaidMediaInfoContent> = execute(
|
||||
@@ -112,6 +117,7 @@ public suspend inline fun TelegramBot.sendPaidMedia(
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -132,6 +138,7 @@ public suspend inline fun TelegramBot.sendPaidMedia(
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<PaidMediaInfoContent> = sendPaidMedia(
|
||||
@@ -145,6 +152,7 @@ public suspend inline fun TelegramBot.sendPaidMedia(
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
@@ -28,6 +28,7 @@ public suspend fun TelegramBot.sendPhoto(
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
@@ -43,6 +44,7 @@ public suspend fun TelegramBot.sendPhoto(
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
@@ -64,6 +66,7 @@ public suspend fun TelegramBot.sendPhoto(
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
@@ -78,6 +81,7 @@ public suspend fun TelegramBot.sendPhoto(
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
@@ -98,6 +102,7 @@ public suspend fun TelegramBot.sendPhoto(
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
@@ -112,6 +117,7 @@ public suspend fun TelegramBot.sendPhoto(
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
@@ -132,6 +138,7 @@ public suspend fun TelegramBot.sendPhoto(
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
@@ -146,6 +153,7 @@ public suspend fun TelegramBot.sendPhoto(
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
@@ -166,6 +174,7 @@ public suspend fun TelegramBot.sendPhoto(
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
@@ -180,6 +189,7 @@ public suspend fun TelegramBot.sendPhoto(
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
@@ -200,6 +210,7 @@ public suspend fun TelegramBot.sendPhoto(
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
@@ -214,6 +225,7 @@ public suspend fun TelegramBot.sendPhoto(
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
@@ -234,6 +246,7 @@ public suspend inline fun TelegramBot.sendPhoto(
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
@@ -248,6 +261,7 @@ public suspend inline fun TelegramBot.sendPhoto(
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
@@ -268,6 +282,7 @@ public suspend inline fun TelegramBot.sendPhoto(
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
@@ -281,6 +296,7 @@ public suspend inline fun TelegramBot.sendPhoto(
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
@@ -300,6 +316,7 @@ public suspend inline fun TelegramBot.sendPhoto(
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
@@ -313,6 +330,7 @@ public suspend inline fun TelegramBot.sendPhoto(
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
@@ -332,6 +350,7 @@ public suspend inline fun TelegramBot.sendPhoto(
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
@@ -345,6 +364,7 @@ public suspend inline fun TelegramBot.sendPhoto(
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
@@ -364,6 +384,7 @@ public suspend inline fun TelegramBot.sendPhoto(
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
@@ -377,6 +398,7 @@ public suspend inline fun TelegramBot.sendPhoto(
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
@@ -396,6 +418,7 @@ public suspend inline fun TelegramBot.sendPhoto(
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
@@ -409,6 +432,7 @@ public suspend inline fun TelegramBot.sendPhoto(
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
|
||||
@@ -23,11 +23,24 @@ public suspend fun TelegramBot.sendSticker(
|
||||
emoji: String? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<StickerContent> = execute(
|
||||
SendSticker(chatId, sticker, threadId, businessConnectionId, emoji, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
SendSticker(
|
||||
chatId = chatId,
|
||||
sticker = sticker,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
emoji = emoji,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -42,10 +55,23 @@ public suspend fun TelegramBot.sendSticker(
|
||||
emoji: String? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<StickerContent> = sendSticker(chat.id, sticker, threadId, businessConnectionId, emoji, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
): ContentMessage<StickerContent> = sendSticker(
|
||||
chatId = chat.id,
|
||||
sticker = sticker,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
emoji = emoji,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
@@ -59,10 +85,23 @@ public suspend fun TelegramBot.sendSticker(
|
||||
emoji: String? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<StickerContent> = sendSticker(chatId, sticker.fileId, threadId, businessConnectionId, emoji, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
): ContentMessage<StickerContent> = sendSticker(
|
||||
chatId = chatId,
|
||||
sticker = sticker.fileId,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
emoji = emoji,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
@@ -76,7 +115,20 @@ public suspend fun TelegramBot.sendSticker(
|
||||
emoji: String? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<StickerContent> = sendSticker(chat, sticker.fileId, threadId, businessConnectionId, emoji, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
): ContentMessage<StickerContent> = sendSticker(
|
||||
chat = chat,
|
||||
sticker = sticker.fileId,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
emoji = emoji,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
@@ -25,6 +25,8 @@ public suspend fun TelegramBot.sendVideo(
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
cover: InputFile? = null,
|
||||
startTimestamp: Seconds? = null,
|
||||
duration: Long? = null,
|
||||
width: Int? = null,
|
||||
height: Int? = null,
|
||||
@@ -32,6 +34,7 @@ public suspend fun TelegramBot.sendVideo(
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
@@ -44,6 +47,8 @@ public suspend fun TelegramBot.sendVideo(
|
||||
parseMode = parseMode,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
cover = cover,
|
||||
startTimestamp = startTimestamp,
|
||||
duration = duration,
|
||||
width = width,
|
||||
height = height,
|
||||
@@ -52,6 +57,7 @@ public suspend fun TelegramBot.sendVideo(
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
@@ -73,6 +79,7 @@ public suspend fun TelegramBot.sendVideo(
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
@@ -84,6 +91,8 @@ public suspend fun TelegramBot.sendVideo(
|
||||
parseMode = parseMode,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
cover = video.cover ?.fileId,
|
||||
startTimestamp = video.startTimestamp,
|
||||
duration = video.duration,
|
||||
width = video.width,
|
||||
height = video.height,
|
||||
@@ -91,6 +100,7 @@ public suspend fun TelegramBot.sendVideo(
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
@@ -108,6 +118,8 @@ public suspend fun TelegramBot.sendVideo(
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
cover: InputFile? = null,
|
||||
startTimestamp: Seconds? = null,
|
||||
duration: Long? = null,
|
||||
width: Int? = null,
|
||||
height: Int? = null,
|
||||
@@ -115,6 +127,7 @@ public suspend fun TelegramBot.sendVideo(
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
@@ -126,6 +139,8 @@ public suspend fun TelegramBot.sendVideo(
|
||||
parseMode = parseMode,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
cover = cover,
|
||||
startTimestamp = startTimestamp,
|
||||
duration = duration,
|
||||
width = width,
|
||||
height = height,
|
||||
@@ -133,6 +148,7 @@ public suspend fun TelegramBot.sendVideo(
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
@@ -154,6 +170,7 @@ public suspend fun TelegramBot.sendVideo(
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
@@ -168,6 +185,7 @@ public suspend fun TelegramBot.sendVideo(
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
@@ -184,6 +202,8 @@ public suspend inline fun TelegramBot.sendVideo(
|
||||
entities: TextSourcesList,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
cover: InputFile? = null,
|
||||
startTimestamp: Seconds? = null,
|
||||
duration: Long? = null,
|
||||
width: Int? = null,
|
||||
height: Int? = null,
|
||||
@@ -191,6 +211,7 @@ public suspend inline fun TelegramBot.sendVideo(
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
@@ -202,6 +223,8 @@ public suspend inline fun TelegramBot.sendVideo(
|
||||
entities = entities,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
cover = cover,
|
||||
startTimestamp = startTimestamp,
|
||||
duration = duration,
|
||||
width = width,
|
||||
height = height,
|
||||
@@ -210,6 +233,7 @@ public suspend inline fun TelegramBot.sendVideo(
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
@@ -230,6 +254,7 @@ public suspend inline fun TelegramBot.sendVideo(
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
@@ -240,6 +265,8 @@ public suspend inline fun TelegramBot.sendVideo(
|
||||
entities = entities,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
cover = video.cover ?.fileId,
|
||||
startTimestamp = video.startTimestamp,
|
||||
duration = video.duration,
|
||||
width = video.width,
|
||||
height = video.height,
|
||||
@@ -247,6 +274,7 @@ public suspend inline fun TelegramBot.sendVideo(
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
@@ -263,6 +291,8 @@ public suspend inline fun TelegramBot.sendVideo(
|
||||
entities: TextSourcesList,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
cover: InputFile? = null,
|
||||
startTimestamp: Seconds? = null,
|
||||
duration: Long? = null,
|
||||
width: Int? = null,
|
||||
height: Int? = null,
|
||||
@@ -270,6 +300,7 @@ public suspend inline fun TelegramBot.sendVideo(
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
@@ -280,6 +311,8 @@ public suspend inline fun TelegramBot.sendVideo(
|
||||
entities = entities,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
cover = cover,
|
||||
startTimestamp = startTimestamp,
|
||||
duration = duration,
|
||||
width = width,
|
||||
height = height,
|
||||
@@ -287,6 +320,7 @@ public suspend inline fun TelegramBot.sendVideo(
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
@@ -307,6 +341,7 @@ public suspend inline fun TelegramBot.sendVideo(
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
@@ -320,6 +355,7 @@ public suspend inline fun TelegramBot.sendVideo(
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
|
||||
@@ -25,23 +25,25 @@ public suspend fun TelegramBot.sendVideoNote(
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<VideoNoteContent> = execute(
|
||||
SendVideoNote(
|
||||
chatId,
|
||||
videoNote,
|
||||
thumb,
|
||||
duration,
|
||||
size,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
effectId,
|
||||
replyParameters,
|
||||
replyMarkup
|
||||
chatId = chatId,
|
||||
videoNote = videoNote,
|
||||
thumbnail = thumb,
|
||||
duration = duration,
|
||||
size = size,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
)
|
||||
|
||||
@@ -56,11 +58,24 @@ public suspend fun TelegramBot.sendVideoNote(
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<VideoNoteContent> = sendVideoNote(
|
||||
chatId, videoNote.fileId, videoNote.thumbnail ?.fileId, videoNote.duration, videoNote.width, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup
|
||||
chatId = chatId,
|
||||
videoNote = videoNote.fileId,
|
||||
thumb = videoNote.thumbnail ?.fileId,
|
||||
duration = videoNote.duration,
|
||||
size = videoNote.width,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -77,10 +92,25 @@ public suspend fun TelegramBot.sendVideoNote(
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<VideoNoteContent> = sendVideoNote(chat.id, videoNote, thumb, duration, size, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
): ContentMessage<VideoNoteContent> = sendVideoNote(
|
||||
chatId = chat.id,
|
||||
videoNote = videoNote,
|
||||
thumb = thumb,
|
||||
duration = duration,
|
||||
size = size,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
@@ -93,7 +123,19 @@ public suspend fun TelegramBot.sendVideoNote(
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<VideoNoteContent> = sendVideoNote(chat.id, videoNote, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
): ContentMessage<VideoNoteContent> = sendVideoNote(
|
||||
chatId = chat.id,
|
||||
videoNote = videoNote,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
@@ -27,23 +27,25 @@ public suspend fun TelegramBot.sendVoice(
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<VoiceContent> = execute(
|
||||
SendVoice(
|
||||
chatId,
|
||||
voice,
|
||||
text,
|
||||
parseMode,
|
||||
duration,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
effectId,
|
||||
replyParameters,
|
||||
replyMarkup
|
||||
chatId = chatId,
|
||||
voice = voice,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
duration = duration,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
)
|
||||
|
||||
@@ -61,10 +63,25 @@ public suspend fun TelegramBot.sendVoice(
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<VoiceContent> = sendVoice(chat.id, voice, text, parseMode, duration, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
): ContentMessage<VoiceContent> = sendVoice(
|
||||
chatId = chat.id,
|
||||
voice = voice,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
duration = duration,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
@@ -79,11 +96,24 @@ public suspend fun TelegramBot.sendVoice(
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<VoiceContent> = sendVoice(
|
||||
chatId, voice.fileId, text, parseMode, voice.duration, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup
|
||||
chatId = chatId,
|
||||
voice = voice.fileId,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
duration = voice.duration,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -99,10 +129,24 @@ public suspend fun TelegramBot.sendVoice(
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<VoiceContent> = sendVoice(chat.id, voice, text, parseMode, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
): ContentMessage<VoiceContent> = sendVoice(
|
||||
chatId = chat.id,
|
||||
voice = voice,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
|
||||
/**
|
||||
@@ -118,6 +162,7 @@ public suspend inline fun TelegramBot.sendVoice(
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
@@ -131,6 +176,7 @@ public suspend inline fun TelegramBot.sendVoice(
|
||||
duration = duration,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
@@ -150,10 +196,24 @@ public suspend inline fun TelegramBot.sendVoice(
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<VoiceContent> = sendVoice(chat.id, voice, entities, duration, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
): ContentMessage<VoiceContent> = sendVoice(
|
||||
chatId = chat.id,
|
||||
voice = voice,
|
||||
entities = entities,
|
||||
duration = duration,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
@@ -167,11 +227,23 @@ public suspend inline fun TelegramBot.sendVoice(
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<VoiceContent> = sendVoice(
|
||||
chatId, voice.fileId, entities, voice.duration, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup
|
||||
chatId = chatId,
|
||||
voice = voice.fileId,
|
||||
entities = entities,
|
||||
duration = voice.duration,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
@@ -185,7 +257,20 @@ public suspend inline fun TelegramBot.sendVoice(
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<VoiceContent> = sendVoice(chat.id, voice, entities, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
): ContentMessage<VoiceContent> = sendVoice(
|
||||
chatId = chat.id,
|
||||
voice = voice,
|
||||
entities = entities,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
@@ -2,9 +2,11 @@ package dev.inmo.tgbotapi.extensions.api.send.payments
|
||||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.send.payments.CreateInvoiceLink
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.payments.LabeledPrice
|
||||
import dev.inmo.tgbotapi.types.payments.abstracts.Currency
|
||||
import dev.inmo.tgbotapi.types.payments.abstracts.XTR
|
||||
import korlibs.time.TimeSpan
|
||||
|
||||
public suspend fun TelegramBot.createInvoiceLink(
|
||||
title: String,
|
||||
@@ -24,7 +26,25 @@ public suspend fun TelegramBot.createInvoiceLink(
|
||||
shouldSendEmailToProvider: Boolean = false,
|
||||
priceDependOnShipAddress: Boolean = false
|
||||
): String = execute(
|
||||
CreateInvoiceLink(title, description, payload, providerToken, currency, prices, maxTipAmount, suggestedTipAmounts ?.sorted(), providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress)
|
||||
CreateInvoiceLink(
|
||||
title = title,
|
||||
description = description,
|
||||
payload = payload,
|
||||
providerToken = providerToken,
|
||||
currency = currency,
|
||||
prices = prices,
|
||||
subscriptionPeriod = null,
|
||||
maxTipAmount = maxTipAmount,
|
||||
suggestedTipAmounts = suggestedTipAmounts ?.sorted(),
|
||||
providerData = providerData,
|
||||
requireName = requireName,
|
||||
requirePhoneNumber = requirePhoneNumber,
|
||||
requireEmail = requireEmail,
|
||||
requireShippingAddress = requireShippingAddress,
|
||||
shouldSendPhoneNumberToProvider = shouldSendPhoneNumberToProvider,
|
||||
shouldSendEmailToProvider = shouldSendEmailToProvider,
|
||||
priceDependOnShipAddress = priceDependOnShipAddress
|
||||
)
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -35,6 +55,8 @@ public suspend fun TelegramBot.createInvoiceLink(
|
||||
description: String,
|
||||
payload: String,
|
||||
prices: List<LabeledPrice>,
|
||||
businessConnectionId: BusinessConnectionId? = null,
|
||||
subscriptionPeriod: TimeSpan? = null,
|
||||
maxTipAmount: Int? = null,
|
||||
suggestedTipAmounts: List<Int>? = null,
|
||||
providerData: String? = null,
|
||||
@@ -46,5 +68,24 @@ public suspend fun TelegramBot.createInvoiceLink(
|
||||
shouldSendEmailToProvider: Boolean = false,
|
||||
priceDependOnShipAddress: Boolean = false
|
||||
): String = execute(
|
||||
CreateInvoiceLink(title, description, payload, null, Currency.XTR, prices, maxTipAmount, suggestedTipAmounts ?.sorted(), providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress)
|
||||
CreateInvoiceLink(
|
||||
title = title,
|
||||
description = description,
|
||||
payload = payload,
|
||||
providerToken = null,
|
||||
currency = Currency.XTR,
|
||||
businessConnectionId = businessConnectionId,
|
||||
prices = prices,
|
||||
subscriptionPeriod = subscriptionPeriod,
|
||||
maxTipAmount = maxTipAmount,
|
||||
suggestedTipAmounts = suggestedTipAmounts ?.sorted(),
|
||||
providerData = providerData,
|
||||
requireName = requireName,
|
||||
requirePhoneNumber = requirePhoneNumber,
|
||||
requireEmail = requireEmail,
|
||||
requireShippingAddress = requireShippingAddress,
|
||||
shouldSendPhoneNumberToProvider = shouldSendPhoneNumberToProvider,
|
||||
shouldSendEmailToProvider = shouldSendEmailToProvider,
|
||||
priceDependOnShipAddress = priceDependOnShipAddress
|
||||
)
|
||||
)
|
||||
|
||||
@@ -37,11 +37,38 @@ public suspend fun TelegramBot.sendInvoice(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
): ContentMessage<InvoiceContent> = execute(
|
||||
SendInvoice(chatId, title, description, payload, providerToken, currency, prices, maxTipAmount, suggestedTipAmounts ?.sorted(), startParameter, providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress, threadId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
SendInvoice(
|
||||
chatId = chatId,
|
||||
title = title,
|
||||
description = description,
|
||||
payload = payload,
|
||||
providerToken = providerToken,
|
||||
currency = currency,
|
||||
prices = prices,
|
||||
maxTipAmount = maxTipAmount,
|
||||
suggestedTipAmounts = suggestedTipAmounts ?.sorted(),
|
||||
startParameter = startParameter,
|
||||
providerData = providerData,
|
||||
requireName = requireName,
|
||||
requirePhoneNumber = requirePhoneNumber,
|
||||
requireEmail = requireEmail,
|
||||
requireShippingAddress = requireShippingAddress,
|
||||
shouldSendPhoneNumberToProvider = shouldSendPhoneNumberToProvider,
|
||||
shouldSendEmailToProvider = shouldSendEmailToProvider,
|
||||
priceDependOnShipAddress = priceDependOnShipAddress,
|
||||
threadId = threadId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -69,10 +96,37 @@ public suspend fun TelegramBot.sendInvoice(
|
||||
priceDependOnShipAddress: Boolean = false,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
): ContentMessage<InvoiceContent> = sendInvoice(user.id, title, description, payload, providerToken, currency, prices, maxTipAmount, suggestedTipAmounts, startParameter, providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress, null, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
): ContentMessage<InvoiceContent> = sendInvoice(
|
||||
chatId = user.id,
|
||||
title = title,
|
||||
description = description,
|
||||
payload = payload,
|
||||
providerToken = providerToken,
|
||||
currency = currency,
|
||||
prices = prices,
|
||||
maxTipAmount = maxTipAmount,
|
||||
suggestedTipAmounts = suggestedTipAmounts,
|
||||
startParameter = startParameter,
|
||||
providerData = providerData,
|
||||
requireName = requireName,
|
||||
requirePhoneNumber = requirePhoneNumber,
|
||||
requireEmail = requireEmail,
|
||||
requireShippingAddress = requireShippingAddress,
|
||||
shouldSendPhoneNumberToProvider = shouldSendPhoneNumberToProvider,
|
||||
shouldSendEmailToProvider = shouldSendEmailToProvider,
|
||||
priceDependOnShipAddress = priceDependOnShipAddress,
|
||||
threadId = null,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
|
||||
/**
|
||||
@@ -90,11 +144,27 @@ public suspend fun TelegramBot.sendInvoice(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
): ContentMessage<InvoiceContent> = execute(
|
||||
SendInvoice(chatId, title, description, payload, price, startParameter, providerData, threadId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
SendInvoice(
|
||||
chatId = chatId,
|
||||
title = title,
|
||||
description = description,
|
||||
payload = payload,
|
||||
price = price,
|
||||
startParameter = startParameter,
|
||||
providerData = providerData,
|
||||
threadId = threadId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -111,6 +181,7 @@ public suspend fun TelegramBot.sendInvoice(
|
||||
providerData: String? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
@@ -125,6 +196,7 @@ public suspend fun TelegramBot.sendInvoice(
|
||||
threadId = null,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
|
||||
@@ -29,29 +29,31 @@ public suspend fun TelegramBot.sendQuizPoll(
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<PollContent> = execute(
|
||||
SendQuizPoll(
|
||||
chatId,
|
||||
question,
|
||||
options,
|
||||
correctOptionId,
|
||||
explanation,
|
||||
questionParseMode,
|
||||
explanationParseMode,
|
||||
isAnonymous,
|
||||
isClosed,
|
||||
openPeriod,
|
||||
closeDate,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
effectId,
|
||||
replyParameters,
|
||||
replyMarkup
|
||||
chatId = chatId,
|
||||
question = question,
|
||||
options = options,
|
||||
correctOptionId = correctOptionId,
|
||||
explanation = explanation,
|
||||
questionParseMode = questionParseMode,
|
||||
explanationParseMode = explanationParseMode,
|
||||
isAnonymous = isAnonymous,
|
||||
isClosed = isClosed,
|
||||
openPeriod = openPeriod,
|
||||
closeDate = closeDate,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
)
|
||||
|
||||
@@ -70,28 +72,30 @@ public suspend fun TelegramBot.sendQuizPoll(
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<PollContent> = execute(
|
||||
SendQuizPoll(
|
||||
chatId,
|
||||
questionEntities,
|
||||
options,
|
||||
correctOptionId,
|
||||
explanation,
|
||||
explanationParseMode,
|
||||
isAnonymous,
|
||||
isClosed,
|
||||
openPeriod,
|
||||
closeDate,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
effectId,
|
||||
replyParameters,
|
||||
replyMarkup
|
||||
chatId = chatId,
|
||||
questionEntities = questionEntities,
|
||||
options = options,
|
||||
correctOptionId = correctOptionId,
|
||||
explanation = explanation,
|
||||
explanationParseMode = explanationParseMode,
|
||||
isAnonymous = isAnonymous,
|
||||
isClosed = isClosed,
|
||||
openPeriod = openPeriod,
|
||||
closeDate = closeDate,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
)
|
||||
|
||||
@@ -110,28 +114,30 @@ public suspend fun TelegramBot.sendQuizPoll(
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<PollContent> = execute(
|
||||
SendQuizPoll(
|
||||
chatId,
|
||||
question,
|
||||
options,
|
||||
correctOptionId,
|
||||
questionParseMode,
|
||||
explanationTextSources,
|
||||
isAnonymous,
|
||||
isClosed,
|
||||
openPeriod,
|
||||
closeDate,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
effectId,
|
||||
replyParameters,
|
||||
replyMarkup
|
||||
chatId = chatId,
|
||||
question = question,
|
||||
options = options,
|
||||
correctOptionId = correctOptionId,
|
||||
questionParseMode = questionParseMode,
|
||||
explanationTextSources = explanationTextSources,
|
||||
isAnonymous = isAnonymous,
|
||||
isClosed = isClosed,
|
||||
openPeriod = openPeriod,
|
||||
closeDate = closeDate,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
)
|
||||
|
||||
@@ -150,27 +156,29 @@ public suspend fun TelegramBot.sendQuizPoll(
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<PollContent> = execute(
|
||||
SendQuizPoll(
|
||||
chatId,
|
||||
questionEntities,
|
||||
options,
|
||||
correctOptionId,
|
||||
explanationTextSources,
|
||||
isAnonymous,
|
||||
isClosed,
|
||||
openPeriod,
|
||||
closeDate,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
effectId,
|
||||
replyParameters,
|
||||
replyMarkup
|
||||
chatId = chatId,
|
||||
questionEntities = questionEntities,
|
||||
options = options,
|
||||
correctOptionId = correctOptionId,
|
||||
explanationTextSources = explanationTextSources,
|
||||
isAnonymous = isAnonymous,
|
||||
isClosed = isClosed,
|
||||
openPeriod = openPeriod,
|
||||
closeDate = closeDate,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
)
|
||||
|
||||
@@ -189,28 +197,30 @@ public suspend fun TelegramBot.sendQuizPoll(
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<PollContent> = execute(
|
||||
SendQuizPoll(
|
||||
chatId,
|
||||
question,
|
||||
options,
|
||||
correctOptionId,
|
||||
closeInfo,
|
||||
explanation,
|
||||
questionParseMode,
|
||||
explanationParseMode,
|
||||
isAnonymous,
|
||||
isClosed,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
effectId,
|
||||
replyParameters,
|
||||
replyMarkup
|
||||
chatId = chatId,
|
||||
question = question,
|
||||
options = options,
|
||||
correctOptionId = correctOptionId,
|
||||
closeInfo = closeInfo,
|
||||
explanation = explanation,
|
||||
questionParseMode = questionParseMode,
|
||||
explanationParseMode = explanationParseMode,
|
||||
isAnonymous = isAnonymous,
|
||||
isClosed = isClosed,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
)
|
||||
|
||||
@@ -228,27 +238,29 @@ public suspend fun TelegramBot.sendQuizPoll(
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<PollContent> = execute(
|
||||
SendQuizPoll(
|
||||
chatId,
|
||||
questionEntities,
|
||||
options,
|
||||
correctOptionId,
|
||||
closeInfo,
|
||||
explanation,
|
||||
explanationParseMode,
|
||||
isAnonymous,
|
||||
isClosed,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
effectId,
|
||||
replyParameters,
|
||||
replyMarkup
|
||||
chatId = chatId,
|
||||
questionEntities = questionEntities,
|
||||
options = options,
|
||||
correctOptionId = correctOptionId,
|
||||
closeInfo = closeInfo,
|
||||
explanation = explanation,
|
||||
explanationParseMode = explanationParseMode,
|
||||
isAnonymous = isAnonymous,
|
||||
isClosed = isClosed,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
)
|
||||
|
||||
@@ -266,27 +278,29 @@ public suspend fun TelegramBot.sendQuizPoll(
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<PollContent> = execute(
|
||||
SendQuizPoll(
|
||||
chatId,
|
||||
question,
|
||||
options,
|
||||
correctOptionId,
|
||||
closeInfo,
|
||||
questionParseMode,
|
||||
explanationTextSources,
|
||||
isAnonymous,
|
||||
isClosed,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
effectId,
|
||||
replyParameters,
|
||||
replyMarkup
|
||||
chatId = chatId,
|
||||
question = question,
|
||||
options = options,
|
||||
correctOptionId = correctOptionId,
|
||||
closeInfo = closeInfo,
|
||||
questionParseMode = questionParseMode,
|
||||
explanationTextSources = explanationTextSources,
|
||||
isAnonymous = isAnonymous,
|
||||
isClosed = isClosed,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
)
|
||||
|
||||
@@ -303,25 +317,27 @@ public suspend fun TelegramBot.sendQuizPoll(
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<PollContent> = execute(
|
||||
SendQuizPoll(
|
||||
chatId,
|
||||
questionEntities,
|
||||
options,
|
||||
correctOptionId,
|
||||
closeInfo,
|
||||
explanationTextSources,
|
||||
isAnonymous,
|
||||
isClosed,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
effectId,
|
||||
replyParameters,
|
||||
replyMarkup
|
||||
chatId = chatId,
|
||||
questionEntities = questionEntities,
|
||||
options = options,
|
||||
correctOptionId = correctOptionId,
|
||||
closeInfo = closeInfo,
|
||||
explanationTextSources = explanationTextSources,
|
||||
isAnonymous = isAnonymous,
|
||||
isClosed = isClosed,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
)
|
||||
|
||||
@@ -27,27 +27,29 @@ public suspend fun TelegramBot.sendRegularPoll(
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<PollContent> = execute(
|
||||
SendRegularPoll(
|
||||
chatId,
|
||||
question,
|
||||
options,
|
||||
questionParseMode,
|
||||
isAnonymous,
|
||||
isClosed,
|
||||
allowMultipleAnswers,
|
||||
openPeriod,
|
||||
closeDate,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
effectId,
|
||||
replyParameters,
|
||||
replyMarkup
|
||||
chatId = chatId,
|
||||
question = question,
|
||||
options = options,
|
||||
questionParseMode = questionParseMode,
|
||||
isAnonymous = isAnonymous,
|
||||
isClosed = isClosed,
|
||||
allowMultipleAnswers = allowMultipleAnswers,
|
||||
openPeriod = openPeriod,
|
||||
closeDate = closeDate,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
)
|
||||
|
||||
@@ -64,26 +66,28 @@ public suspend fun TelegramBot.sendRegularPoll(
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<PollContent> = execute(
|
||||
SendRegularPoll(
|
||||
chatId,
|
||||
questionEntities,
|
||||
options,
|
||||
isAnonymous,
|
||||
isClosed,
|
||||
allowMultipleAnswers,
|
||||
openPeriod,
|
||||
closeDate,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
effectId,
|
||||
replyParameters,
|
||||
replyMarkup
|
||||
chatId = chatId,
|
||||
questionEntities = questionEntities,
|
||||
options = options,
|
||||
isAnonymous = isAnonymous,
|
||||
isClosed = isClosed,
|
||||
allowMultipleAnswers = allowMultipleAnswers,
|
||||
openPeriod = openPeriod,
|
||||
closeDate = closeDate,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
)
|
||||
|
||||
@@ -100,26 +104,28 @@ public suspend fun TelegramBot.sendRegularPoll(
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<PollContent> = execute(
|
||||
SendRegularPoll(
|
||||
chatId,
|
||||
question,
|
||||
options,
|
||||
closeInfo,
|
||||
questionParseMode,
|
||||
isAnonymous,
|
||||
isClosed,
|
||||
allowMultipleAnswers,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
effectId,
|
||||
replyParameters,
|
||||
replyMarkup
|
||||
chatId = chatId,
|
||||
question = question,
|
||||
options = options,
|
||||
closeInfo = closeInfo,
|
||||
questionParseMode = questionParseMode,
|
||||
isAnonymous = isAnonymous,
|
||||
isClosed = isClosed,
|
||||
allowMultipleAnswers = allowMultipleAnswers,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
)
|
||||
|
||||
@@ -135,24 +141,26 @@ public suspend fun TelegramBot.sendRegularPoll(
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ContentMessage<PollContent> = execute(
|
||||
SendRegularPoll(
|
||||
chatId,
|
||||
questionEntities,
|
||||
options,
|
||||
closeInfo,
|
||||
isAnonymous,
|
||||
isClosed,
|
||||
allowMultipleAnswers,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
effectId,
|
||||
replyParameters,
|
||||
replyMarkup
|
||||
chatId = chatId,
|
||||
questionTextSources = questionEntities,
|
||||
options = options,
|
||||
closeInfo = closeInfo,
|
||||
isAnonymous = isAnonymous,
|
||||
isClosed = isClosed,
|
||||
allowMultipleAnswers = allowMultipleAnswers,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
)
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
package dev.inmo.tgbotapi.extensions.api.set
|
||||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.set.SetUserEmojiStatus
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.chat.User
|
||||
import korlibs.time.DateTime
|
||||
|
||||
public suspend fun TelegramBot.setUserEmojiStatus(
|
||||
userId: UserId,
|
||||
customEmojiId: CustomEmojiId,
|
||||
expirationDate: TelegramDate? = null
|
||||
): Boolean = execute(
|
||||
SetUserEmojiStatus(
|
||||
userId = userId,
|
||||
customEmojiId = customEmojiId,
|
||||
expirationDate = expirationDate
|
||||
)
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.setUserEmojiStatus(
|
||||
user: User,
|
||||
customEmojiId: CustomEmojiId,
|
||||
expirationDate: TelegramDate? = null
|
||||
): Boolean = setUserEmojiStatus(
|
||||
user.id,
|
||||
customEmojiId,
|
||||
expirationDate
|
||||
)
|
||||
|
||||
|
||||
public suspend fun TelegramBot.setUserEmojiStatus(
|
||||
userId: UserId,
|
||||
customEmojiId: CustomEmojiId,
|
||||
expirationDate: DateTime
|
||||
): Boolean = setUserEmojiStatus(
|
||||
userId,
|
||||
customEmojiId,
|
||||
expirationDate.toTelegramDate()
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.setUserEmojiStatus(
|
||||
user: User,
|
||||
customEmojiId: CustomEmojiId,
|
||||
expirationDate: DateTime
|
||||
): Boolean = setUserEmojiStatus(
|
||||
user.id,
|
||||
customEmojiId,
|
||||
expirationDate
|
||||
)
|
||||
@@ -0,0 +1,42 @@
|
||||
package dev.inmo.tgbotapi.extensions.api.stories
|
||||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.stories.DeleteStory
|
||||
import dev.inmo.tgbotapi.types.StoryId
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.BusinessContentMessage
|
||||
import dev.inmo.tgbotapi.types.stories.Story
|
||||
|
||||
/**
|
||||
* Deletes a story from a business account
|
||||
*/
|
||||
public suspend fun TelegramBot.deleteStory(
|
||||
businessConnectionId: BusinessConnectionId,
|
||||
storyId: StoryId
|
||||
): Boolean = execute(
|
||||
DeleteStory(
|
||||
businessConnectionId = businessConnectionId,
|
||||
storyId = storyId
|
||||
)
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.deleteStory(
|
||||
message: BusinessContentMessage<*>,
|
||||
storyId: StoryId
|
||||
): Boolean = deleteStory(
|
||||
businessConnectionId = with(message) {message.businessConnectionId}, storyId = storyId
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.deleteStory(
|
||||
businessConnectionId: BusinessConnectionId,
|
||||
story: Story
|
||||
): Boolean = deleteStory(
|
||||
businessConnectionId = businessConnectionId, storyId = with(story) {story.id}
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.deleteStory(
|
||||
message: BusinessContentMessage<*>,
|
||||
story: Story
|
||||
): Boolean = deleteStory(
|
||||
message = message, storyId = with(story) {story.id}
|
||||
)
|
||||
@@ -0,0 +1,79 @@
|
||||
package dev.inmo.tgbotapi.extensions.api.stories
|
||||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.stories.EditStory
|
||||
import dev.inmo.tgbotapi.types.Seconds
|
||||
import dev.inmo.tgbotapi.types.StoryId
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||
import dev.inmo.tgbotapi.types.message.textsources.TextSource
|
||||
import dev.inmo.tgbotapi.types.stories.InputStoryContent
|
||||
import dev.inmo.tgbotapi.types.stories.Story
|
||||
import dev.inmo.tgbotapi.types.stories.StoryArea
|
||||
import dev.inmo.tgbotapi.utils.EntitiesBuilderBody
|
||||
import dev.inmo.tgbotapi.utils.buildEntities
|
||||
|
||||
public suspend fun TelegramBot.editStory(
|
||||
businessConnectionId: BusinessConnectionId,
|
||||
storyId: StoryId,
|
||||
content: InputStoryContent,
|
||||
textSources: List<TextSource>,
|
||||
areas: List<StoryArea> = emptyList(),
|
||||
): Story = execute(
|
||||
EditStory(
|
||||
businessConnectionId = businessConnectionId,
|
||||
storyId = storyId,
|
||||
content = content,
|
||||
textSources = textSources,
|
||||
areas = areas,
|
||||
)
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.editStory(
|
||||
businessConnectionId: BusinessConnectionId,
|
||||
storyId: StoryId,
|
||||
content: InputStoryContent,
|
||||
areas: List<StoryArea> = emptyList(),
|
||||
separator: TextSource? = null,
|
||||
textBuilder: EntitiesBuilderBody
|
||||
): Story = execute(
|
||||
EditStory(
|
||||
businessConnectionId = businessConnectionId,
|
||||
storyId = storyId,
|
||||
content = content,
|
||||
textSources = buildEntities(separator, textBuilder),
|
||||
areas = areas,
|
||||
)
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.editStory(
|
||||
businessConnectionId: BusinessConnectionId,
|
||||
storyId: StoryId,
|
||||
content: InputStoryContent,
|
||||
text: String,
|
||||
parseMode: ParseMode? = null,
|
||||
areas: List<StoryArea> = emptyList(),
|
||||
): Story = execute(
|
||||
EditStory(
|
||||
businessConnectionId = businessConnectionId,
|
||||
storyId = storyId,
|
||||
content = content,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
areas = areas,
|
||||
)
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.editStory(
|
||||
businessConnectionId: BusinessConnectionId,
|
||||
storyId: StoryId,
|
||||
content: InputStoryContent,
|
||||
areas: List<StoryArea> = emptyList(),
|
||||
): Story = execute(
|
||||
EditStory(
|
||||
businessConnectionId = businessConnectionId,
|
||||
storyId = storyId,
|
||||
content = content,
|
||||
areas = areas,
|
||||
)
|
||||
)
|
||||
@@ -0,0 +1,94 @@
|
||||
package dev.inmo.tgbotapi.extensions.api.stories
|
||||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.stories.PostStory
|
||||
import dev.inmo.tgbotapi.types.Seconds
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||
import dev.inmo.tgbotapi.types.message.textsources.TextSource
|
||||
import dev.inmo.tgbotapi.types.stories.InputStoryContent
|
||||
import dev.inmo.tgbotapi.types.stories.Story
|
||||
import dev.inmo.tgbotapi.types.stories.StoryArea
|
||||
import dev.inmo.tgbotapi.utils.EntitiesBuilderBody
|
||||
import dev.inmo.tgbotapi.utils.buildEntities
|
||||
|
||||
public suspend fun TelegramBot.postStory(
|
||||
businessConnectionId: BusinessConnectionId,
|
||||
content: InputStoryContent,
|
||||
activePeriod: Seconds,
|
||||
textSources: List<TextSource>,
|
||||
areas: List<StoryArea> = emptyList(),
|
||||
postToChatPage: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
): Story = execute(
|
||||
PostStory(
|
||||
businessConnectionId = businessConnectionId,
|
||||
content = content,
|
||||
activePeriod = activePeriod,
|
||||
textSources = textSources,
|
||||
areas = areas,
|
||||
postToChatPage = postToChatPage,
|
||||
protectContent = protectContent
|
||||
)
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.postStory(
|
||||
businessConnectionId: BusinessConnectionId,
|
||||
content: InputStoryContent,
|
||||
activePeriod: Seconds,
|
||||
areas: List<StoryArea> = emptyList(),
|
||||
postToChatPage: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
separator: TextSource? = null,
|
||||
textBuilder: EntitiesBuilderBody
|
||||
): Story = execute(
|
||||
PostStory(
|
||||
businessConnectionId = businessConnectionId,
|
||||
content = content,
|
||||
activePeriod = activePeriod,
|
||||
textSources = buildEntities(separator, textBuilder),
|
||||
areas = areas,
|
||||
postToChatPage = postToChatPage,
|
||||
protectContent = protectContent
|
||||
)
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.postStory(
|
||||
businessConnectionId: BusinessConnectionId,
|
||||
content: InputStoryContent,
|
||||
activePeriod: Seconds,
|
||||
text: String,
|
||||
parseMode: ParseMode? = null,
|
||||
areas: List<StoryArea> = emptyList(),
|
||||
postToChatPage: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
): Story = execute(
|
||||
PostStory(
|
||||
businessConnectionId = businessConnectionId,
|
||||
content = content,
|
||||
activePeriod = activePeriod,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
areas = areas,
|
||||
postToChatPage = postToChatPage,
|
||||
protectContent = protectContent
|
||||
)
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.postStory(
|
||||
businessConnectionId: BusinessConnectionId,
|
||||
content: InputStoryContent,
|
||||
activePeriod: Seconds,
|
||||
areas: List<StoryArea> = emptyList(),
|
||||
postToChatPage: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
): Story = execute(
|
||||
PostStory(
|
||||
businessConnectionId = businessConnectionId,
|
||||
content = content,
|
||||
activePeriod = activePeriod,
|
||||
areas = areas,
|
||||
postToChatPage = postToChatPage,
|
||||
protectContent = protectContent
|
||||
)
|
||||
)
|
||||
@@ -0,0 +1,39 @@
|
||||
package dev.inmo.tgbotapi.extensions.api.verifications
|
||||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.verifications.VerifyChat
|
||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.chat.*
|
||||
import dev.inmo.tgbotapi.types.chatIdField
|
||||
import dev.inmo.tgbotapi.types.customDescriptionField
|
||||
import kotlinx.serialization.SerialName
|
||||
|
||||
public suspend fun TelegramBot.verifyChat(
|
||||
chatId: ChatIdentifier,
|
||||
description: String? = null
|
||||
): Boolean = execute(
|
||||
VerifyChat(
|
||||
chatId = chatId,
|
||||
description = description
|
||||
)
|
||||
)
|
||||
|
||||
/**
|
||||
* This method may call [verifyUser] in case when [chat] is [PrivateChat]
|
||||
*/
|
||||
public suspend fun TelegramBot.verifyChat(
|
||||
chat: Chat,
|
||||
description: String? = null
|
||||
): Boolean = when (chat) {
|
||||
is PrivateChat -> verifyUser(
|
||||
chat = chat,
|
||||
description = description
|
||||
)
|
||||
is UnknownExtendedChat,
|
||||
is UnknownChatType,
|
||||
is BusinessChat,
|
||||
is PublicChat -> verifyChat(
|
||||
chatId = chat.id,
|
||||
description = description
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package dev.inmo.tgbotapi.extensions.api.verifications
|
||||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.verifications.VerifyChat
|
||||
import dev.inmo.tgbotapi.requests.verifications.VerifyUser
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
import kotlinx.serialization.SerialName
|
||||
|
||||
public suspend fun TelegramBot.verifyUser(
|
||||
userId: UserId,
|
||||
description: String? = null
|
||||
): Boolean = execute(
|
||||
VerifyUser(
|
||||
userId = userId,
|
||||
description = description
|
||||
)
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.verifyUser(
|
||||
chat: Chat,
|
||||
description: String? = null
|
||||
): Boolean = verifyUser(
|
||||
userId = chat.id.toChatId(),
|
||||
description = description
|
||||
)
|
||||
@@ -2,30 +2,29 @@ public abstract interface class dev/inmo/tgbotapi/extensions/behaviour_builder/B
|
||||
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 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;)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;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 abstract fun getStateInitialAction ()Lkotlin/jvm/functions/Function3;
|
||||
public abstract fun start (Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextWithFSM$Companion {
|
||||
public final fun invoke (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/util/List;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;Lkotlin/jvm/functions/Function3;)Ldev/inmo/tgbotapi/extensions/behaviour_builder/DefaultBehaviourContextWithFSM;
|
||||
public static synthetic fun invoke$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextWithFSM$Companion;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/util/List;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Ldev/inmo/tgbotapi/extensions/behaviour_builder/DefaultBehaviourContextWithFSM;
|
||||
public final fun getDATA_FSM_KEY ()Ljava/lang/String;
|
||||
public final fun invoke (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/util/List;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;)Ldev/inmo/tgbotapi/extensions/behaviour_builder/DefaultBehaviourContextWithFSM;
|
||||
public static synthetic fun invoke$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextWithFSM$Companion;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/util/List;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Ldev/inmo/tgbotapi/extensions/behaviour_builder/DefaultBehaviourContextWithFSM;
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextWithFSM$DefaultImpls {
|
||||
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 static fun addStrict (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextWithFSM;Lkotlin/reflect/KClass;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandler;)V
|
||||
public static fun copy (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextWithFSM;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 static fun copy (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextWithFSM;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;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;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)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;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 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 static fun getAllowedUpdates (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextWithFSM;)Ljava/util/List;
|
||||
public static fun getBot (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextWithFSM;)Ldev/inmo/tgbotapi/bot/RequestsExecutor;
|
||||
public static fun getChannelPostMediaGroupsFlow (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextWithFSM;)Lkotlinx/coroutines/flow/Flow;
|
||||
public static fun getEditedChannelPostMediaGroupsFlow (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextWithFSM;)Lkotlinx/coroutines/flow/Flow;
|
||||
public static fun getEditedMessageMediaGroupsFlow (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextWithFSM;)Lkotlinx/coroutines/flow/Flow;
|
||||
public static fun getFlowsUpdatesFilter (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextWithFSM;)Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;
|
||||
public static fun getLog (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextWithFSM;)Ldev/inmo/kslog/common/KSLog;
|
||||
public static fun getMessageMediaGroupsFlow (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextWithFSM;)Lkotlinx/coroutines/flow/Flow;
|
||||
public static fun getScope (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextWithFSM;)Lkotlinx/coroutines/CoroutineScope;
|
||||
public static fun launchStateHandling (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextWithFSM;Ldev/inmo/micro_utils/fsm/common/State;Ljava/util/List;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
@@ -34,14 +33,19 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourConte
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextWithFSMBuilderKt {
|
||||
public static final fun buildBehaviourWithFSM (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/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/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/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/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/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/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/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/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
|
||||
public static final fun buildBehaviourWithFSM (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
public static final fun buildBehaviourWithFSM (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/flow/Flow;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
public static synthetic fun buildBehaviourWithFSM$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
|
||||
public static synthetic fun buildBehaviourWithFSM$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/flow/Flow;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
|
||||
public static final fun buildBehaviourWithFSMAndStartLongPolling (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;Lkotlin/jvm/functions/Function3;IZZLjava/lang/Long;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
public static final fun buildBehaviourWithFSMAndStartLongPolling (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/flow/Flow;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;Lkotlin/jvm/functions/Function3;IZZLjava/lang/Long;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
public static synthetic fun buildBehaviourWithFSMAndStartLongPolling$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;Lkotlin/jvm/functions/Function3;IZZLjava/lang/Long;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
|
||||
public static synthetic fun buildBehaviourWithFSMAndStartLongPolling$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/flow/Flow;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;Lkotlin/jvm/functions/Function3;IZZLjava/lang/Long;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextWithFSMKt {
|
||||
public static final fun fsmOrNull (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;)Ldev/inmo/micro_utils/fsm/common/StatesMachine;
|
||||
public static final fun fsmOrThrow (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;)Ldev/inmo/micro_utils/fsm/common/StatesMachine;
|
||||
}
|
||||
|
||||
public abstract interface class dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandler : dev/inmo/micro_utils/fsm/common/StatesHandler {
|
||||
@@ -62,18 +66,17 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithF
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/DefaultBehaviourContextWithFSM : dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext, dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextWithFSM {
|
||||
public fun <init> (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;Lkotlin/jvm/functions/Function3;)V
|
||||
public synthetic fun <init> (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;Lkotlin/jvm/functions/Function3;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
|
||||
public fun <init> (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;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;)V
|
||||
public synthetic fun <init> (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;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;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
|
||||
public fun add (Lkotlin/reflect/KClass;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandler;)V
|
||||
public fun addStrict (Lkotlin/reflect/KClass;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandler;)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;)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;)Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextWithFSM;
|
||||
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;)Ldev/inmo/tgbotapi/extensions/behaviour_builder/DefaultBehaviourContextWithFSM;
|
||||
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/BehaviourContextWithFSM;
|
||||
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/DefaultBehaviourContextWithFSM;
|
||||
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;Lkotlin/jvm/functions/Function3;)Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextWithFSM;
|
||||
public 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 fun execute (Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
public final fun fsm ()Ldev/inmo/tgbotapi/extensions/behaviour_builder/DefaultBehaviourContextWithFSM;
|
||||
public fun getAllUpdatesFlow ()Lkotlinx/coroutines/flow/Flow;
|
||||
public fun getAllowedUpdates ()Ljava/util/List;
|
||||
public fun getAsUpdateReceiver ()Lkotlin/jvm/functions/Function2;
|
||||
@@ -91,6 +94,7 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/DefaultBehavio
|
||||
public fun getChatMessageReactionsCountUpdatedUpdateFlow ()Lkotlinx/coroutines/flow/Flow;
|
||||
public fun getChosenInlineResultsFlow ()Lkotlinx/coroutines/flow/Flow;
|
||||
public fun getCoroutineContext ()Lkotlin/coroutines/CoroutineContext;
|
||||
public fun getData ()Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextData;
|
||||
public fun getDeleteBusinessMessageUpdatesFlow ()Lkotlinx/coroutines/flow/Flow;
|
||||
public fun getEditBusinessMessageUpdatesFlow ()Lkotlinx/coroutines/flow/Flow;
|
||||
public fun getEditedChannelPostMediaGroupsFlow ()Lkotlinx/coroutines/flow/Flow;
|
||||
@@ -99,6 +103,7 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/DefaultBehavio
|
||||
public fun getEditedMessagesFlow ()Lkotlinx/coroutines/flow/Flow;
|
||||
public fun getFlowsUpdatesFilter ()Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;
|
||||
public fun getInlineQueriesFlow ()Lkotlinx/coroutines/flow/Flow;
|
||||
public fun getLog ()Ldev/inmo/kslog/common/KSLog;
|
||||
public fun getMessageMediaGroupsFlow ()Lkotlinx/coroutines/flow/Flow;
|
||||
public fun getMessagesFlow ()Lkotlinx/coroutines/flow/Flow;
|
||||
public fun getMyChatMemberUpdatesFlow ()Lkotlinx/coroutines/flow/Flow;
|
||||
@@ -108,6 +113,8 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/DefaultBehavio
|
||||
public fun getPreCheckoutQueriesFlow ()Lkotlinx/coroutines/flow/Flow;
|
||||
public fun getScope ()Lkotlinx/coroutines/CoroutineScope;
|
||||
public fun getShippingQueriesFlow ()Lkotlinx/coroutines/flow/Flow;
|
||||
public fun getStateInitialAction ()Lkotlin/jvm/functions/Function3;
|
||||
public fun getSubcontextInitialAction ()Lkotlin/jvm/functions/Function3;
|
||||
public fun getTriggersHolder ()Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;
|
||||
public fun getUnknownUpdatesFlow ()Lkotlinx/coroutines/flow/Flow;
|
||||
public fun handleState (Ldev/inmo/micro_utils/fsm/common/StatesMachine;Ldev/inmo/micro_utils/fsm/common/State;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
@@ -119,9 +126,9 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/DefaultBehavio
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/TelegramBotWithFSMKt {
|
||||
public static final fun telegramBotWithBehaviourAndFSM (Ljava/lang/String;Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;Lkotlinx/coroutines/CoroutineScope;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;ZLkotlin/jvm/functions/Function3;IZZLjava/lang/Long;Lkotlin/jvm/functions/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/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/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/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
|
||||
public static final fun telegramBotWithBehaviourAndFSM (Ljava/lang/String;Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;Lkotlinx/coroutines/CoroutineScope;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;ZLkotlin/jvm/functions/Function3;IZZLjava/lang/Long;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;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 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 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;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import dev.inmo.micro_utils.fsm.common.*
|
||||
import dev.inmo.micro_utils.fsm.common.utils.StateHandlingErrorHandler
|
||||
import dev.inmo.micro_utils.fsm.common.utils.defaultStateHandlingErrorHandler
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextWithFSM.Companion.DATA_FSM_KEY
|
||||
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.handlers_registrar.TriggersHolder
|
||||
import kotlinx.coroutines.*
|
||||
@@ -22,6 +23,11 @@ import kotlin.reflect.KClass
|
||||
* @see buildBehaviourWithFSM
|
||||
*/
|
||||
interface BehaviourContextWithFSM<T : State> : BehaviourContext, StatesMachine<T> {
|
||||
/**
|
||||
* Will be called BEFORE handling of [State] will be started
|
||||
*/
|
||||
val stateInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContextWithFSM<T>, Unit, T>
|
||||
|
||||
suspend fun start() = start(this)
|
||||
|
||||
/**
|
||||
@@ -49,7 +55,8 @@ interface BehaviourContextWithFSM<T : State> : BehaviourContext, StatesMachine<T
|
||||
broadcastChannelsSize: Int,
|
||||
onBufferOverflow: BufferOverflow,
|
||||
upstreamUpdatesFlow: Flow<Update>?,
|
||||
triggersHolder: TriggersHolder
|
||||
triggersHolder: TriggersHolder,
|
||||
subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update>
|
||||
): BehaviourContextWithFSM<T>
|
||||
|
||||
fun copy(
|
||||
@@ -58,35 +65,11 @@ interface BehaviourContextWithFSM<T : State> : BehaviourContext, StatesMachine<T
|
||||
broadcastChannelsSize: Int = 100,
|
||||
onBufferOverflow: BufferOverflow = BufferOverflow.SUSPEND,
|
||||
upstreamUpdatesFlow: Flow<Update>? = null,
|
||||
subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {},
|
||||
triggersHolder: TriggersHolder = this.triggersHolder,
|
||||
stateInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContextWithFSM<T>, Unit, T> = this.stateInitialAction,
|
||||
onStateHandlingErrorHandler: StateHandlingErrorHandler<T> = defaultStateHandlingErrorHandler()
|
||||
): BehaviourContextWithFSM<T> = copy(
|
||||
bot,
|
||||
scope,
|
||||
broadcastChannelsSize,
|
||||
onBufferOverflow,
|
||||
upstreamUpdatesFlow,
|
||||
triggersHolder
|
||||
)
|
||||
|
||||
fun copy(
|
||||
bot: TelegramBot = this.bot,
|
||||
scope: CoroutineScope = this.scope,
|
||||
broadcastChannelsSize: Int = 100,
|
||||
onBufferOverflow: BufferOverflow = BufferOverflow.SUSPEND,
|
||||
upstreamUpdatesFlow: Flow<Update>? = null,
|
||||
triggersHolder: TriggersHolder = this.triggersHolder,
|
||||
onStateHandlingErrorHandler: StateHandlingErrorHandler<T> = defaultStateHandlingErrorHandler(),
|
||||
updatesFilter: BehaviourContextAndTypeReceiver<Boolean, Update>? = null
|
||||
): BehaviourContextWithFSM<T> = copy(
|
||||
bot,
|
||||
scope,
|
||||
broadcastChannelsSize,
|
||||
onBufferOverflow,
|
||||
upstreamUpdatesFlow,
|
||||
triggersHolder,
|
||||
onStateHandlingErrorHandler
|
||||
)
|
||||
): BehaviourContextWithFSM<T>
|
||||
|
||||
companion object {
|
||||
operator fun <T : State> invoke(
|
||||
@@ -94,8 +77,11 @@ interface BehaviourContextWithFSM<T : State> : BehaviourContext, StatesMachine<T
|
||||
handlers: List<BehaviourWithFSMStateHandlerHolder<*, T>>,
|
||||
statesManager: StatesManager<T>,
|
||||
fallbackHandler: BehaviourWithFSMStateHandlerHolder<T, T>? = null,
|
||||
stateInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContextWithFSM<T>, Unit, T> = {},
|
||||
onStateHandlingErrorHandler: StateHandlingErrorHandler<T> = defaultStateHandlingErrorHandler()
|
||||
) = DefaultBehaviourContextWithFSM<T>(behaviourContext, statesManager, handlers, fallbackHandler, onStateHandlingErrorHandler)
|
||||
) = DefaultBehaviourContextWithFSM<T>(behaviourContext, statesManager, handlers, fallbackHandler, stateInitialAction, onStateHandlingErrorHandler)
|
||||
|
||||
val DATA_FSM_KEY = "ktgbotapi_fsm"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -131,6 +117,7 @@ class DefaultBehaviourContextWithFSM<T : State>(
|
||||
private val statesManager: StatesManager<T>,
|
||||
private val handlers: List<BehaviourWithFSMStateHandlerHolder<*, T>>,
|
||||
private val fallbackHandler: BehaviourWithFSMStateHandlerHolder<T, T>? = null,
|
||||
override val stateInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContextWithFSM<T>, Unit, T> = {},
|
||||
private val onStateHandlingErrorHandler: StateHandlingErrorHandler<T> = defaultStateHandlingErrorHandler()
|
||||
) : BehaviourContext by behaviourContext, BehaviourContextWithFSM<T> {
|
||||
private val updatesFlows = mutableMapOf<Any, DefaultBehaviourContextWithFSM<T>>()
|
||||
@@ -140,6 +127,10 @@ class DefaultBehaviourContextWithFSM<T : State>(
|
||||
protected val statesJobs = mutableMapOf<T, Job>()
|
||||
protected val statesJobsMutex = Mutex()
|
||||
|
||||
init {
|
||||
data[DATA_FSM_KEY] = this
|
||||
}
|
||||
|
||||
override suspend fun launchStateHandling(state: T, handlers: List<CheckableHandlerHolder<in T, T>>): T? {
|
||||
return launchStateHandling(state, handlers, onStateHandlingErrorHandler)
|
||||
}
|
||||
@@ -151,10 +142,14 @@ class DefaultBehaviourContextWithFSM<T : State>(
|
||||
override suspend fun StatesMachine<in T>.handleState(state: T): T? {
|
||||
return getSubContext(
|
||||
state.context
|
||||
).launchStateHandling(
|
||||
state,
|
||||
actualHandlersList
|
||||
)
|
||||
).apply {
|
||||
stateInitialAction(state)
|
||||
}.run {
|
||||
launchStateHandling(
|
||||
state,
|
||||
actualHandlersList
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
override fun <I : T> add(kClass: KClass<I>, strict: Boolean, handler: BehaviourWithFSMStateHandler<I, T>) {
|
||||
@@ -195,7 +190,7 @@ class DefaultBehaviourContextWithFSM<T : State>(
|
||||
statesJobsMutex.withLock {
|
||||
runCatchingSafely { statesJobs.remove(it) ?.cancel() }
|
||||
}
|
||||
updatesFlows.remove(it.context)
|
||||
updatesFlows.remove(it.context) ?.cancel()
|
||||
}
|
||||
statesManager.onChainStateUpdated.subscribeSafelyWithoutExceptions(this) { (old, new) ->
|
||||
statesJobsMutex.withLock {
|
||||
@@ -204,7 +199,7 @@ class DefaultBehaviourContextWithFSM<T : State>(
|
||||
statesJobs[new] = launch { statePerformer(new) }.apply { enableRemoveOnCompletion(new) }
|
||||
}
|
||||
if (old.context != new.context) {
|
||||
updatesFlows.remove(old.context)
|
||||
updatesFlows.remove(old.context) ?.cancel()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -247,13 +242,23 @@ class DefaultBehaviourContextWithFSM<T : State>(
|
||||
broadcastChannelsSize: Int,
|
||||
onBufferOverflow: BufferOverflow,
|
||||
upstreamUpdatesFlow: Flow<Update>?,
|
||||
triggersHolder: TriggersHolder
|
||||
triggersHolder: TriggersHolder,
|
||||
subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update>
|
||||
): DefaultBehaviourContextWithFSM<T> = BehaviourContextWithFSM(
|
||||
behaviourContext.copy(bot, scope, broadcastChannelsSize, onBufferOverflow, upstreamUpdatesFlow, triggersHolder),
|
||||
handlers,
|
||||
statesManager,
|
||||
fallbackHandler,
|
||||
onStateHandlingErrorHandler
|
||||
behaviourContext = behaviourContext.copy(
|
||||
bot = bot,
|
||||
scope = scope,
|
||||
broadcastChannelsSize = broadcastChannelsSize,
|
||||
onBufferOverflow = onBufferOverflow,
|
||||
upstreamUpdatesFlow = upstreamUpdatesFlow,
|
||||
subcontextInitialAction = subcontextInitialAction,
|
||||
triggersHolder = triggersHolder
|
||||
),
|
||||
handlers = handlers,
|
||||
statesManager = statesManager,
|
||||
fallbackHandler = fallbackHandler,
|
||||
onStateHandlingErrorHandler = onStateHandlingErrorHandler,
|
||||
stateInitialAction = stateInitialAction
|
||||
)
|
||||
|
||||
override fun copy(
|
||||
@@ -262,13 +267,40 @@ class DefaultBehaviourContextWithFSM<T : State>(
|
||||
broadcastChannelsSize: Int,
|
||||
onBufferOverflow: BufferOverflow,
|
||||
upstreamUpdatesFlow: Flow<Update>?,
|
||||
subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update>,
|
||||
triggersHolder: TriggersHolder,
|
||||
stateInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContextWithFSM<T>, Unit, T>,
|
||||
onStateHandlingErrorHandler: StateHandlingErrorHandler<T>
|
||||
): DefaultBehaviourContextWithFSM<T> = BehaviourContextWithFSM(
|
||||
behaviourContext.copy(bot, scope, broadcastChannelsSize, onBufferOverflow, upstreamUpdatesFlow, triggersHolder),
|
||||
handlers,
|
||||
statesManager,
|
||||
fallbackHandler,
|
||||
onStateHandlingErrorHandler
|
||||
): BehaviourContextWithFSM<T> = BehaviourContextWithFSM(
|
||||
behaviourContext = behaviourContext.copy(
|
||||
bot = bot,
|
||||
scope = scope,
|
||||
broadcastChannelsSize = broadcastChannelsSize,
|
||||
onBufferOverflow = onBufferOverflow,
|
||||
upstreamUpdatesFlow = upstreamUpdatesFlow,
|
||||
subcontextInitialAction = subcontextInitialAction,
|
||||
triggersHolder = triggersHolder
|
||||
),
|
||||
handlers = handlers,
|
||||
statesManager = statesManager,
|
||||
fallbackHandler = fallbackHandler,
|
||||
stateInitialAction = stateInitialAction,
|
||||
onStateHandlingErrorHandler = onStateHandlingErrorHandler
|
||||
)
|
||||
|
||||
fun fsm() = this
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
fun <T : State> BehaviourContext.fsmOrNull(): StatesMachine<T>? = data[DATA_FSM_KEY] as? StatesMachine<T>
|
||||
|
||||
/**
|
||||
* Extracting from [BehaviourContext.data] exists [StatesMachine] by key [DATA_FSM_KEY], which usually some [BehaviourContextWithFSM].
|
||||
* In case if value absent in [BehaviourContext.data] will throw [NullPointerException]
|
||||
*
|
||||
* @throws NullPointerException
|
||||
*/
|
||||
fun <T : State> BehaviourContext.fsmOrThrow(): StatesMachine<T> = fsmOrNull<T>()!!
|
||||
|
||||
@@ -33,17 +33,21 @@ suspend fun <T : State> TelegramBot.buildBehaviourWithFSM(
|
||||
presetHandlers: List<BehaviourWithFSMStateHandlerHolder<*, T>> = listOf(),
|
||||
fallbackHandler: BehaviourWithFSMStateHandlerHolder<T, T>? = null,
|
||||
onStateHandlingErrorHandler: StateHandlingErrorHandler<T> = defaultStateHandlingErrorHandler(),
|
||||
subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {},
|
||||
stateInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContextWithFSM<T>, Unit, T> = {},
|
||||
block: CustomBehaviourContextReceiver<DefaultBehaviourContextWithFSM<T>, Unit>
|
||||
): DefaultBehaviourContextWithFSM<T> = BehaviourContextWithFSM(
|
||||
DefaultBehaviourContext(
|
||||
this,
|
||||
defaultExceptionsHandler ?.let { scope + ContextSafelyExceptionHandler(it) } ?: scope,
|
||||
upstreamUpdatesFlow = upstreamUpdatesFlow
|
||||
behaviourContext = DefaultBehaviourContext(
|
||||
bot = this,
|
||||
scope = defaultExceptionsHandler ?.let { scope + ContextSafelyExceptionHandler(it) } ?: scope,
|
||||
upstreamUpdatesFlow = upstreamUpdatesFlow,
|
||||
subcontextInitialAction = subcontextInitialAction
|
||||
),
|
||||
presetHandlers,
|
||||
statesManager,
|
||||
fallbackHandler,
|
||||
onStateHandlingErrorHandler
|
||||
handlers = presetHandlers,
|
||||
statesManager = statesManager,
|
||||
fallbackHandler = fallbackHandler,
|
||||
stateInitialAction = stateInitialAction,
|
||||
onStateHandlingErrorHandler = onStateHandlingErrorHandler
|
||||
).apply { block() }
|
||||
|
||||
/**
|
||||
@@ -67,16 +71,20 @@ suspend fun <T : State> TelegramBot.buildBehaviourWithFSMAndStartLongPolling(
|
||||
autoDisableWebhooks: Boolean = true,
|
||||
autoSkipTimeoutExceptions: Boolean = true,
|
||||
mediaGroupsDebounceTimeMillis: Long? = 1000L,
|
||||
subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {},
|
||||
stateInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContextWithFSM<T>, Unit, T> = {},
|
||||
block: CustomBehaviourContextReceiver<DefaultBehaviourContextWithFSM<T>, Unit>
|
||||
): Pair<DefaultBehaviourContextWithFSM<T>, Job> = buildBehaviourWithFSM(
|
||||
upstreamUpdatesFlow,
|
||||
scope,
|
||||
defaultExceptionsHandler,
|
||||
statesManager,
|
||||
presetHandlers,
|
||||
fallbackHandler,
|
||||
onStateHandlingErrorHandler,
|
||||
block
|
||||
upstreamUpdatesFlow = upstreamUpdatesFlow,
|
||||
scope = scope,
|
||||
defaultExceptionsHandler = defaultExceptionsHandler,
|
||||
statesManager = statesManager,
|
||||
presetHandlers = presetHandlers,
|
||||
fallbackHandler = fallbackHandler,
|
||||
onStateHandlingErrorHandler = onStateHandlingErrorHandler,
|
||||
subcontextInitialAction = subcontextInitialAction,
|
||||
stateInitialAction = stateInitialAction,
|
||||
block = block
|
||||
).run {
|
||||
this to scope.launch {
|
||||
start()
|
||||
@@ -110,16 +118,20 @@ suspend fun <T : State> TelegramBot.buildBehaviourWithFSM(
|
||||
presetHandlers: List<BehaviourWithFSMStateHandlerHolder<*, T>> = listOf(),
|
||||
fallbackHandler: BehaviourWithFSMStateHandlerHolder<T, T>? = null,
|
||||
onStateHandlingErrorHandler: StateHandlingErrorHandler<T> = defaultStateHandlingErrorHandler(),
|
||||
subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {},
|
||||
stateInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContextWithFSM<T>, Unit, T> = {},
|
||||
block: CustomBehaviourContextReceiver<DefaultBehaviourContextWithFSM<T>, Unit>
|
||||
): DefaultBehaviourContextWithFSM<T> = BehaviourContextWithFSM(
|
||||
DefaultBehaviourContext(
|
||||
this,
|
||||
defaultExceptionsHandler ?.let { scope + ContextSafelyExceptionHandler(it) } ?: scope,
|
||||
upstreamUpdatesFlow = flowUpdatesFilter.allUpdatesFlow
|
||||
upstreamUpdatesFlow = flowUpdatesFilter.allUpdatesFlow,
|
||||
subcontextInitialAction = subcontextInitialAction
|
||||
),
|
||||
presetHandlers,
|
||||
statesManager,
|
||||
fallbackHandler,
|
||||
stateInitialAction,
|
||||
onStateHandlingErrorHandler
|
||||
).apply { block() }
|
||||
|
||||
@@ -149,27 +161,31 @@ suspend fun <T : State> TelegramBot.buildBehaviourWithFSMAndStartLongPolling(
|
||||
autoDisableWebhooks: Boolean = true,
|
||||
autoSkipTimeoutExceptions: Boolean = true,
|
||||
mediaGroupsDebounceTimeMillis: Long? = 1000L,
|
||||
subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {},
|
||||
stateInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContextWithFSM<T>, Unit, T> = {},
|
||||
block: CustomBehaviourContextReceiver<DefaultBehaviourContextWithFSM<T>, Unit>
|
||||
) = FlowsUpdatesFilter().let {
|
||||
buildBehaviourWithFSM(
|
||||
it,
|
||||
scope,
|
||||
defaultExceptionsHandler,
|
||||
statesManager,
|
||||
presetHandlers,
|
||||
fallbackHandler,
|
||||
onStateHandlingErrorHandler,
|
||||
block
|
||||
flowUpdatesFilter = it,
|
||||
scope = scope,
|
||||
defaultExceptionsHandler = defaultExceptionsHandler,
|
||||
statesManager = statesManager,
|
||||
presetHandlers = presetHandlers,
|
||||
fallbackHandler = fallbackHandler,
|
||||
onStateHandlingErrorHandler = onStateHandlingErrorHandler,
|
||||
subcontextInitialAction = subcontextInitialAction,
|
||||
stateInitialAction = stateInitialAction,
|
||||
block = block
|
||||
).run {
|
||||
start()
|
||||
longPolling(
|
||||
flowsUpdatesFilter,
|
||||
timeoutSeconds,
|
||||
scope,
|
||||
autoDisableWebhooks,
|
||||
autoSkipTimeoutExceptions,
|
||||
mediaGroupsDebounceTimeMillis,
|
||||
defaultExceptionsHandler
|
||||
updatesFilter = flowsUpdatesFilter,
|
||||
timeoutSeconds = timeoutSeconds,
|
||||
scope = scope,
|
||||
autoDisableWebhooks = autoDisableWebhooks,
|
||||
autoSkipTimeoutExceptions = autoSkipTimeoutExceptions,
|
||||
mediaGroupsDebounceTimeMillis = mediaGroupsDebounceTimeMillis,
|
||||
exceptionsHandler = defaultExceptionsHandler
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.extensions.utils.updates.retrieving.startGettingOfUpdatesByLongPolling
|
||||
import dev.inmo.tgbotapi.extensions.utils.updates.retrieving.updateHandlerWithMediaGroupsAdaptation
|
||||
import dev.inmo.tgbotapi.types.Seconds
|
||||
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
||||
import dev.inmo.tgbotapi.updateshandlers.FlowsUpdatesFilter
|
||||
import dev.inmo.tgbotapi.utils.telegramBotAPIDefaultUrl
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
@@ -53,6 +54,8 @@ suspend fun <T : State> telegramBotWithBehaviourAndFSM(
|
||||
autoDisableWebhooks: Boolean = true,
|
||||
autoSkipTimeoutExceptions: Boolean = true,
|
||||
mediaGroupsDebounceTimeMillis: Long? = 1000L,
|
||||
subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {},
|
||||
stateInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContextWithFSM<T>, Unit, T> = {},
|
||||
block: CustomBehaviourContextReceiver<DefaultBehaviourContextWithFSM<T>, Unit>
|
||||
): TelegramBot = telegramBot(
|
||||
token,
|
||||
@@ -61,18 +64,20 @@ suspend fun <T : State> telegramBotWithBehaviourAndFSM(
|
||||
builder
|
||||
).apply {
|
||||
buildBehaviourWithFSMAndStartLongPolling(
|
||||
flowsUpdatesFilter.allUpdatesFlow,
|
||||
scope ?: CoroutineScope(coroutineContext),
|
||||
defaultExceptionsHandler,
|
||||
statesManager,
|
||||
presetHandlers,
|
||||
fallbackHandler,
|
||||
onStateHandlingErrorHandler,
|
||||
timeoutSeconds,
|
||||
autoDisableWebhooks,
|
||||
autoSkipTimeoutExceptions,
|
||||
mediaGroupsDebounceTimeMillis,
|
||||
block
|
||||
upstreamUpdatesFlow = flowsUpdatesFilter.allUpdatesFlow,
|
||||
scope = scope ?: CoroutineScope(coroutineContext),
|
||||
defaultExceptionsHandler = defaultExceptionsHandler,
|
||||
statesManager = statesManager,
|
||||
presetHandlers = presetHandlers,
|
||||
fallbackHandler = fallbackHandler,
|
||||
onStateHandlingErrorHandler = onStateHandlingErrorHandler,
|
||||
timeoutSeconds = timeoutSeconds,
|
||||
autoDisableWebhooks = autoDisableWebhooks,
|
||||
autoSkipTimeoutExceptions = autoSkipTimeoutExceptions,
|
||||
mediaGroupsDebounceTimeMillis = mediaGroupsDebounceTimeMillis,
|
||||
subcontextInitialAction = subcontextInitialAction,
|
||||
stateInitialAction = stateInitialAction,
|
||||
block = block
|
||||
)
|
||||
}
|
||||
|
||||
@@ -106,6 +111,8 @@ suspend fun <T : State> telegramBotWithBehaviourAndFSMAndStartLongPolling(
|
||||
autoDisableWebhooks: Boolean = true,
|
||||
autoSkipTimeoutExceptions: Boolean = true,
|
||||
mediaGroupsDebounceTimeMillis: Long? = 1000L,
|
||||
subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {},
|
||||
stateInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContextWithFSM<T>, Unit, T> = {},
|
||||
block: CustomBehaviourContextReceiver<DefaultBehaviourContextWithFSM<T>, Unit>
|
||||
): Pair<TelegramBot, Job> {
|
||||
return telegramBot(
|
||||
@@ -115,17 +122,19 @@ suspend fun <T : State> telegramBotWithBehaviourAndFSMAndStartLongPolling(
|
||||
builder
|
||||
).let {
|
||||
it to it.buildBehaviourWithFSMAndStartLongPolling (
|
||||
scope ?: CoroutineScope(coroutineContext),
|
||||
defaultExceptionsHandler,
|
||||
statesManager,
|
||||
presetHandlers,
|
||||
fallbackHandler,
|
||||
onStateHandlingErrorHandler,
|
||||
timeoutSeconds,
|
||||
autoDisableWebhooks,
|
||||
autoSkipTimeoutExceptions,
|
||||
mediaGroupsDebounceTimeMillis,
|
||||
block
|
||||
scope = scope ?: CoroutineScope(coroutineContext),
|
||||
defaultExceptionsHandler = defaultExceptionsHandler,
|
||||
statesManager = statesManager,
|
||||
presetHandlers = presetHandlers,
|
||||
fallbackHandler = fallbackHandler,
|
||||
onStateHandlingErrorHandler = onStateHandlingErrorHandler,
|
||||
timeoutSeconds = timeoutSeconds,
|
||||
autoDisableWebhooks = autoDisableWebhooks,
|
||||
autoSkipTimeoutExceptions = autoSkipTimeoutExceptions,
|
||||
mediaGroupsDebounceTimeMillis = mediaGroupsDebounceTimeMillis,
|
||||
subcontextInitialAction = subcontextInitialAction,
|
||||
stateInitialAction = stateInitialAction,
|
||||
block = block
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,16 +1,14 @@
|
||||
package dev.inmo.tgbotapi.extensions.behaviour_builder
|
||||
|
||||
import dev.inmo.kslog.common.e
|
||||
import dev.inmo.micro_utils.coroutines.ContextSafelyExceptionHandler
|
||||
import dev.inmo.micro_utils.coroutines.ExceptionHandler
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.extensions.DefaultKTgBotAPIPrivacyCommand
|
||||
import dev.inmo.tgbotapi.extensions.utils.updates.retrieving.longPolling
|
||||
import dev.inmo.tgbotapi.extensions.utils.updates.retrieving.startGettingOfUpdatesByLongPolling
|
||||
import dev.inmo.tgbotapi.extensions.utils.updates.retrieving.updateHandlerWithMediaGroupsAdaptation
|
||||
import dev.inmo.tgbotapi.types.Seconds
|
||||
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
||||
import dev.inmo.tgbotapi.updateshandlers.FlowsUpdatesFilter
|
||||
import dev.inmo.tgbotapi.utils.DefaultKTgBotAPIKSLog
|
||||
import kotlinx.coroutines.*
|
||||
|
||||
/**
|
||||
@@ -32,17 +30,19 @@ suspend fun TelegramBot.buildBehaviour(
|
||||
flowUpdatesFilter: FlowsUpdatesFilter = FlowsUpdatesFilter(),
|
||||
scope: CoroutineScope = defaultCoroutineScopeProvider(),
|
||||
defaultExceptionsHandler: ExceptionHandler<Unit>? = null,
|
||||
subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {},
|
||||
block: BehaviourContextReceiver<Unit>
|
||||
): BehaviourContext = BehaviourContext(
|
||||
this,
|
||||
scope.let {
|
||||
if (defaultExceptionsHandler == null) {
|
||||
it
|
||||
} else {
|
||||
it + ContextSafelyExceptionHandler(defaultExceptionsHandler)
|
||||
}
|
||||
bot = this,
|
||||
scope = scope.let {
|
||||
if (defaultExceptionsHandler == null) {
|
||||
it
|
||||
} else {
|
||||
it + ContextSafelyExceptionHandler(defaultExceptionsHandler)
|
||||
}
|
||||
},
|
||||
flowUpdatesFilter
|
||||
flowsUpdatesFilter = flowUpdatesFilter,
|
||||
subcontextInitialAction = subcontextInitialAction
|
||||
).apply {
|
||||
block()
|
||||
}
|
||||
@@ -66,11 +66,13 @@ suspend fun TelegramBot.buildBehaviourWithLongPolling(
|
||||
autoDisableWebhooks: Boolean = true,
|
||||
autoSkipTimeoutExceptions: Boolean = true,
|
||||
mediaGroupsDebounceTimeMillis: Long? = 1000L,
|
||||
subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {},
|
||||
block: BehaviourContextReceiver<Unit>
|
||||
): Job {
|
||||
val behaviourContext = buildBehaviour(
|
||||
scope = scope,
|
||||
defaultExceptionsHandler = defaultExceptionsHandler,
|
||||
subcontextInitialAction = subcontextInitialAction,
|
||||
block = block
|
||||
)
|
||||
return longPolling(
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
package dev.inmo.tgbotapi.extensions.behaviour_builder
|
||||
|
||||
import dev.inmo.kslog.common.KSLog
|
||||
import dev.inmo.micro_utils.coroutines.*
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.handlers_registrar.TriggersHolder
|
||||
@@ -52,13 +53,24 @@ interface BehaviourContext : FlowsUpdatesFilter, TelegramBot, CoroutineScope {
|
||||
|
||||
val triggersHolder: TriggersHolder
|
||||
|
||||
/**
|
||||
* Data filled by [subcontextInitialAction] or in any other way
|
||||
*/
|
||||
val data: BehaviourContextData
|
||||
|
||||
/**
|
||||
* Will be called on any initial subcontext action before some consumer will be called
|
||||
*/
|
||||
val subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update>
|
||||
|
||||
fun copy(
|
||||
bot: TelegramBot = this.bot,
|
||||
scope: CoroutineScope = this.scope,
|
||||
broadcastChannelsSize: Int = 100,
|
||||
onBufferOverflow: BufferOverflow = BufferOverflow.SUSPEND,
|
||||
upstreamUpdatesFlow: Flow<Update>? = null,
|
||||
triggersHolder: TriggersHolder = TriggersHolder()
|
||||
triggersHolder: TriggersHolder = TriggersHolder(),
|
||||
subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = this.subcontextInitialAction
|
||||
): BehaviourContext
|
||||
}
|
||||
|
||||
@@ -68,7 +80,8 @@ class DefaultBehaviourContext(
|
||||
broadcastChannelsSize: Int = 100,
|
||||
onBufferOverflow: BufferOverflow = BufferOverflow.SUSPEND,
|
||||
private val upstreamUpdatesFlow: Flow<Update>? = null,
|
||||
override val triggersHolder: TriggersHolder = TriggersHolder()
|
||||
override val triggersHolder: TriggersHolder = TriggersHolder(),
|
||||
override val subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {}
|
||||
) : AbstractFlowsUpdatesFilter(), TelegramBot by bot, CoroutineScope by scope, BehaviourContext {
|
||||
|
||||
private val additionalUpdatesSharedFlow = MutableSharedFlow<Update>(0, broadcastChannelsSize, onBufferOverflow)
|
||||
@@ -92,14 +105,27 @@ class DefaultBehaviourContext(
|
||||
}.accumulatorFlow(WeakScope(scope))
|
||||
override val asUpdateReceiver: UpdateReceiver<Update> = additionalUpdatesSharedFlow::emit
|
||||
|
||||
override val data: BehaviourContextData = BehaviourContextData()
|
||||
|
||||
override fun copy(
|
||||
bot: TelegramBot,
|
||||
scope: CoroutineScope,
|
||||
broadcastChannelsSize: Int,
|
||||
onBufferOverflow: BufferOverflow,
|
||||
upstreamUpdatesFlow: Flow<Update>?,
|
||||
triggersHolder: TriggersHolder
|
||||
): DefaultBehaviourContext = DefaultBehaviourContext(bot, scope, broadcastChannelsSize, onBufferOverflow, upstreamUpdatesFlow, triggersHolder)
|
||||
triggersHolder: TriggersHolder,
|
||||
subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update>
|
||||
): DefaultBehaviourContext = DefaultBehaviourContext(
|
||||
bot = bot,
|
||||
scope = scope,
|
||||
broadcastChannelsSize = broadcastChannelsSize,
|
||||
onBufferOverflow = onBufferOverflow,
|
||||
upstreamUpdatesFlow = upstreamUpdatesFlow,
|
||||
triggersHolder = triggersHolder,
|
||||
subcontextInitialAction = subcontextInitialAction
|
||||
).apply {
|
||||
data.include(this@DefaultBehaviourContext.data)
|
||||
}
|
||||
}
|
||||
|
||||
fun BehaviourContext(
|
||||
@@ -107,15 +133,17 @@ fun BehaviourContext(
|
||||
scope: CoroutineScope,
|
||||
flowsUpdatesFilter: FlowsUpdatesFilter = FlowsUpdatesFilter(),
|
||||
triggersHolder: TriggersHolder = TriggersHolder(),
|
||||
) = DefaultBehaviourContext(bot, scope, upstreamUpdatesFlow = flowsUpdatesFilter.allUpdatesFlow, triggersHolder = triggersHolder)
|
||||
subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {}
|
||||
) = DefaultBehaviourContext(bot, scope, upstreamUpdatesFlow = flowsUpdatesFilter.allUpdatesFlow, triggersHolder = triggersHolder, subcontextInitialAction = subcontextInitialAction)
|
||||
|
||||
inline fun <T> BehaviourContext(
|
||||
bot: TelegramBot,
|
||||
scope: CoroutineScope,
|
||||
flowsUpdatesFilter: FlowsUpdatesFilter = FlowsUpdatesFilter(),
|
||||
triggersHolder: TriggersHolder = TriggersHolder(),
|
||||
noinline subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {},
|
||||
crossinline block: BehaviourContext.() -> T
|
||||
) = DefaultBehaviourContext(bot, scope, upstreamUpdatesFlow = flowsUpdatesFilter.allUpdatesFlow, triggersHolder = triggersHolder).run(block)
|
||||
) = DefaultBehaviourContext(bot, scope, upstreamUpdatesFlow = flowsUpdatesFilter.allUpdatesFlow, triggersHolder = triggersHolder, subcontextInitialAction = subcontextInitialAction).run(block)
|
||||
|
||||
/**
|
||||
* Creates new [BehaviourContext] using its [BehaviourContext.copy] method
|
||||
@@ -126,10 +154,14 @@ fun <BC : BehaviourContext> BC.createSubContext(
|
||||
scope: CoroutineScope = LinkedSupervisorScope(),
|
||||
triggersHolder: TriggersHolder = this.triggersHolder,
|
||||
updatesUpstreamFlow: Flow<Update> = allUpdatesFlow,
|
||||
subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BC, Unit, Update> = this.subcontextInitialAction,
|
||||
) = copy(
|
||||
scope = scope,
|
||||
upstreamUpdatesFlow = updatesUpstreamFlow,
|
||||
triggersHolder = triggersHolder
|
||||
triggersHolder = triggersHolder,
|
||||
subcontextInitialAction = {
|
||||
(this as BC).subcontextInitialAction(it)
|
||||
}
|
||||
) as BC
|
||||
|
||||
/**
|
||||
@@ -145,6 +177,52 @@ suspend fun <T, BC : BehaviourContext> BC.doInContext(
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Launch [behaviourContextReceiver] in context of [this] as [BehaviourContext] and as [kotlin.coroutines.CoroutineContext]
|
||||
*
|
||||
* [this] [BehaviourContext] will **NOT** be closed automatically
|
||||
*/
|
||||
suspend fun <T, BC : BehaviourContext> BC.doInNewSubContext(
|
||||
scope: CoroutineScope = LinkedSupervisorScope(),
|
||||
triggersHolder: TriggersHolder = this.triggersHolder,
|
||||
updatesUpstreamFlow: Flow<Update> = allUpdatesFlow,
|
||||
subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BC, Unit, Update> = this.subcontextInitialAction,
|
||||
behaviourContextReceiver: CustomBehaviourContextReceiver<BC, T>
|
||||
): T {
|
||||
return createSubContext(
|
||||
scope = scope,
|
||||
triggersHolder = triggersHolder,
|
||||
updatesUpstreamFlow = updatesUpstreamFlow,
|
||||
subcontextInitialAction = subcontextInitialAction
|
||||
).run {
|
||||
behaviourContextReceiver()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Launch [behaviourContextReceiver] in context of [this] as [BehaviourContext] and as [kotlin.coroutines.CoroutineContext]
|
||||
*
|
||||
* [this] [BehaviourContext] will **NOT** be closed automatically
|
||||
*/
|
||||
fun <T, BC : BehaviourContext> BC.launchInNewSubContext(
|
||||
scope: CoroutineScope = LinkedSupervisorScope(),
|
||||
triggersHolder: TriggersHolder = this.triggersHolder,
|
||||
updatesUpstreamFlow: Flow<Update> = allUpdatesFlow,
|
||||
subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BC, Unit, Update> = this.subcontextInitialAction,
|
||||
behaviourContextReceiver: CustomBehaviourContextReceiver<BC, T>
|
||||
): Job {
|
||||
return createSubContext(
|
||||
scope = scope,
|
||||
triggersHolder = triggersHolder,
|
||||
updatesUpstreamFlow = updatesUpstreamFlow,
|
||||
subcontextInitialAction = subcontextInitialAction
|
||||
).apply {
|
||||
this@apply.launchLoggingDropExceptions(logger = Log) {
|
||||
behaviourContextReceiver()
|
||||
}
|
||||
}.coroutineContext.job
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new one [BehaviourContext] using [createSubContext] and launches [behaviourContextReceiver] in a new context
|
||||
* using [doInContext].
|
||||
@@ -155,13 +233,19 @@ suspend fun <T, BC : BehaviourContext> BC.doInContext(
|
||||
suspend fun <T, BC : BehaviourContext> BC.createSubContextAndDoSynchronouslyWithUpdatesFilter(
|
||||
triggersHolder: TriggersHolder = this.triggersHolder,
|
||||
updatesUpstreamFlow: Flow<Update> = allUpdatesFlow,
|
||||
additionalSubcontextInitialAction: (CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update>)? = null,
|
||||
behaviourContextReceiver: CustomBehaviourContextReceiver<BC, T>
|
||||
): T {
|
||||
return supervisorScope {
|
||||
createSubContext(
|
||||
scope = this@supervisorScope,
|
||||
triggersHolder = triggersHolder,
|
||||
updatesUpstreamFlow = updatesUpstreamFlow
|
||||
updatesUpstreamFlow = updatesUpstreamFlow,
|
||||
subcontextInitialAction = if (additionalSubcontextInitialAction == null) {
|
||||
subcontextInitialAction
|
||||
} else {
|
||||
{ subcontextInitialAction(it); additionalSubcontextInitialAction(it) }
|
||||
}
|
||||
).behaviourContextReceiver()
|
||||
}
|
||||
}
|
||||
@@ -175,15 +259,17 @@ suspend fun <T, BC : BehaviourContext> BC.createSubContextAndDoAsynchronouslyWit
|
||||
updatesUpstreamFlow: Flow<Update> = allUpdatesFlow,
|
||||
context: CoroutineContext = EmptyCoroutineContext,
|
||||
start: CoroutineStart = CoroutineStart.DEFAULT,
|
||||
additionalSubcontextInitialAction: (CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update>)? = null,
|
||||
behaviourContextReceiver: CustomBehaviourContextReceiver<BC, T>
|
||||
): Deferred<T> = async(
|
||||
context,
|
||||
start
|
||||
) {
|
||||
createSubContextAndDoSynchronouslyWithUpdatesFilter(
|
||||
triggersHolder,
|
||||
updatesUpstreamFlow,
|
||||
behaviourContextReceiver
|
||||
triggersHolder = triggersHolder,
|
||||
updatesUpstreamFlow = updatesUpstreamFlow,
|
||||
additionalSubcontextInitialAction = additionalSubcontextInitialAction,
|
||||
behaviourContextReceiver = behaviourContextReceiver
|
||||
)
|
||||
}
|
||||
|
||||
@@ -202,8 +288,14 @@ suspend fun <T, BC : BehaviourContext> BC.createSubContextAndDoAsynchronouslyWit
|
||||
suspend fun <T, BC : BehaviourContext> BC.createSubContextAndDoWithUpdatesFilter(
|
||||
triggersHolder: TriggersHolder = this.triggersHolder,
|
||||
updatesUpstreamFlow: Flow<Update> = allUpdatesFlow,
|
||||
additionalSubcontextInitialAction: (CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update>)? = null,
|
||||
behaviourContextReceiver: CustomBehaviourContextReceiver<BC, T>
|
||||
): Deferred<T> = createSubContextAndDoAsynchronouslyWithUpdatesFilter(triggersHolder, updatesUpstreamFlow, behaviourContextReceiver = behaviourContextReceiver)
|
||||
): Deferred<T> = createSubContextAndDoAsynchronouslyWithUpdatesFilter(
|
||||
triggersHolder = triggersHolder,
|
||||
updatesUpstreamFlow = updatesUpstreamFlow,
|
||||
additionalSubcontextInitialAction = additionalSubcontextInitialAction,
|
||||
behaviourContextReceiver = behaviourContextReceiver
|
||||
)
|
||||
|
||||
/**
|
||||
* This method will cancel ALL subsequent contexts, expectations and waiters
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
package dev.inmo.tgbotapi.extensions.behaviour_builder
|
||||
|
||||
data class BehaviourContextData(
|
||||
private val data: MutableMap<String, Any?> = mutableMapOf()
|
||||
) : MutableMap<String, Any?> by data {
|
||||
fun mergedWith(other: BehaviourContextData): BehaviourContextData = BehaviourContextData(
|
||||
data.toMutableMap().apply {
|
||||
putAll(other.data)
|
||||
}
|
||||
)
|
||||
|
||||
fun include(other: BehaviourContextData) {
|
||||
data.putAll(other.data)
|
||||
}
|
||||
|
||||
operator fun plus(other: BehaviourContextData): BehaviourContextData = mergedWith(other)
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
package dev.inmo.tgbotapi.extensions.behaviour_builder
|
||||
|
||||
import dev.inmo.kslog.common.KSLog
|
||||
import dev.inmo.kslog.common.error
|
||||
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
||||
|
||||
/**
|
||||
* Contains [SubAction]s which will be used in [subcontextInitialAction] in order they has been passed in [subactions].
|
||||
*
|
||||
* Its [subcontextInitialAction] will iterate over incoming [subactions] until all will be completed successfully OR
|
||||
* none will be successful during round of running:
|
||||
*
|
||||
* * Run all
|
||||
* * Exclude from current running successful items
|
||||
* * Do again if there are some items to run
|
||||
*/
|
||||
class CombinedSubcontextInitialAction(
|
||||
val subactions: List<SubAction>,
|
||||
private val logger: KSLog = KSLog("CombinedSubcontextInitialAction_${subactions.size}")
|
||||
) {
|
||||
/**
|
||||
* Represents interface-like variant of [CustomBehaviourContextAndTypeReceiver] useful for [BehaviourContext]
|
||||
* builders
|
||||
*/
|
||||
fun interface SubAction {
|
||||
suspend operator fun BehaviourContext.invoke(update: Update)
|
||||
|
||||
class Callback(private val action: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update>) : SubAction {
|
||||
override suspend fun BehaviourContext.invoke(update: Update) {
|
||||
action(update)
|
||||
}
|
||||
}
|
||||
}
|
||||
val subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = { update ->
|
||||
val leftSubActions = subactions.toMutableSet()
|
||||
val successSubActions = mutableSetOf<SubAction>()
|
||||
while (leftSubActions.isNotEmpty()) {
|
||||
leftSubActions.forEach { subaction ->
|
||||
with(subaction) {
|
||||
runCatching {
|
||||
invoke(update)
|
||||
}.onFailure {
|
||||
Log.error(it) {
|
||||
"Unable to execute $subaction for update $update. Will try on next round"
|
||||
}
|
||||
}.onSuccess {
|
||||
successSubActions.add(subaction)
|
||||
}
|
||||
}
|
||||
}
|
||||
leftSubActions.removeAll(successSubActions)
|
||||
if (successSubActions.isEmpty()) {
|
||||
Log.error {
|
||||
"Some SubActions have been unable to complete successfully:${leftSubActions.joinToString("\n") { it.toString() }}"
|
||||
}
|
||||
break
|
||||
}
|
||||
successSubActions.clear()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Build [CombinedSubcontextInitialAction] with [block] and return callback, which appropriate for [BehaviourContext]
|
||||
* builders with `subcontextInitialAction` argument
|
||||
*/
|
||||
inline fun buildSubcontextInitialActionWithSubActions(
|
||||
block: MutableList<CombinedSubcontextInitialAction.SubAction>.() -> Unit
|
||||
): CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> {
|
||||
val list = mutableListOf<CombinedSubcontextInitialAction.SubAction>()
|
||||
list.block()
|
||||
return CombinedSubcontextInitialAction(
|
||||
list.toList()
|
||||
).subcontextInitialAction
|
||||
}
|
||||
|
||||
/**
|
||||
* Build [CombinedSubcontextInitialAction] with [block] and return callback, which appropriate for [BehaviourContext]
|
||||
* builders with `subcontextInitialAction` argument
|
||||
*/
|
||||
inline fun buildSubcontextInitialAction(
|
||||
block: MutableList<CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update>>.() -> Unit
|
||||
): CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> {
|
||||
val list = mutableListOf<CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update>>()
|
||||
list.block()
|
||||
return CombinedSubcontextInitialAction(
|
||||
list.map {
|
||||
CombinedSubcontextInitialAction.SubAction.Callback(it)
|
||||
}
|
||||
).subcontextInitialAction
|
||||
}
|
||||
@@ -7,6 +7,7 @@ import dev.inmo.tgbotapi.bot.ktor.telegramBot
|
||||
import dev.inmo.tgbotapi.extensions.utils.updates.retrieving.startGettingOfUpdatesByLongPolling
|
||||
import dev.inmo.tgbotapi.extensions.utils.updates.retrieving.updateHandlerWithMediaGroupsAdaptation
|
||||
import dev.inmo.tgbotapi.types.Seconds
|
||||
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
||||
import dev.inmo.tgbotapi.updateshandlers.FlowsUpdatesFilter
|
||||
import dev.inmo.tgbotapi.utils.telegramBotAPIDefaultUrl
|
||||
import kotlinx.coroutines.*
|
||||
@@ -33,6 +34,7 @@ suspend fun telegramBotWithBehaviour(
|
||||
builder: KtorRequestsExecutorBuilder.() -> Unit = {},
|
||||
defaultExceptionsHandler: ExceptionHandler<Unit>? = null,
|
||||
testServer: Boolean = false,
|
||||
subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {},
|
||||
block: BehaviourContextReceiver<Unit>
|
||||
): TelegramBot = telegramBot(
|
||||
token,
|
||||
@@ -41,10 +43,11 @@ suspend fun telegramBotWithBehaviour(
|
||||
builder
|
||||
).apply {
|
||||
buildBehaviour(
|
||||
flowsUpdatesFilter,
|
||||
scope ?: CoroutineScope(coroutineContext),
|
||||
defaultExceptionsHandler,
|
||||
block
|
||||
flowUpdatesFilter = flowsUpdatesFilter,
|
||||
scope = scope ?: CoroutineScope(coroutineContext),
|
||||
defaultExceptionsHandler = defaultExceptionsHandler,
|
||||
subcontextInitialAction = subcontextInitialAction,
|
||||
block = block
|
||||
)
|
||||
}
|
||||
|
||||
@@ -76,6 +79,7 @@ suspend fun telegramBotWithBehaviourAndLongPolling(
|
||||
autoDisableWebhooks: Boolean = true,
|
||||
autoSkipTimeoutExceptions: Boolean = true,
|
||||
mediaGroupsDebounceTimeMillis: Long? = 1000L,
|
||||
subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {},
|
||||
block: BehaviourContextReceiver<Unit>
|
||||
): Pair<TelegramBot, Job> {
|
||||
return telegramBot(
|
||||
@@ -85,13 +89,14 @@ suspend fun telegramBotWithBehaviourAndLongPolling(
|
||||
builder
|
||||
).let {
|
||||
it to it.buildBehaviourWithLongPolling(
|
||||
scope ?: CoroutineScope(coroutineContext),
|
||||
defaultExceptionsHandler,
|
||||
timeoutSeconds,
|
||||
autoDisableWebhooks,
|
||||
autoSkipTimeoutExceptions,
|
||||
mediaGroupsDebounceTimeMillis,
|
||||
block
|
||||
scope = scope ?: CoroutineScope(coroutineContext),
|
||||
defaultExceptionsHandler = defaultExceptionsHandler,
|
||||
timeoutSeconds = timeoutSeconds,
|
||||
autoDisableWebhooks = autoDisableWebhooks,
|
||||
autoSkipTimeoutExceptions = autoSkipTimeoutExceptions,
|
||||
mediaGroupsDebounceTimeMillis = mediaGroupsDebounceTimeMillis,
|
||||
subcontextInitialAction = subcontextInitialAction,
|
||||
block = block
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ typealias NullableRequestBuilder<T> = suspend (Update) -> Request<T>?
|
||||
* will be called too), [errorFactory] and then will be returned null
|
||||
*/
|
||||
@RiskFeature(lowLevelRiskFeatureMessage)
|
||||
suspend fun <T> FlowsUpdatesFilter.expectFlow(
|
||||
fun <T> FlowsUpdatesFilter.expectFlow(
|
||||
bot: TelegramBot,
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null },
|
||||
@@ -58,12 +58,17 @@ suspend fun <T> FlowsUpdatesFilter.expectFlow(
|
||||
result.getOrThrow()
|
||||
}
|
||||
}.flatten()
|
||||
initRequest ?.also {
|
||||
runCatching {
|
||||
bot.execute(initRequest)
|
||||
|
||||
return if (initRequest == null) {
|
||||
flow
|
||||
} else {
|
||||
flow {
|
||||
runCatching {
|
||||
bot.execute(initRequest)
|
||||
}
|
||||
flow.collect(this)
|
||||
}
|
||||
}
|
||||
return flow
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -77,7 +82,7 @@ suspend fun <T> FlowsUpdatesFilter.expectFlow(
|
||||
* will be called too), [errorFactory] and then will be returned null
|
||||
*/
|
||||
@RiskFeature(lowLevelRiskFeatureMessage)
|
||||
suspend fun <T> BehaviourContext.expectFlow(
|
||||
fun <T> BehaviourContext.expectFlow(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null },
|
||||
cancelRequestFactory: NullableRequestBuilder<*> = { null },
|
||||
|
||||
@@ -10,7 +10,7 @@ import dev.inmo.tgbotapi.types.business_connection.BusinessConnection
|
||||
import dev.inmo.tgbotapi.types.payments.ShippingQuery
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
|
||||
suspend fun BehaviourContext.waitBusinessConnection(
|
||||
fun BehaviourContext.waitBusinessConnection(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
): Flow<BusinessConnection> = expectFlow(
|
||||
@@ -20,7 +20,7 @@ suspend fun BehaviourContext.waitBusinessConnection(
|
||||
(it.businessConnectionUpdateOrNull() ?.data).let(::listOfNotNull)
|
||||
}
|
||||
|
||||
suspend fun BehaviourContext.waitBusinessConnectionEnabled(
|
||||
fun BehaviourContext.waitBusinessConnectionEnabled(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
): Flow<BusinessConnection> = expectFlow(
|
||||
@@ -30,7 +30,7 @@ suspend fun BehaviourContext.waitBusinessConnectionEnabled(
|
||||
(it.businessConnectionUpdateOrNull() ?.data ?.enabledOrNull()).let(::listOfNotNull)
|
||||
}
|
||||
|
||||
suspend fun BehaviourContext.waitBusinessConnectionDisabled(
|
||||
fun BehaviourContext.waitBusinessConnectionDisabled(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
): Flow<BusinessConnection> = expectFlow(
|
||||
|
||||
@@ -13,7 +13,7 @@ import kotlinx.coroutines.flow.Flow
|
||||
typealias CallbackQueryMapper<T> = suspend T.() -> T?
|
||||
|
||||
@RiskFeature(lowLevelRiskFeatureMessage)
|
||||
suspend inline fun <reified O> BehaviourContext.waitCallbackQueries(
|
||||
inline fun <reified O> BehaviourContext.waitCallbackQueries(
|
||||
initRequest: Request<*>? = null,
|
||||
noinline errorFactory: NullableRequestBuilder<*> = { null }
|
||||
): Flow<O> = expectFlow(
|
||||
@@ -24,39 +24,39 @@ suspend inline fun <reified O> BehaviourContext.waitCallbackQueries(
|
||||
}
|
||||
|
||||
|
||||
suspend fun BehaviourContext.waitDataCallbackQuery(
|
||||
fun BehaviourContext.waitDataCallbackQuery(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitCallbackQueries<DataCallbackQuery>(initRequest, errorFactory)
|
||||
suspend fun BehaviourContext.waitGameShortNameCallbackQuery(
|
||||
fun BehaviourContext.waitGameShortNameCallbackQuery(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitCallbackQueries<GameShortNameCallbackQuery>(initRequest, errorFactory)
|
||||
suspend fun BehaviourContext.waitInlineMessageIdCallbackQuery(
|
||||
fun BehaviourContext.waitInlineMessageIdCallbackQuery(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitCallbackQueries<InlineMessageIdCallbackQuery>(initRequest, errorFactory)
|
||||
suspend fun BehaviourContext.waitInlineMessageIdDataCallbackQuery(
|
||||
fun BehaviourContext.waitInlineMessageIdDataCallbackQuery(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitCallbackQueries<InlineMessageIdDataCallbackQuery>(initRequest, errorFactory)
|
||||
suspend fun BehaviourContext.waitInlineMessageIdGameShortNameCallbackQuery(
|
||||
fun BehaviourContext.waitInlineMessageIdGameShortNameCallbackQuery(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitCallbackQueries<InlineMessageIdGameShortNameCallbackQuery>(initRequest, errorFactory)
|
||||
suspend fun BehaviourContext.waitMessageCallbackQuery(
|
||||
fun BehaviourContext.waitMessageCallbackQuery(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitCallbackQueries<MessageCallbackQuery>(initRequest, errorFactory)
|
||||
suspend fun BehaviourContext.waitMessageDataCallbackQuery(
|
||||
fun BehaviourContext.waitMessageDataCallbackQuery(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitCallbackQueries<MessageDataCallbackQuery>(initRequest, errorFactory)
|
||||
suspend fun BehaviourContext.waitMessageGameShortNameCallbackQuery(
|
||||
fun BehaviourContext.waitMessageGameShortNameCallbackQuery(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitCallbackQueries<MessageGameShortNameCallbackQuery>(initRequest, errorFactory)
|
||||
suspend fun BehaviourContext.waitUnknownCallbackQuery(
|
||||
fun BehaviourContext.waitUnknownCallbackQuery(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitCallbackQueries<UnknownCallbackQueryType>(initRequest, errorFactory)
|
||||
|
||||
@@ -6,7 +6,7 @@ import dev.inmo.tgbotapi.requests.abstracts.Request
|
||||
import dev.inmo.tgbotapi.types.boosts.ChatBoostRemoved
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
|
||||
suspend fun BehaviourContext.waitChatBoostRemoved(
|
||||
fun BehaviourContext.waitChatBoostRemoved(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
): Flow<ChatBoostRemoved> = expectFlow(
|
||||
|
||||
@@ -6,7 +6,7 @@ import dev.inmo.tgbotapi.requests.abstracts.Request
|
||||
import dev.inmo.tgbotapi.types.boosts.ChatBoostUpdated
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
|
||||
suspend fun BehaviourContext.waitChatBoostUpdated(
|
||||
fun BehaviourContext.waitChatBoostUpdated(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
): Flow<ChatBoostUpdated> = expectFlow(
|
||||
|
||||
@@ -11,7 +11,7 @@ import kotlinx.coroutines.flow.Flow
|
||||
typealias ChatJoinRequestsMapper = suspend ChatJoinRequest.() -> ChatJoinRequest?
|
||||
|
||||
@RiskFeature(lowLevelRiskFeatureMessage)
|
||||
suspend inline fun <reified O> BehaviourContext.internalWaitChatJoinRequests(
|
||||
inline fun <reified O> BehaviourContext.internalWaitChatJoinRequests(
|
||||
initRequest: Request<*>? = null,
|
||||
noinline errorFactory: NullableRequestBuilder<*> = { null }
|
||||
): Flow<O> = expectFlow(
|
||||
@@ -22,7 +22,7 @@ suspend inline fun <reified O> BehaviourContext.internalWaitChatJoinRequests(
|
||||
}
|
||||
|
||||
|
||||
suspend fun BehaviourContext.waitChatJoinRequests(
|
||||
fun BehaviourContext.waitChatJoinRequests(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) : Flow<ChatJoinRequest> = internalWaitChatJoinRequests(
|
||||
|
||||
@@ -21,7 +21,7 @@ import kotlinx.coroutines.flow.filter
|
||||
typealias ChatMemberUpdatedMapper<T> = suspend T.() -> T?
|
||||
|
||||
@RiskFeature(lowLevelRiskFeatureMessage)
|
||||
suspend inline fun <reified O : ChatMemberUpdatedUpdate> BehaviourContext.waitChatMemberUpdatedWithFilter(
|
||||
inline fun <reified O : ChatMemberUpdatedUpdate> BehaviourContext.waitChatMemberUpdatedWithFilter(
|
||||
initRequest: Request<*>? = null,
|
||||
noinline errorFactory: NullableRequestBuilder<*> = { null }
|
||||
): Flow<ChatMemberUpdated> = expectFlow(
|
||||
@@ -31,227 +31,227 @@ suspend inline fun <reified O : ChatMemberUpdatedUpdate> BehaviourContext.waitCh
|
||||
(it as? O) ?.data.let(::listOfNotNull)
|
||||
}
|
||||
|
||||
suspend fun BehaviourContext.waitChatMemberUpdated(
|
||||
fun BehaviourContext.waitChatMemberUpdated(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null },
|
||||
) = waitChatMemberUpdatedWithFilter<ChatMemberUpdatedUpdate>(initRequest, errorFactory)
|
||||
|
||||
suspend fun BehaviourContext.waitCommonChatMemberUpdated(
|
||||
fun BehaviourContext.waitCommonChatMemberUpdated(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null },
|
||||
) = waitChatMemberUpdatedWithFilter<CommonChatMemberUpdatedUpdate>(initRequest, errorFactory)
|
||||
|
||||
suspend fun BehaviourContext.waitMyChatMemberUpdated(
|
||||
fun BehaviourContext.waitMyChatMemberUpdated(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitChatMemberUpdatedWithFilter<MyChatMemberUpdatedUpdate>(initRequest, errorFactory)
|
||||
|
||||
suspend fun BehaviourContext.waitChatMemberJoined(
|
||||
fun BehaviourContext.waitChatMemberJoined(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitChatMemberUpdated(initRequest, errorFactory).filter { chatMemberJoinedFilter(it) };
|
||||
|
||||
suspend fun BehaviourContext.waitChatMemberLeft(
|
||||
fun BehaviourContext.waitChatMemberLeft(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitChatMemberUpdated(initRequest, errorFactory).filter { chatMemberLeftFilter(it) };
|
||||
|
||||
suspend fun BehaviourContext.waitChatMemberSubscribed(
|
||||
fun BehaviourContext.waitChatMemberSubscribed(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitChatMemberUpdated(initRequest, errorFactory).filter { chatMemberSubscribedFilter(it) };
|
||||
|
||||
suspend fun BehaviourContext.waitChatMemberSubscriptionChanged(
|
||||
fun BehaviourContext.waitChatMemberSubscriptionChanged(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitChatMemberUpdated(initRequest, errorFactory).filter { chatMemberSubscriptionChangedFilter(it) };
|
||||
|
||||
suspend fun BehaviourContext.waitChatMemberUnsubscribed(
|
||||
fun BehaviourContext.waitChatMemberUnsubscribed(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitChatMemberUpdated(initRequest, errorFactory).filter { chatMemberUnsubscribedFilter(it) };
|
||||
|
||||
suspend fun BehaviourContext.waitChatMemberGotPromoted(
|
||||
fun BehaviourContext.waitChatMemberGotPromoted(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitChatMemberUpdated(initRequest, errorFactory).filter { chatMemberGotPromotedFilter(it) };
|
||||
|
||||
suspend fun BehaviourContext.waitChatMemberGotPromotionChanged(
|
||||
fun BehaviourContext.waitChatMemberGotPromotionChanged(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitChatMemberUpdated(initRequest, errorFactory).filter { chatMemberGotPromotionChangedFilter(it) };
|
||||
|
||||
suspend fun BehaviourContext.waitChatMemberGotDemoted(
|
||||
fun BehaviourContext.waitChatMemberGotDemoted(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitChatMemberUpdated(initRequest, errorFactory).filter { chatMemberGotDemotedFilter(it) };
|
||||
|
||||
suspend fun BehaviourContext.waitChatMemberBecameOwner(
|
||||
fun BehaviourContext.waitChatMemberBecameOwner(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitChatMemberUpdated(initRequest, errorFactory).filter { chatMemberBecameOwnerFilter(it) };
|
||||
|
||||
suspend fun BehaviourContext.waitChatMemberCeasedOwnership(
|
||||
fun BehaviourContext.waitChatMemberCeasedOwnership(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitChatMemberUpdated(initRequest, errorFactory).filter { chatMemberCeasedOwnershipFilter(it) };
|
||||
|
||||
suspend fun BehaviourContext.waitChatMemberGotRestricted(
|
||||
fun BehaviourContext.waitChatMemberGotRestricted(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitChatMemberUpdated(initRequest, errorFactory).filter { chatMemberGotRestrictedFilter(it) };
|
||||
|
||||
suspend fun BehaviourContext.waitChatMemberGotRestrictionChanged(
|
||||
fun BehaviourContext.waitChatMemberGotRestrictionChanged(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitChatMemberUpdated(initRequest, errorFactory).filter { chatMemberGotRestrictionsChangedFilter(it) };
|
||||
|
||||
suspend fun BehaviourContext.waitChatMemberGotUnrestricted(
|
||||
fun BehaviourContext.waitChatMemberGotUnrestricted(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitChatMemberUpdated(initRequest, errorFactory).filter { chatMemberGotUnrestrictedFilter(it) };
|
||||
|
||||
suspend fun BehaviourContext.waitChatMemberKicked(
|
||||
fun BehaviourContext.waitChatMemberKicked(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitChatMemberUpdated(initRequest, errorFactory).filter { chatMemberKickedFilter(it) };
|
||||
|
||||
suspend fun BehaviourContext.waitCommonChatMemberJoined(
|
||||
fun BehaviourContext.waitCommonChatMemberJoined(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitCommonChatMemberUpdated(initRequest, errorFactory).filter { chatMemberJoinedFilter(it) };
|
||||
|
||||
suspend fun BehaviourContext.waitCommonChatMemberLeft(
|
||||
fun BehaviourContext.waitCommonChatMemberLeft(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitCommonChatMemberUpdated(initRequest, errorFactory).filter { chatMemberLeftFilter(it) };
|
||||
|
||||
suspend fun BehaviourContext.waitCommonChatMemberSubscribed(
|
||||
fun BehaviourContext.waitCommonChatMemberSubscribed(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitCommonChatMemberUpdated(initRequest, errorFactory).filter { chatMemberSubscribedFilter(it) };
|
||||
|
||||
suspend fun BehaviourContext.waitCommonChatMemberSubscriptionChanged(
|
||||
fun BehaviourContext.waitCommonChatMemberSubscriptionChanged(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitCommonChatMemberUpdated(initRequest, errorFactory).filter { chatMemberSubscriptionChangedFilter(it) };
|
||||
|
||||
suspend fun BehaviourContext.waitCommonChatMemberUnsubscribed(
|
||||
fun BehaviourContext.waitCommonChatMemberUnsubscribed(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitCommonChatMemberUpdated(initRequest, errorFactory).filter { chatMemberUnsubscribedFilter(it) };
|
||||
|
||||
suspend fun BehaviourContext.waitCommonChatMemberGotPromoted(
|
||||
fun BehaviourContext.waitCommonChatMemberGotPromoted(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitCommonChatMemberUpdated(initRequest, errorFactory).filter { chatMemberGotPromotedFilter(it) };
|
||||
|
||||
suspend fun BehaviourContext.waitCommonChatMemberGotPromotionChanged(
|
||||
fun BehaviourContext.waitCommonChatMemberGotPromotionChanged(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitCommonChatMemberUpdated(initRequest, errorFactory).filter { chatMemberGotPromotionChangedFilter(it) };
|
||||
|
||||
suspend fun BehaviourContext.waitCommonChatMemberGotDemoted(
|
||||
fun BehaviourContext.waitCommonChatMemberGotDemoted(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitCommonChatMemberUpdated(initRequest, errorFactory).filter { chatMemberGotDemotedFilter(it) };
|
||||
|
||||
suspend fun BehaviourContext.waitCommonChatMemberBecameOwner(
|
||||
fun BehaviourContext.waitCommonChatMemberBecameOwner(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitCommonChatMemberUpdated(initRequest, errorFactory).filter { chatMemberBecameOwnerFilter(it) };
|
||||
|
||||
suspend fun BehaviourContext.waitCommonChatMemberCeasedOwnership(
|
||||
fun BehaviourContext.waitCommonChatMemberCeasedOwnership(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitCommonChatMemberUpdated(initRequest, errorFactory).filter { chatMemberCeasedOwnershipFilter(it) };
|
||||
|
||||
suspend fun BehaviourContext.waitCommonChatMemberGotRestricted(
|
||||
fun BehaviourContext.waitCommonChatMemberGotRestricted(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitCommonChatMemberUpdated(initRequest, errorFactory).filter { chatMemberGotRestrictedFilter(it) };
|
||||
|
||||
suspend fun BehaviourContext.waitCommonChatMemberGotRestrictionChanged(
|
||||
fun BehaviourContext.waitCommonChatMemberGotRestrictionChanged(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitCommonChatMemberUpdated(initRequest, errorFactory).filter { chatMemberGotRestrictionsChangedFilter(it) };
|
||||
|
||||
suspend fun BehaviourContext.waitCommonChatMemberGotUnrestricted(
|
||||
fun BehaviourContext.waitCommonChatMemberGotUnrestricted(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitCommonChatMemberUpdated(initRequest, errorFactory).filter { chatMemberGotUnrestrictedFilter(it) };
|
||||
|
||||
suspend fun BehaviourContext.waitCommonChatMemberKicked(
|
||||
fun BehaviourContext.waitCommonChatMemberKicked(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitCommonChatMemberUpdated(initRequest, errorFactory).filter { chatMemberKickedFilter(it) };
|
||||
|
||||
suspend fun BehaviourContext.waitMyChatMemberJoined(
|
||||
fun BehaviourContext.waitMyChatMemberJoined(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitMyChatMemberUpdated(initRequest, errorFactory).filter { chatMemberJoinedFilter(it) };
|
||||
|
||||
suspend fun BehaviourContext.waitMyChatMemberLeft(
|
||||
fun BehaviourContext.waitMyChatMemberLeft(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitMyChatMemberUpdated(initRequest, errorFactory).filter { chatMemberLeftFilter(it) };
|
||||
|
||||
suspend fun BehaviourContext.waitMyChatMemberSubscribed(
|
||||
fun BehaviourContext.waitMyChatMemberSubscribed(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitMyChatMemberUpdated(initRequest, errorFactory).filter { chatMemberSubscribedFilter(it) };
|
||||
|
||||
suspend fun BehaviourContext.waitMyChatMemberSubscriptionChanged(
|
||||
fun BehaviourContext.waitMyChatMemberSubscriptionChanged(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitMyChatMemberUpdated(initRequest, errorFactory).filter { chatMemberSubscriptionChangedFilter(it) };
|
||||
|
||||
suspend fun BehaviourContext.waitMyChatMemberUnsubscribed(
|
||||
fun BehaviourContext.waitMyChatMemberUnsubscribed(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitMyChatMemberUpdated(initRequest, errorFactory).filter { chatMemberUnsubscribedFilter(it) };
|
||||
|
||||
suspend fun BehaviourContext.waitMyChatMemberGotPromoted(
|
||||
fun BehaviourContext.waitMyChatMemberGotPromoted(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitMyChatMemberUpdated(initRequest, errorFactory).filter { chatMemberGotPromotedFilter(it) };
|
||||
|
||||
suspend fun BehaviourContext.waitMyChatMemberGotPromotionChanged(
|
||||
fun BehaviourContext.waitMyChatMemberGotPromotionChanged(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitMyChatMemberUpdated(initRequest, errorFactory).filter { chatMemberGotPromotionChangedFilter(it) };
|
||||
|
||||
suspend fun BehaviourContext.waitMyChatMemberGotDemoted(
|
||||
fun BehaviourContext.waitMyChatMemberGotDemoted(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitMyChatMemberUpdated(initRequest, errorFactory).filter { chatMemberGotDemotedFilter(it) };
|
||||
|
||||
suspend fun BehaviourContext.waitMyChatMemberBecameOwner(
|
||||
fun BehaviourContext.waitMyChatMemberBecameOwner(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitMyChatMemberUpdated(initRequest, errorFactory).filter { chatMemberBecameOwnerFilter(it) };
|
||||
|
||||
suspend fun BehaviourContext.waitMyChatMemberCeasedOwnership(
|
||||
fun BehaviourContext.waitMyChatMemberCeasedOwnership(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitMyChatMemberUpdated(initRequest, errorFactory).filter { chatMemberCeasedOwnershipFilter(it) };
|
||||
|
||||
suspend fun BehaviourContext.waitMyChatMemberGotRestricted(
|
||||
fun BehaviourContext.waitMyChatMemberGotRestricted(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitMyChatMemberUpdated(initRequest, errorFactory).filter { chatMemberGotRestrictedFilter(it) };
|
||||
|
||||
suspend fun BehaviourContext.waitMyChatMemberGotRestrictionChanged(
|
||||
fun BehaviourContext.waitMyChatMemberGotRestrictionChanged(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitMyChatMemberUpdated(initRequest, errorFactory).filter { chatMemberGotRestrictionsChangedFilter(it) };
|
||||
|
||||
suspend fun BehaviourContext.waitMyChatMemberGotUnrestricted(
|
||||
fun BehaviourContext.waitMyChatMemberGotUnrestricted(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitMyChatMemberUpdated(initRequest, errorFactory).filter { chatMemberGotUnrestrictedFilter(it) };
|
||||
|
||||
suspend fun BehaviourContext.waitMyChatMemberKicked(
|
||||
fun BehaviourContext.waitMyChatMemberKicked(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitMyChatMemberUpdated(initRequest, errorFactory).filter { chatMemberKickedFilter(it) };
|
||||
|
||||
@@ -9,7 +9,7 @@ import dev.inmo.tgbotapi.utils.lowLevelRiskFeatureMessage
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
|
||||
@RiskFeature(lowLevelRiskFeatureMessage)
|
||||
suspend inline fun <reified O : ChatMessageReactionUpdated> BehaviourContext.waitChatMessageReactionUpdated(
|
||||
inline fun <reified O : ChatMessageReactionUpdated> BehaviourContext.waitChatMessageReactionUpdated(
|
||||
initRequest: Request<*>? = null,
|
||||
noinline errorFactory: NullableRequestBuilder<*> = { null }
|
||||
): Flow<O> = expectFlow(
|
||||
@@ -19,13 +19,13 @@ suspend inline fun <reified O : ChatMessageReactionUpdated> BehaviourContext.wai
|
||||
(it.chatMessageReactionUpdatedUpdateOrNull() ?.data as? O).let(::listOfNotNull)
|
||||
}
|
||||
|
||||
suspend fun BehaviourContext.waitChatMessageReactionUpdatedByUser(
|
||||
fun BehaviourContext.waitChatMessageReactionUpdatedByUser(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitChatMessageReactionUpdated<ChatMessageReactionUpdated.ByUser>(initRequest, errorFactory)
|
||||
|
||||
|
||||
suspend fun BehaviourContext.waitChatMessageReactionUpdatedByChat(
|
||||
fun BehaviourContext.waitChatMessageReactionUpdatedByChat(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitChatMessageReactionUpdated<ChatMessageReactionUpdated.ByChat>(initRequest, errorFactory)
|
||||
|
||||
@@ -10,7 +10,7 @@ import dev.inmo.tgbotapi.utils.RiskFeature
|
||||
import dev.inmo.tgbotapi.utils.lowLevelRiskFeatureMessage
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
|
||||
suspend inline fun BehaviourContext.waitChatMessageReactionsCountUpdated(
|
||||
inline fun BehaviourContext.waitChatMessageReactionsCountUpdated(
|
||||
initRequest: Request<*>? = null,
|
||||
noinline errorFactory: NullableRequestBuilder<*> = { null }
|
||||
): Flow<ChatMessageReactionsCountUpdated> = expectFlow(
|
||||
|
||||
@@ -11,7 +11,7 @@ import kotlinx.coroutines.flow.Flow
|
||||
typealias ChosenInlineResultMapper<T> = suspend T.() -> T?
|
||||
|
||||
@RiskFeature(lowLevelRiskFeatureMessage)
|
||||
suspend inline fun <reified O> BehaviourContext.waitChosenInlineResults(
|
||||
inline fun <reified O> BehaviourContext.waitChosenInlineResults(
|
||||
initRequest: Request<*>? = null,
|
||||
noinline errorFactory: NullableRequestBuilder<*> = { null }
|
||||
): Flow<O> = expectFlow(
|
||||
@@ -21,17 +21,17 @@ suspend inline fun <reified O> BehaviourContext.waitChosenInlineResults(
|
||||
(it.chosenInlineResultUpdateOrNull() ?.data as? O).let(::listOfNotNull)
|
||||
}
|
||||
|
||||
suspend fun BehaviourContext.waitChosenInlineResult(
|
||||
fun BehaviourContext.waitChosenInlineResult(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitChosenInlineResults<ChosenInlineResult>(initRequest, errorFactory)
|
||||
|
||||
suspend fun BehaviourContext.waitLocationChosenInlineResult(
|
||||
fun BehaviourContext.waitLocationChosenInlineResult(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitChosenInlineResults<LocationChosenInlineResult>(initRequest, errorFactory)
|
||||
|
||||
suspend fun BehaviourContext.waitBaseChosenInlineResult(
|
||||
fun BehaviourContext.waitBaseChosenInlineResult(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitChosenInlineResults<BaseChosenInlineResult>(initRequest, errorFactory)
|
||||
|
||||
@@ -22,7 +22,7 @@ import kotlinx.coroutines.flow.*
|
||||
* * In case you wish to exclude messages with more than one command, you may use [requireSingleCommand]
|
||||
* * In case you wish to exclude messages with commands params, you may use [requireCommandsWithoutParams]
|
||||
*/
|
||||
suspend fun BehaviourContext.waitCommandMessage(
|
||||
fun BehaviourContext.waitCommandMessage(
|
||||
commandRegex: Regex,
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
@@ -38,13 +38,13 @@ suspend fun BehaviourContext.waitCommandMessage(
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun BehaviourContext.waitCommandMessage(
|
||||
fun BehaviourContext.waitCommandMessage(
|
||||
command: String,
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitCommandMessage(Regex(command), initRequest, errorFactory)
|
||||
|
||||
suspend fun BehaviourContext.waitCommandMessage(
|
||||
fun BehaviourContext.waitCommandMessage(
|
||||
botCommand: BotCommand,
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user